Tuesday, April 30, 2024
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 27930  / 1 Year ago, tue, april 11, 2023, 2:01:36

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?


More From » partitioning

 Answers
3

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.


[#39596] Tuesday, April 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fectlyole

Total Points: 64
Total Questions: 110
Total Answers: 110

Location: Nicaragua
Member since Thu, Feb 3, 2022
2 Years ago
fectlyole questions
Sun, May 8, 22, 02:54, 2 Years ago
Mon, Jun 21, 21, 16:56, 3 Years ago
Fri, Jul 9, 21, 17:44, 3 Years ago
;