gdisk
. By this, I mean resizing the physical partition
itself, not the physical volume.archiso
on the VM with QEMU. If you have installed grub on ESP partition, chances are you will be dropped to the installed grub bootloader as shown in [this image] instead of the one that comes with the archiso. In this case, press 'c
' for a command-line and run commands as indicated in the image below in order to be able to boot into it:-shrinking
my physical partition. Should there be a need for you to enlarge
your physical partition, the order of the steps will be in the reverse/opposite sequence. In that case, you have to resize the involved partition with gdisk
first, followed by pvresize
and lastly lvresize
.Logical Volume
containing the /
partition). One way to know is by running 'lsblk
' command. It will list information about all available block devices including the MOUNTPOINT
of those devices. If MOUNTPOINT
returns no output for the device, that means it is not mounted.Logical Volume
and its file system all at once (with '-r
' option) by running this command:lvresize -L new-size -r vgname>/lvname
pvresize
with the below command:-pvresize --setphysicalvolumesize new-size /dev/vdaX
PV
is advisable to be slightly bigger than the shrunken LV's
otherwise it may prompt you an error.gdisk /dev/vda
', enter 'p
' to print the partition table, and enter 'i
' to obtain the information of the partition that we want to resize where we will take note of its Partition unique GUID
.d
' and the number of the partition we want to delete. Create a new partition by entering 'n
', enter a new size which I recommend being slightly bigger than the resized Physical Volume's
and change the type of partition to Linux LVM
(8e00) which is of the same type to the previous partition prior to deletion. Enter 'x
' for expert command followed by letter 'c
' to key in the partition's unique GUID
which we took note of previously. Be careful with this action and ensure that the unique GUID is identical before writing the changes or otherwise you may encounter data loss.lvresize
and pvresize
. They are still required to be done before you execute the task with any partitioning tool of your choice, if you are shrinking it).Use parted
or Gparted
!
gdisk
over these two partitioning tools due to:parted
and the way the sizing is managed is just complicated. Or maybe it's just me who wants to think so.Gparted
.archiso
that I can boot into by adding a menuentry in the grub config file.