Update units_to_bytes() to support (S)ectors: 500 bytes.
- 500 byte (S)ectors is of questionable value but it adds to consistency
if a user happens to use --units S. This seems better than an error.
Updated test/t-covercmd.sh to test --units [hS]
Document the units that can be displayed via --units uniformly.
- (p)etabytes and (e)xabytes were missing in pvs, vgs and lvs man pages.
Made lvreduce man page "... in units of megabytes." consistent (with the
lvextend and lvresize man pages).
v = UINT64_C(1);
*unit_type = *units;
break;
- case 's':
- v *= SECTOR_SIZE;
- break;
case 'b':
case 'B':
v *= UINT64_C(1);
break;
#define KILO UINT64_C(1024)
+ case 's':
+ v *= (KILO/2);
+ break;
case 'k':
v *= KILO;
break;
break;
#undef KILO
#define KILO UINT64_C(1000)
+ case 'S':
+ v *= (KILO/2);
+ break;
case 'K':
v *= KILO;
break;
free space in the Volume Group with the suffix %FREE.
.TP
.I \-L, \-\-size [\-]LogicalVolumeSize[bBsSkKmMgGtTpPeE]
-Reduce or set the logical volume size in units of megabyte by default.
+Reduce or set the logical volume size in units of megabytes.
A size suffix of k for kilobyte, m for megabyte,
g for gigabytes, t for terabytes, p for petabytes
or e for exabytes is optional.
[\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]]
[\-P|\-\-partial] [\-\-rows] [\-\-segments]
[\-\-separator Separator] [\-\-unbuffered]
-[\-\-units hsbkmgtHKMGT]
+[\-\-units hHbBsSkKmMgGtTpPeE]
[\-\-unquoted]
[\-v|\-\-verbose]
[\-\-version] [VolumeGroupName [VolumeGroupName...]]
.I \-\-unbuffered
Produce output immediately without sorting or aligning the columns properly.
.TP
-.I \-\-units hsbkmgtHKMGT
-All sizes are output in these units: (h)uman-readable, (s)ectors, (b)ytes,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes. Capitalise to use multiples
-of 1000 (S.I.) instead of 1024. Can also specify custom (u)nits e.g.
-\-\-units 3M
+.I \-\-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
.TP
.I \-\-unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.
[\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]]
[\-\-rows] [\-\-segments]
[\-\-separator Separator] [\-\-unbuffered]
-[\-\-units hsbkmgtHKMGT]
+[\-\-units hHbBsSkKmMgGtTpPeE]
[\-\-unquoted]
[\-v|\-\-verbose]
[\-\-version] [PhysicalVolume [PhysicalVolume...]]
.I \-\-unbuffered
Produce output immediately without sorting or aligning the columns properly.
.TP
-.I \-\-units hsbkmgtHKMGT
-All sizes are output in these units: (h)uman-readable, (s)ectors, (b)ytes,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes. Capitalise to use multiples
-of 1000 (S.I.) instead of 1024. Can also specify custom (u)nits e.g.
-\-\-units 3M
+.I \-\-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
.TP
.I \-\-unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.
[\-O|\-\-sort [+|-]Key1[,[+|-]Key2[,...]]]
[\-P|\-\-partial] [\-\-rows]
[\-\-separator Separator] [\-\-unbuffered]
-[\-\-units hsbkmgtHKMGT]
+[\-\-units hHbBsSkKmMgGtTpPeE]
[\-\-unquoted]
[\-v|\-\-verbose]
[\-\-version] [VolumeGroupName [VolumeGroupName...]]
.I \-\-unbuffered
Produce output immediately without sorting or aligning the columns properly.
.TP
-.I \-\-units hsbkmgtHKMGT
-All sizes are output in these units: (h)uman-readable, (s)ectors, (b)ytes,
-(k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes. Capitalise to use multiples
-of 1000 (S.I.) instead of 1024. Can also specify custom (u)nits e.g.
-\-\-units 3M
+.I \-\-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
.TP
.I \-\-unquoted
When used with --nameprefixes, output values in the field=value pairs are not quoted.
lvmdiskscan
vgdisplay --units k
lvdisplay --units g
-for i in b k m g t p e H B K M G T P E ; do
+for i in h b s k m g t p e H B S K M G T P E ; do
pvdisplay --units "$i" "$dev1"
done