Chapter 4. LVM Administration with CLI Commands
You can use the --segments argument of the lvs command to display information with default
columns that emphasize the segment information. When you use the segments argument, the seg
prefix is optional. The lvs --segments command displays the following fields by default: lv_name,
vg_name, lv_attr, stripes, segtype, seg_size. The default display is sorted by vg_name,
lv_name within the volume group, and seg_start within the logical volume. If the logical volumes
were fragmented, the output from this command would show that.
# lvs --segments
LV
VG
LogVol00 VolGroup00 -wi-ao
LogVol01 VolGroup00 -wi-ao
lv
vg
lv
vg
lv
vg
lv
vg
Using the -v argument with the lvs --segments command adds the following fields to the default
display: seg_start, stripesize, chunksize.
# lvs -v --segments
Finding all logical volumes
LV
VG
lvol0
new_vg owi-a-
newvgsnap1 new_vg swi-a-
The following example shows the default output of the lvs command on a system with one logical
volume configured, followed by the default output of the lvs command with the segments argument
specified.
# lvs
LV
VG
Attr
lvol0 new_vg -wi-a- 52.00M
# lvs --segments
LV
VG
Attr
lvol0 new_vg -wi-a-
4.9.3. Sorting LVM Reports
Normally the entire output of the lvs, vgs, or pvs command has to be generated and stored internally
before it can be sorted and columns aligned correctly. You can specify the --unbuffered argument
to display unsorted output as soon as it is generated.
To specify an alternative ordered list of columns to sort on, use the -O argument of any of the reporting
commands. It is not necessary to include these fields within the output itself.
The following example shows the output of the pvs command that displays the physical volume name,
size, and free space.
52
Attr
#Str Type
1 linear
1 linear 512.00M
-wi-a-
1 linear 104.00M
-wi-a-
1 linear 104.00M
-wi-a-
1 linear 104.00M
-wi-a-
1 linear
Attr
Start SSize
0
52.00M
0
8.00M
LSize
Origin Snap%
#Str Type
SSize
1 linear 52.00M
SSize
36.62G
88.00M
#Str Type
Stripe Chunk
1 linear
0
1 linear
0
Move Log Copy%
0
8.00K
Need help?
Do you have a question about the ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION and is the answer not in the manual?
Questions and answers