25

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?

14

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/

  • I make change in /etc/fstab but don't know how copy the files in /home to new partition /home becouse I have only one physicali disk with 4 partitions. "boot", "/ ", "/home" and "swap". Where can I create the nev /home that one is still there. I need remove whole partiton "/home" on sdb2 and move it to sdb1 "/" After I restart PC I can see my root account but password didn't work. Now I can reinstal whole ubuntu again :( – pa4k Aug 15 '17 at 21:39
  • But I olny need to resize partition using GParted but it did't work, first I must delete last "SWAP" partition than I can resizing partition before it which was mounted as "/home" but I able resize only up not down (I need to make partition smaller) – pa4k Aug 16 '17 at 7:27
19

I think it's best to follow the Ubuntu wiki guide. I used it a while ago and it worked just fine.

  • 1
    I like how that guide shows you how to find the GUID of your disks. I didn't know how to do that until now. – djangofan Jan 13 '11 at 20:06
1

Are you planning on sharing your /home with windows? If so, I made a few mistakes but it is do-able. Read my learning curve here.

Also, How-To Geek has a good tutorial on merging linux and windows /home and My Documents here as well as many others (HTG is my other source of invaluable info!)

0

Special Case

Copy home directory to Portable USB drive

There are some good reasons to copy home directory to a USB drive. Not having to leave home at home when traveling is one. Not trusting your room mate is another.

  • Format flash drive to ext4.

  • As root, use Grsync to copy home/{username} from internal drive to the flash drive. Preserving owner, permissions and group works for me.

enter image description here

  • Copy the UUID of the new partition.

  • Edit /etc/fstab on the internal drive to add the /home UUID:

    UUID={UUID from above} /home ext4 defaults 0 0

It might be a good idea to use an encrypted home when traveling.

If USB home permissions get messed up they can be updated from the internal drive.

You will either need the USB to boot the computer or edit fstab with an #.

Thanks to ubfan1 for hint - Using existing home directory from a bootable external drive

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.