Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have separate / and /home partitions, of which both use ext4 as their filesystem.
How can I merge them, and what is the easiest way?

share|improve this question
I only know about using GParted and a live CD. Resize my /home, and then expand /. Move the /home files into the /, and finally delete the /home and expand /. – Shiki Mar 29 '12 at 11:48
I would say copy/backup your entire /home to an external drive, reinstall Ubuntu with a single partition, then copy your home back in. – Marius Mar 29 '12 at 11:54
@Marius, it turns out, what I wrote works perfectly. (Which is what htorque said in his answer.) So I'll accept his. :) – Shiki Mar 29 '12 at 12:33
up vote 8 down vote accepted

I don't think there's an easier way. You need to copy the data from one partition to the other. You need to delete the old home partition and resize the root partition. That cannot be done on a running system, so a live CD or USB seems like as good as it gets.

  • Boot the live CD/USB.
  • Mount the root partition to /mnt/root.
  • Mount the home partition to /mnt/oldhome.
  • Copy the data using rsync:

    sudo rsync -avz --hard-links --numeric-ids /mnt/oldhome/ /mnt/root/home
  • Open /mnt/root/etc/fstab and delete the entry for your home partition.

  • Unmount the root and home partition and reboot the system. If everything works as expected you can reboot again into the live system and then:
  • Open Gparted.
  • Delete the old home partition, resize the root partition.

That should be it.

share|improve this answer
There are a few improvements which can be made to that rsync command. First of all you will want a slash at the end of the from path, or you will end up with an oldhome, within the homefolder. You might also want to add --hard-links, in case you have any of those under /home. To be on the safe side --numer-ids won't hurt either, depending on what is in /etc/{passwd,group} on the Live CD. – andol Mar 29 '12 at 13:42
Also, do you really expect much benefit from compression when doing a local rsync? – andol Mar 29 '12 at 13:45
Thanks. I added those to the above mentioned rsync call. – qbi Mar 29 '12 at 13:46
@andol: Thanks, I was too sloppy with my answer. As for local compression: yes, I've seen a bit of a performance increase, so as long there's no performance hit, I tend to enable compression. – htorque Mar 29 '12 at 14:34
Good answer, but a few notes: --hard-links can be shortened to just -H, -z would not be desirable/effective on local filesystems, and --numeric-ids would not have any effect on a local filesystem (what's in /etc/passwd on other other drive would not have any effect when run locally). – thomasrutter Apr 15 '15 at 1:06

I dont know about the easiest or the best approach but here is how I would do it. I would just create folder in / and then copy all data from /home to it. Then I will reboot my system using live cd and delete the partition for /home and rename the folder that I created in / to home and then delete entry for /home in fstab. And the last step would be to resize my root partition to consume empty space created by deleting partition for /home.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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