I am using a dual boot Windows 10 Pro 64-bit with Ubuntu 16.04 64-bit. I am getting a warning as I log in on Ubuntu about low space in the root.
How can I resize an ext root partition in Ubuntu 16.04?
I am using a dual boot Windows 10 Pro 64-bit with Ubuntu 16.04 64-bit. I am getting a warning as I log in on Ubuntu about low space in the root.
How can I resize an ext root partition in Ubuntu 16.04?
In order to change the root file system you will need to boot from live media, such as GParted Live so that the root file system is not in use. Then you might consider move/shrinking the home partition (sda4) by dragging the left edge of the partition to the right. Then in the unallocated space you could grow the root partition (sda3) by dragging the right edge to the right into the recently freed up unallocated space.
WARNING: Be sure to have a backup of your data in case anything goes wrong due to power outages, hardware failure, or software bugs.
For an example see Moving Space Between Partitions.
You reserved quite low space for the root partition – I would use at least 32 GiB. However, it is still possible to resize it now.
Since there is no free, unallocated space on your hard drive, you must decide whether you take some space from your Windows partition (/dev/sda2
) or Ubuntu /home
partition (/dev/sda4
).
Anyway, you have to resize at least one partition the more demanding way – by moving its beginning.
To access all partitions on your hard disk freely, boot the Ubuntu install disk (USB or DVD) and select Try Ubuntu without installing.
From the live session, run GParted.
Select a partition to shrink. In your case, choose sda2
or sda4
according to your needs.
Select Resize/Move (menu Partition or icon).
Shrink the chosen partition.
a. In the case of sda2
, increase the Free space following.
b. In the case of sda4
, increase the Free space preceding.
Select Resize/Move.
Use the Resize/Move dialog to extend your root partition by utilizing the free space you created in step 5. (In other words, repeat the steps 3–6 with the root partition.)
Select Apply all operations (menu Edit or icon).
After you change the partition containing the /boot
folder, you might need to update GRUB, so it can find its data during the following boot of Ubuntu. (However, my testing VM (Xubuntu 16.04) booted fine without updating GRUB as I was trying the procedure while writing this answer.)
You can restore GRUB using the chroot
method (manual, command-line, and my favorite way) or using Boot-Repair (semi-automated, GUI tool). Both methods work from the live session.
After you update GRUB, you can leave the live session and (hopefully) boot normally to your Ubuntu installation.
The easiest and the safest way to extend Ubuntu root partition without any data loss is extending via hard drive. You just need one thing and many may not have it, and it is DUAL BOOT OR Another PC with a Windows OS where you can connect your Hard drive containing Ubuntu OS. Backup your important data before proceeding.
Step 1:-
First, boot to your Windows OS or connect your hard drive to a PC having Windows OS. Windows simply cant work with ext4 partitions on which Ubuntu runs. So, you need a software called DiskGenius (Previously called PartitionGuru). You can download the free version from here.
Step 2:-
Open it and select your hard drive. Right click on the partition where you have installed Ubuntu and click Resize Partition.DiskGenius
You will see a screen like this. Make sure that you extend your partition from the RIGHT END, or else you may not be able to boot to Ubuntu. If you do not have any unallocated space AFTER the root partition, create one and move it next to your root partition.
Step 3:-
I had my unallocated space before my root partition, so I moved it to the right by using AOMEI Partition Wizard. It also needs to be done on Windows with care. Read instructions carefully.
Here`s how you can do it.AOMEI
Click on move partition and move it before the unallocated space. Then you can proceed with step 2.
It will definitely work if you follow the instructions properly. Just try not to accidently delete the partition. Grub bootloader does not like it.