Move unallocated space into extended partition to expand logical volume
I just solved it, and I'll post the answer here in case someone else faces a similar problem.
I was unable to resize the partition because my swap space was still in use, so I found out I could disable it using swapoff -a
.
After doing this, GParted allowed me to merge the unallocated space with the fedora logical partition. I then right clicked on the logical partition and selected the Check
option.
Finally, I used the following to actually allocate the free space to the root and home partitions:
lvextend -L +20G /dev/fedora/home
lvextend -L +20G /dev/fedora/root
resize2fs /dev/fedora/home
resize2fs /dev/fedora/root
omijn
Updated on September 18, 2022Comments
-
omijn over 1 year
I have a dual boot setup with Fedora and Windows. For personal reasons, I have uninstalled Windows and would like to use the freed-up space to expand my Fedora partition (which is on a logical partition inside an extended partition).
I am using GParted on Fedora to manage my partitions.
The 66.90GiB unallocated space is where Windows used to be. I am trying to move that space into the extended partition (/dev/sda4) and eventually merge it with /dev/sda6, but GParted does not allow me move/resize the extended partition to make use of the free space. I read that
In Disk Management, unpartitioned space in primary partition area is called unallocated space, while unpartitioned space in extended partition area is named free space; unallocated can’t be used to extend to or create logical partition, and free space can’t be used to enlarge to or create primary partition. (Source: https://www.partitionwizard.com/convertpartition/primary-partition-vs-logical-drive.html)
I'm not sure how true the above statement is, because people seem to have done it or somehow worked around the issue. I have looked at several questions on StackExchange including:
- cannot add unallocated space to extended partition using gparted
- Extend logical partition with unallocated space
- Gparted cannot resize extended or LVM partition (similar, but I'm not able to deactivate my logical partition because fedora/swap is in use)
- What is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?
- Add unallocated space to lvm
- and more
but I'm not sure if they're completely applicable here.
So my question is: how do I move the unallocated space into the extended partition to merge it with the fedora logical partition?
Any help would be appreciated!
Extra Info:
- My computer uses MBR and not GPT, so I am only allowed 4 primary partitions, if that's relevant.
- I can freely move/resize /dev/sda5 and /dev/sda6 around inside the extended partition, but I cannot move/resize the extended partition iteslf.
lsblk output
parted -l output
-
AFH about 6 yearsAre you using the installed Fedora system or an external Live Boot disc? You should be using the latter.
-
Ignacio Vazquez-Abrams about 6 yearsWhy not just create a new PV in /dev/sda2 and add it to the VG?
-
omijn about 6 years@AFH I was using a Live USB! Anyway, I've just solved it. Thanks for the response though!
-
omijn about 6 years@IgnacioVazquez-Abrams I'm a bit new to this, didn't realize I could do that!
-
AFH about 6 yearsSorry, I'd forgotten that Live Boot discs will use a swap partition if it finds it on the hard disc. I should have thought of it.