Setup Banner on Console and Remote login CentOS/RHEL 6

Example add below banner.

*                                                                  *
* This system is for the use of authorized users only.  Usage of   *
* this system may be monitored and recorded by system personnel.   *
*                                                                  *
* Unauthorized access to this machine is prohibited                *
* Press Ctrl+D if you are not an authorized user                   *
*                                                                  *
* Anyone using this system expressly consents to such monitoring   *
* and is advised that if such monitoring reveals possible          *
* evidence of criminal activity, system personnel may provide the  *
* evidence from such monitoring to law enforcement officials.      *
*                                                                  *

Continue reading

Decrease Logical Volume size in CentOS 6

Scenario: Decrease Logical Volume /home to 1GB size in CentOS/RHEL 6
System: CentOS/RHEL 6

– Check the drive and LV Path:

[root@centos6 ~]# df -h
Filesystem                       Size  Used Avail Use% Mounted on
/dev/mapper/VolumeGroup-lv_root  9.9G  1.8G  7.6G  20% /
tmpfs                            931M     0  931M   0% /dev/shm
/dev/sda1                        485M   39M  421M   9% /boot
/dev/mapper/VolumeGroup-lv_home  2.5G   68M  2.3G   3% /home
/dev/mapper/VolumeGroup-lv_opt   2.5G   68M  2.3G   3% /opt
/dev/mapper/VolumeGroup-lv_var   9.9G  199M  9.2G   3% /var
[root@centos6 ~]# lvdisplay | grep Path
  LV Path                /dev/VolumeGroup/lv_root
  LV Path                /dev/VolumeGroup/lv_swap
  LV Path                /dev/VolumeGroup/lv_var
  LV Path                /dev/VolumeGroup/lv_opt
  LV Path                /dev/VolumeGroup/lv_home
[root@centos6 ~]# vgs
  VG          #PV #LV #SN Attr   VSize  VFree
  VolumeGroup   1   5   0 wz--n- 39.51g 10.51g
[root@centos6 ~]#

got the logical volume home path is /dev/VolumeGroup/lv_home with 2.5GB size.
Continue reading

Command to re-read added new VM disk that not showing real size CentOS 6

System: CentOS 6.9

– User request in ESXi to add new 30 GB VM disk(2nd disk it mean sdb) but accidentally wrong added VM disk only 10 GB,after remove the 10 Gb and added 30 GB when run fdisk -l still showing 10 GB VM disk size.

Login as root, run this command to re-read the new disk size without reboot the server.

# echo 1 > /sys/block/sdb/device/rescan

Continue reading

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

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

– 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/ 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

Install VMware-tools on CentOS 6

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

– 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.
– CentOS 7 NFS server IP Address:
– CentOS 6 NFS client IP Address:

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