You can use the
-l
argument of the
lvcreate
command to specify the size of the logical
volume in extents. You can also use this argument to specify the percentage of the volume
group to use for the logical volume. The following command creates a logical volume called
mylv
that uses 60% of the total space in volume group
testvol
.
lvcreate -l 60%VG -n mylv testvg
You can also use the
-l
argument of the
lvcreate
command to specify the percentage of the
remaining free space in a volume group as the size of the logical volume. The following
command creates a logical volume called
yourlv
that uses all of the unallocated space in the
volume group
testvol
.
lvcreate -l 100%FREE -n yourlv testvg
You can use
-l
argument of the
lvcreate
command to create a logical volume that uses the
entire volume group. Another way to create a logical volume that uses the entire volume group
is to use the
vgdisplay
command to find the "Total PE" size and to use those results as input
to the the
lvcreate
command.
The following commands create a logical volume called
mylv
that fills the volume group named
testvg
.
# vgdisplay testvg | grep "Total PE"
Total PE
10230
# lvcreate -l 10230 testvg -n mylv
The underlying physical volumes used to create a logical volume can be important if the
physical volume needs to be removed, so you may need to consider this possibility when you
create the logical volume. For information on removing a physical volume from a volume group,
see
Section 3.5, “Removing Physical Volumes from a Volume Group”
.
To create a logical volume to be allocated from a specific physical volume in the volume group,
specify the physical volume or volumes at the end at the
lvcreate
command line. The following
command creates a logical volume named
testlv
in volume group
testvg
allocated from the
physical volume
/dev/sdg1
,
lvcreate -L 1500 -ntestlv testvg /dev/sdg1
You can specify which extents of a physical volume are to be used for a logical volume. The
Chapter 4. LVM Administration with CLI Commands
34
Содержание GLOBAL FILE SYSTEM 5.0
Страница 1: ...LVM Administrator s Guide Configuration and Administration 5 0 ISBN N A Publication date...
Страница 4: ...LVM Administrator s Guide...
Страница 8: ...viii...
Страница 18: ...6...
Страница 28: ...16...
Страница 32: ...20...
Страница 80: ...68...
Страница 90: ...78...
Страница 92: ...80...
Страница 94: ...82...
Страница 112: ...100...