Ubuntu – How to move the /home directory to another partition if it’s already part of the / partition


I have a wonderful running Maverick Meerkat install going on right now. I want to move my /home to another partition as per many suggestions.

How can I go about doing this without reinstalling the entire Ubuntu system? Can I simply create the partition with gparted and then change the mount point of /home in fstab to reflect it or is it a bit more difficult?

Best Answer

Yes, it is only a matter of adding a new entry to /etc/fstab and then copying the files over.

I suggest using UUIDs for the partition identifier in fstab, the syntax similar to this:

UUID=abcdabcd-acbd-abcd-abcd-abcdabcd /home ext4 defaults 0 2

Copying is best done as root, with "-a" flag passed to cp. Also, better play safe and not remove the files immediately:

cp -a /home/* /path/to/new/partition/
mv /home /old_home
mkdir /home

Note that the user directories must be straight inside the partition, not in /partition/home/

Related Question