3.14. Recreating a Volume Group Directory
To recreate a volume group directory and logical volume special files, use the
vgmknodes
command. This command checks the LVM2 special files in the
/dev
directory that are needed
for active logical volumes. It creates any special files that are missing removes unused ones.
You can incorporate the
vgmknodes
command into the
vgscan
command by specifying the
--mknodes
argument to the command.
4. Logical Volume Administration
This section describes the commands that perform the various aspects of logical volume
administration.
4.1. Creating Logical Volumes
To create a logical volume, use the
lvcreate
command. You can create linear volumes, striped
volumes, and mirrored volumes, as described in the following subsections.
If you do not specify a name for the logical volume, the default name
lvol#
is used where
#
is
the internal number of the logical volume.
The following sections provide examples of logical volume creation for the three types of logical
volumes you can create with LVM.
4.1.1. Creating Linear Volumes
When you create a logical volume, the logical volume is carved from a volume group using the
free extents on the physical volumes that make up the volume group. Normally logical volumes
use up any space available on the underlying physical volumes on a next-free basis. Modifying
the logical volume frees and reallocates space in the physical volumes.
The following command creates a logical volume 10 gigabytes in size in the volume group
vg1
.
lvcreate -L 10G vg1
The following command creates a 1500 megabyte linear logical volume named
testlv
in the
volume group
testvg
, creating the block device
/dev/testvg/testlv
.
lvcreate -L1500 -ntestlv testvg
The following command creates a 50 gigabyte logical volume named
gfslv
from the free
extents in volume group
vg0
.
lvcreate -L 50G -n gfslv vg0
Logical Volume Administration
33
Содержание 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...