how to join root and home partitions on debian jessie

0

I installed Debian Jessie partitioning the system like this:

enter image description here

The " / " partition (sdc1) is getting full, cause of an error on mine on planning its capacity without keeping in mind the system growth (due to updates or to new packages installation).

So now I want to join the " / " and the " /home " into the same partition.

Could be helpful to know that gparted does not allow me to shrink down sdc6 more than what's shown in the image.

ant0nio

Posted 2017-07-09T11:08:19.500

Reputation: 11

Answers

1

Make sure you have (tested working) backups before starting.

The fastest way to join them seems to be to

  1. Create a home directory in the root of sdc6
  2. Move the user directories on sdc6 into that home directory
  3. Copy everything from sdc1 to sdc6 (without overwriting the home directory with an empty one if there is an empty one on sdc1). Could also move the files, but copy leaves a way back.
  4. Run update-grub
  5. Modify /etc/fstab (the one on sdc6) to just use sdc6 as / and not use sdc1
  6. Try whether it works (i.e. reboot)
  7. If it does work, you can delete sdc1.
  8. If you need the extra space, move sdc6 to the beginning of the drive, but this is going to take many hours.

Regarding your statement that gparted won't shrink sdc6: in your screenshot, it's mounted. You need to unmount it to shrink it, and you can only do this from another system (i.e. live-usb or -cd, or on another hard disk, whatever). Then you could also shrink and move to the right sdc6 and increase the size of sdc1, this will take hours but should need no further steps to work.

Nobody

Posted 2017-07-09T11:08:19.500

Reputation: 239

Thanks @Nobody. Could you please check if there is a typo in points 1 or 2? There something I don't understand. The root of sdc6 is /home, and it contains the my-user directory. – ant0nio – 2017-09-16T15:41:25.090

@ant0nio There is not. My suggestion is make sdc6 the new /. The root folder of the partition sdc6 contains the home folders (plural) of individual users, mounted in /home. If you mount sdc6 at / and want the home folders still be in the right place, you need to create a folder in the root of sdc6 called "home" and move the home directories of the users into it. – Nobody – 2017-09-17T18:46:23.250

Thank you for the clarification @Nobody. Finally due to the release of Debian 9 Stable I decided to do a full re-installation. Laborious option, but now I'm sure (or almost sure) that my system will be ok, my main worry was the thing that the sdc6 was an extended partition, and I would prefer my system on a primary. Thank you very much for your help! – ant0nio – 2017-09-22T08:23:20.030