Method 1: By Modifying the fstab
- Switch to single user mode.
- Make sure any process writing to
/var
is stoped using lsof | grep /var
.
- Create a directory on another partition
mkdir -p /home/var
- Move the
/var
content to /home/var
rsync -va /var /home/var
- Backup the
/var
content under /var.old
mv /var /var.old
- Create an empty
/var
directory
mkdir /var
- Bind the new directory with
/home/var
using mount
mount -o bind /home/var /var
- Update the
/etc/fstab
/home/var /var none bind
Method 2: Using Symbolic Links
mkdir /home/var
mv /var/* /home/var
mv /var /var.old
ln -s /home/var /var