Author Archives: bachem

Increase or Decrease LV Swap in CentOS 6/RHEL 6

Scenario: How to increase or decrease swap space(logical volume swap) in CentOS 6/RHEL 6

System: CentOS 6/ RHEL 6

Steps increase Swap space
Example increase 1 GB swap space.

1) You must check the path of swap logical volume and the free space in the swap volume group before continue to step 2.
# free -m
# lvdisplay | grep swap
# vgs

Continue reading

Remove Logical Volume on CentOS/RHEL

Scenario: Example remove Logical Volume that mount in /cache
System: CentOS/RHEL 6 or 7

Steps:
– Check partition df -h
– Unmount /cache partition.
– Check df -h again to make sure /cache already unmounted
– Check logical volume path that we will remove.
– Edit /etc/fstab and remove or comment the logical volume path that we will remove.
– Type vgs to check Volume Group size before remove logical volume.
Continue reading

Fixing Postfix error unknown user name value: nobody

System: RHEL 6.9

Just got complain from App support Postfix was error.
Check on /var/log/maillog show this error
postfix[2319]: fatal: file /etc/postfix/main.cf: parameter default_privs: unknown user name value: nobody

The solution I did,check on /etc/passwd and found the user nobody in comment state.
Uncomment nobody and Postfix can start again.

# vi /etc/passwd
Uncomment nobody

# service postfix restart

<hr />

Set up sysctl variables on CentOS/RHEL

A sysctl variable represents file locations under the /proc/sys directory. The dot(“.”) notation is used when setting in a configuration file.

RHEL/CentOS 7
– Set a sysctl parameter value immediately (not persistent/not applied on boot) on any version of RHEL:
Use the sysctl -w command. Parameter which take multiple values should have the values enclosed in quotes. For example, to set net.ipv4.ip_forward to 1 and net.ipv4.ip_local_port_range to 1025-65535:

# sysctl -w net.ipv4.ip_forward=1
# sysctl -w net.ipv4.ip_local_port_range="1025 65535"

Alternatively, it is possible to echo values directly into the procfs file which represents a sysctl parameter:

# echo 1 > /proc/sys/net/ipv4/ip_forward
# echo "1025 65535" > /proc/sys/net/ipv4/ip_local_port_range

Continue reading

Install VMware-tools on CentOS 6

Scenario: Install VMware-tools CentOS 6 on VMware ESXi 6

Steps:
– Right click on guest VM.
– Select Install/Upgrade VMware Tools. Note: VMware tools installer will assign as CD/DVD or iso image in the server.
– Login as root access the server or SSH remote to install VMware tools.
Continue reading

Setup NFS server on CentOS 7

Scenario: How to setup NFS server and NFS client.
System:
– CentOS 7 NFS server IP Address: 192.168.99.11
– CentOS 6 NFS client IP Address: 192.168.99.17

Steps:
1) Configure NFS server
– Install NFS packages on the CentOS server with yum:
yum install nfs-utils

– Create the directory that will be shared by NFS:
mkdir /NFSdisk
Continue reading

Extend Logical Volume size on RHEL/CentOS

Scenario: Extend/Growing Logical Volume size for /opt on RHEL/CentOS.
System: CentOS/RHEL 6/7

Login as root then follow below steps:
1) Check free size in Volume Group (vgs). If still there free size then continue to step-2.
# vgs

[root@VTEST01 ~]# vgs
 VG #PV #LV #SN Attr VSize VFree
 VolGroup 2 7 0 wz--n- 59.50g 12.00g
[root@VIDHOLXDTESTAP01 ~]#

Continue reading

Added New VMware Disk and Mount to new Directory on CentOS 6

Scenario:
Added new 10GB VMware Hard Disk,create new Volume Group(Vgs),Create new LVM,format to ext4 and mount to /data

Steps in VMware vSphere:
– Right click on VM -> Select Edit Settings… -> Click Add... -> on Device Type select Hard Disk -> Click Next
– Select Create a new virtual disk -> Click Next
– Specify disk size (this scenario is 10GB), select default Thick Provision Lazy Zeroed then specify the disk location (default is Store with virtual machine) -> Click Next
– Specify Virtual Device Node (default for 2nd Hard disk will be SCSI (0:1), on Mode box leave blank -> Click Next
– Click Finish.
Continue reading