How can I extend this partition?
-
I want to add the unallocated space to the dev/sda5
-
I think you would want to use the pvresize command.
-
@coliver said in How can I extend this partition?:
I think you would want to use the pvresize command.
Yes. First add the space to the pv
pvresize pvname -l 100%FREE
Then tell the file system to expand
resize2fs -p /dev/pvname/lvname
I find parted doesn't work well with lvm and just end up doing everything from the command line anyway, assuming a gui is even available.
-
I think that you have to fdisk it first. The issue is that there is a partition that is the wrong size. LVM sits on top of that layer. I'm unaware of LVM being able to resize the underlying partitions. The normal way to do this would be to make a new PV on sda5 and add it to the same VG as your other one and do it that way.
-
@scottalanmiller said in How can I extend this partition?:
I think that you have to fdisk it first. The issue is that there is a partition that is the wrong size. LVM sits on top of that layer. I'm unaware of LVM being able to resize the underlying partitions. The normal way to do this would be to make a new PV on sda5 and add it to the same VG as your other one and do it that way.
Yuck.
-
Yeah, partitioning is a hard delineation below LVM. You CAN destroy the old partition and create a new one with a larger size and, in theory, it can then be resized. I've done it a bit. But it's scary.
-
I don't think you can do anything as long as the two partitions are locked.
Once you had done that, it should be a simple matter of using the slider bar in the middle. GParted is a pretty useful tool, and I've used it a decent bit.
-
@gjacobse there is no locking at the actually partition level.
-
Is there anything I can do at this point?
-
@IRJ said in How can I extend this partition?:
Is there anything I can do at this point?
Other than the list of things that I said you could do?
-
@scottalanmiller said in How can I extend this partition?:
@IRJ said in How can I extend this partition?:
Is there anything I can do at this point?
Other than the list of things that I said you could do?
I don't fully understand your post.
-
@IRJ said in How can I extend this partition?:
Is there anything I can do at this point?
I'm not sure it will work without creating another partition at this point. So start by creating a partition for the unallocated space. In short, create a new physical volume on the new partition, extend the volume group, extend the logical volume, and resize the file system.
pvcreate /dev/sda2 vgextend vgname /dev/sda2 lvextend lvname -l 100%FREE resize2fs -p /dev/vgname/lvname
-
@IRJ said in How can I extend this partition?:
@scottalanmiller said in How can I extend this partition?:
@IRJ said in How can I extend this partition?:
Is there anything I can do at this point?
Other than the list of things that I said you could do?
I don't fully understand your post.
You can either grow the partition at the partition level OR you can use LVM and make the second partition a PV, add it to the existing VG and then grow your LV(s) on top of that. Two decent means of doing this non-destructively.
-
@scottalanmiller said in How can I extend this partition?:
Yeah, partitioning is a hard delineation below LVM. You CAN destroy the old partition and create a new one with a larger size and, in theory, it can then be resized. I've done it a bit. But it's scary.
That's how I've always done it.
-
@IRJ - click on the yellow where it says /dev/sda5 and see if the "Resize/Move" button works - otherwise you'll have to unlock it somehow, which I think GParted can do but I don't know how.