- make the new partition, & format with mkfs.ext3
- mount the new filesystem in /mnt
#mkdir /mnt/newvar
#mount /dev/sdb1 /mnt/newvar
- Go to single-user mode so that there is no rw activity on the directory during the process
#init 1
- Backup data in var only (not the /var directory itself)
#cd /var
#cp -ax * /mnt/newvar
- Rename the /var directory (to make sure this has worked before deleting it!)
#cd /
#mv var var.old
#mkdir /var
- Unmount the new partition
#umount /dev/sdb1
#mount /dev/sdb1 /var
- If everything goes fine then put an entry into /etc/fstab
/dev/sdb1 /var ext3 defaults 0 0
Thanks Monowar, great tutorial, worked a treat for me (although I chose ext4).
thanks for this howto.
note:
don't use "init 1" if you connect remote with ssh. connection wil be lost.
how do we get all process to stop
how do we get all process to stop
Nice Post! As comment, i'll just add that it's better to disable selinux before starting (or u'll need more options on cp to preserve security contexts…).
could you be a little more specific, How do you disable selinux, or which options you think will be needed…the original post was concise and detailed.
edit /etc/selinux/config and change SELINUX=enforcing to SELINUX=disabled then reboot system.
thanks again but disable selinux is really necesary or handle it. It should be at the start of the post
In fact, you don’t need to disable SELINUX. After mounting the brand new var directory, just make:
#restorecon -Rv /var
And it will restore the SELINUX contexts.
Thank you for this post, Helps me a lot.
Nice stuff dear. Thin Clients & Zero Client
Thanks, worked fine, except that now I'm stuck in terminal mode & can't get back to GUI. Tried init 5 and init 3,also reboot and shutdown -r now, but still no gui. Anyone got another idea? System is deb 7.8 stable.
-teejay
Worked fine, but now I'm stuck in terminal mode. init 5 or shutdown -r now or reboot doesn't get me to GUI.
Any other ideas? System is Deb 7.8 stable on Desktop with BIOS
I had the same problem.Best way to solve this is to use a live CD.
You will have to mount the root partition in /mnt just like /var
Great tips. Just to remember that if your system uses LVM the procedure is a little bit different.