Chapter 4. LVM Administration with CLI Commands
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 and removes unused ones.
You can incorporate the vgmknodes command into the vgscan command by specifying the mknodes
argument to the vgscan 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
28
Need help?
Do you have a question about the ENTERPRISE LINUX 4 - LVM ADMINISTRATOR and is the answer not in the manual?
Questions and answers