FS#13425 - LVM Setup should support -l option

Attached to Project: Release Engineering
Opened by Markus Heuser (Vrob) - Sunday, 22 February 2009, 21:08 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Monday, 26 November 2012, 04:43 GMT
Task Type Feature Request
Category AIF
Status Closed
Assigned To Dieter Plaetinck (Dieter_be)
Architecture All
Severity Low
Priority Normal
Reported Version 2009.02
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Please add support/frontend for the option -l of "lvcreate".
From the man page:

-l
Gives the number of logical extents to allocate for the new logical volume. This can also be expressed as a percentage of the total space in the Volume Group with the suffix
%VG, of the remaining free space in the Volume Group with the suffix %FREE, or of the remaining free space for the specified PhysicalVolume(s) with the suffix %PVS,

So basically this would give users the option to create a couple of partitions and then assign the rest to the last one without having to calculate how many MiB/GiB are left on their devices.

Steps to "reproduce":
1. Start AIF
2. Prepare a couple of LVs
3. Enter "100%FREE" when being asked for the size
4. Fail when applying the changes
This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Monday, 26 November 2012, 04:43 GMT
Reason for closing:  Deferred
Comment by Dieter Plaetinck (Dieter_be) - Monday, 23 February 2009, 12:32 GMT
Coool my first AIF bugreport!
Thank you Markus, and congratulations!

Right now you can (only) choose the size in MiB. Do I understand correctly that the only real advantages '-l' gives is the possiblity to specify a size in % relative to the VG size?

I'm wondering how I will implement this. probably the easiest implementation is to let the user specify a suffix (either M or %VG) (eg I would use the same field for both -l or -L), parse it later, and depending on the given extension use -l or -L (when creating the FS).
Comment by Markus Heuser (Vrob) - Monday, 23 February 2009, 19:12 GMT
> Do I understand correctly that the only real advantages '-l' gives is the possiblity to specify a size in % relative to the VG size?
At least this is what counts for me :) I don't know whether there are some more tricks one can do with the -l option.
I think it adds a lot of convenience since it is unnecessary to count/calculate MiB left on the device.

Concerning the implementation details:
Being a lazy bioinformatics student I would defer the choice to the users. Just let them select between "Enter size in MiB" and "Enter percentage of physical volume / remaining free space on logical volume". Well, something like that.
But perhaps parsing the field is finally the more consistent method.
Comment by Dieter Plaetinck (Dieter_be) - Monday, 23 February 2009, 20:17 GMT
well, i think I need an approach similar to my proposal, because i can only store 1 "field" related to size. (I have already fs_opts and fs_params and I don't even remember from the top of my head where I need those for, but I need them for other things, so I rather keep the size in 1 field)

Now I've come to think of it, specifying as %VG (or %PV) would be hard to do too because at "definition time" the interpretation of for instance %50 would mean half of the VG, but at execution time, if already 2 other LV's are made and you make a 3rd, it will only be half of the remaining space.

I think I will keep it like it is but allow a "magic marker" eg "REST" MiB, which would use -l 100%VG, that's pretty much the only use I see in this. (I don't think the %VG, %PV etc are worth implementing if you can specify a size in MiB)
Comment by whistle (whistle) - Tuesday, 31 May 2011, 23:31 GMT
What is the status of this bug report?

Is "REST" allowed in the size field now?
Comment by Biosko (Biosko) - Sunday, 09 October 2011, 00:42 GMT
whistle>
lvcreate -l 100%FREE is working OK.
Comment by Dieter Plaetinck (Dieter_be) - Sunday, 09 October 2011, 17:09 GMT
@Biosko, this ticket is about adding support to AIF.

Loading...