Hi!
With the lvm2 plugin, you always have to set the size of a LV to a percentage of the VG's total capacity when creating or resizing a LV.
This is not very straight forward for me to use and feels like quite an odd decision.
A few scenarios to proof my point:
I create an LVM VG with two PVs, totalling to a size of 1.20 TiB or 314712 extends with 4 MiB each.
I now want to store my movie collection on this VG, so I need to create a LV. The collection currently has 689 GiB, so adding some safety margin, I want to create a LV with a size of 890 GiB.. As I need to specify the volume as a percentage of the whole VG, I need to first figure out how much total space ,my VG has and then fire up a calculator. 1.2 TiB = 1228.8 GiB. So 890 TiB / 1228.8 TiB = 0.7243, so I need to specify 72%.
My movie collection grows and I'm running out of space. I have added another disk to my VG in the meantime. So I have to first determine the new size of my VG, which is 2.2 TiB (=2252.8 GiB) or 576716 physical extents now.
When I open the grow dialog on the LV and get presented with that percentage slider again. If I slide it to 10% and hit apply, it will call the lvextend utility and a brief error message which is fading away too quickly to really make sense out of it, but I could make out, that it tries to set the LV size to a value lower than it is right now, which the lvextend command does not allow.
I want to add 200 GiB to the LV. so I'm heading back to my calculator. 890 GiB (current size) + 100 GiB = 990 GiB, 990 GiB / 2252.8 Gib = 0.439, so I need to move the slider to 44 % to get the required size.
lvextend
supports multiple ways of specifying the size:
-L allows you to specify the new size in regular size units (e.g. "1M", "50G", "2T", "400K", etc.)
-l allows you to specify the new size in extents or percent.
Both options allow for prefixing the value with a "+" sign, to enlarge the LV by that amount.
Some usage examples:
# lvextend -L +100G /dev/vg0/lv0 # add 100 GiB to the volume
# lvextend -L 200G /dev/vg0/lv0 # set the volume size to the absolute value of 200 GiB regardless of it's current size
# lvextend -l +400 /dev/vg9/lv0 # add 400 extents to the LV. This is probably not the most useful as extent sizes could vary between VGs, but as there is no option for specifying it when creating the VG, it is most likely always the default with 4 MiB
# lvextend -l +100%FREE /dev/vg0/lv0 # Add all the remaining available space to the volume
I propose to enhance the GUI to allow specifying the size of a LV as absolute size or number of extents when creating it and also when growing it. For both operations, an optional percentage slider makes sense, but mostly only when using the %FREE option. So one could for example add half of the remaining space to a LV.
If a LV is making up 70% of a VG it doesn't make sense to "grow" it to 50% of the total size. However, it makes a lot of sense to add 50% of the remaining free space.
If I should rather file this as an issue on github, let me know please. I'm happy to do so.
Cheers
nomike