Ubuntu – Shrink Root partition and allocate free space to Home partition


While Installing Ubuntu I did the partition and allocate Disk space like that

  1. 4 GB for Home
  2. 1 GB for linux-swap
  3. 95 GB for root

But sooner I realilized that my /Home partition is almoast occupied all space in Home folder.

Now I want to resize my /home partition.
My gparted view here

Now I want to shrink my Root partition and allocate the free space to my Home partition.
How can I do it ?

Best Answer

Making Changes to Installation Partitions

If you want to make changes to the partitions on your hard disk, they have to be unmounted first. This means that you will have to boot into a live environment either off of a CD/DVD or a USB drive, then use GParted or a similar program to alter your partitions. I'll warn you, though, doing this CAN DAMAGE YOUR INSTALLATION! Make sure that you check and double check the changes before you apply them. This is the order that you will likely want to follow:

  1. Backup all your data
  2. Boot into live environment and start GParted
  3. Shrink the root partition to whatever size
  4. Expand the home partition to fill in the space.
  5. Apply changes
  6. Reboot

Note that if you are expanding a partition that has data on it, the process could take quite long because the data has to be copied to the new addresses.

I can't stress enough that you need to CHECK AND DOUBLE CHECK! I know from experience what kind of problems a simple little error can cause.

In Case of Boot Failure

If, after you make the changes, your installation no longer boots, boot back into the live environment, and install and run boot-repair

  • sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
  • sudo apt-get install -y boot-repair && (boot-repair &)

then run the default recommended repair to fix your GRUB installation.