Chapter 4. LVM Administration with CLI Commands
26
6. Mount the file system to make it available for use.
4.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.4. Logical Volume Administration
This section describes the commands that perform the various aspects of logical volume
administration.
4.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.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
Summary of Contents for CLUSTER SUITE 4.7 - CLUSTER LVM ADMINISTRATORS
Page 1: ...Red Hat Cluster Suite 4 7 Cluster Logical Volume Manager LVM Administrator s Guide ...
Page 6: ...vi ...
Page 12: ...xii ...
Page 24: ...12 ...
Page 62: ...50 ...
Page 72: ...60 ...
Page 82: ...70 ...
Page 84: ...72 ...
Page 86: ...74 ...
Page 96: ...84 ...
Page 103: ...91 Appendix E Revision History Revision History Revision 1 0 ...
Page 104: ...92 ...
Page 108: ...96 ...