Thursday, January 29, 2015

[How-to] Mount /home to another disk partition

[How-to] Mount /home to another disk partition

I need to free up some space in my linux(Ubuntu) main partition. I decided to move my /home folder to another partition. So I did the following, as instructed here, https://help.ubuntu.com/community/Partitioning/Home/Moving:

~$ sudo blkid
~$ sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
~$ cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
~$ sudo gedit /etc/fstab
    and appended
    UUID=????????  /media/home  ext4  defaults  0  2 
~$ sudo mkdir /media/home
~$ sudo mount -a
~$ sudo rsync -aXS --exclude='/*/.gvfs' /home/. /media/home/.
~$ sudo diff -r /home /media/home
~$ sudo gedit /etc/fstab
     and edited /media/home to /home
~$ cd / && sudo mv /home /old_home && sudo mkdir /home
~$ reboot
~$ sudo rm -r /old_home
~$ sudo rmdir /media/home

No comments:

Post a Comment