Sunday, October 15, 2017

14.04 - Extend root partition with unallocated space on the left



I allowed 15Go for my root partition when I installed Ubuntu in dual boot with Windows, but it appears that it was not enough as I don't have space anymore to install new packages.



So I shrinked 35Go of my Windows partition in order to extend my root partition with it, but that new unallocated free space is (two "steps") on the left of my root partition :




GParted partition screenshot



My question is how to extend the ext4 / partition (dev/sda7) with the 34.18GiB unallocated space (a part or the whole of it) ? Is it possible, AND IS IT RISKY (boot problems, etc) to do it by moving the ext4 / partition twice towards the left and then extending it using GParted in Live mode ?



Same question for the /home (dev/sda9) partition.



Yes ... you are having the right idea. Boot from GParted Live media.
You as well can do it from Ubuntu install media (GParted included).
Important : Unmount all partitions (in case there are any mounted).



First move the sda6 partition to the left ... then move the sda7 partition to the left.
Now extend the sda7 ext4 partition - it is not necessary to move the sda9 partition.




After having completed these operations - reinstall the boot loader.
Boot from Ubuntu installation media - open a terminal and execute:



    sudo mount /dev/sda7 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda
update-grub



After this execute :



sudo blkid  


Open another terminal and execute :



sudo gedit /mnt/etc/fstab



Replace the UUID entries with those of the output given from the blkid command.



Boot into BIOS and select Ubuntu in UEFI settings to be the default system to boot.



Note:



sda = disk | sda1 = efi partition | sda7 = system partition (taken from screenshot)


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...