Skip to content

How to move /var to new partition in CentOS 7

If you need to move you /var to new partition in CentOS 7 you will need commands like below.

Create new directory:

mkdir /mnt/var_new

Mount lvm:

mount /dev/vg00/lvo10 /mnt/var_new

Copy and sync content:

rsync -avH /var/ /mnt/var_new

Check content in two directories:

diff -r /var /mnt/var_new

Rename /var:

mv /var /var_old

Create new /var:

mkdir /var

Add fstab entry:

/dev/vg00/lvo10 /var xfs defaults 0 0

Unmount /mnt/var_new:

umount /mnt/var_new

Mount /var:

mount /var

Comments