What is the easiest way to merge / and /home?
Solution 1:
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.
Solution 2:
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.