lvm man pages are confusing when it comes to units

Bug #1083680 reported by David D Lowe
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lvm2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The man page for lvextend gives these instructions for the -L option:

       -L, --size [+]LogicalVolumeSize[bBsSkKmMgGtTpPeE]
              Extend or set the logical volume size in units of megabytes. A size suffix of M for megabytes, G for gigabytes, T for terabytes, P
              for petabytes or E for exabytes is optional. With the + sign the value is added to the actual size of the logical volume and without
              it, the value is taken as an absolute one.

By megabyte, does the man page mean 1024 * 1024 bytes, or does it 1000000 bytes?

Let's look at lvs's man page:

       --units hHbBsSkKmMgGtTpPeE
              All sizes are output in these units: (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes,
              (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024. Can also specify custom units e.g. --units 3M

This is less confusing, but still so. Sure a lower-case b is a bit, and an upper-case B is a byte? Surely k is a kibibyte, and K is a kilobyte?

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: lvm2 2.02.95-4ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
Uname: Linux 3.5.0-18-generic i686
ApportVersion: 2.6.1-0ubuntu6
Architecture: i386
Date: Tue Nov 27 16:32:59 2012
MarkForUpload: True
SourcePackage: lvm2
UpgradeStatus: Upgraded to quantal on 2012-10-18 (39 days ago)

Revision history for this message
David D Lowe (flimm) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Please note that lvm2 must preserve backwards compatibility as per Units Policy Exceptions section:
https://wiki.ubuntu.com/UnitsPolicy#Exception

Changed in lvm2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Alasdair G. Kergon (agk2) wrote : Re: [Bug 1083680] Re: lvm man pages are confusing when it comes to units

Output is configurable as described.

Input always uses 512 or 1024 as most people would expect: I rejected
patches to change this upstream when this last came up for discussion
several years ago for multiple reasons amply covered in the ubuntu wiki
URL and comments you linked to.

Alasdair

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I guess the bug is more about making sure the manpages are consistent and a bit more explicit that base 2 units are used throughout. I agree that behaviour of lvm2 tools w.r.t. sizes should not change.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.