The basic operation of LVM Logical Volume Manager

The basic operation of LVM Logical Volume Manager

Introduction: finished on a hard disk partition, format and mount the partition, it can be used normally, but once the system partition appear not enough, we must be backed up, delete data or re-zoning of the system to meet need. This use to LVM dynamic partitioning, disk capacity can be adjusted in case of change of the existing data, improve the flexibility of the disk.

1, LVM basic terms:

PV (physical volume): LVM basic physical volume is a storage device, usually corresponds to a normal hard disk or the entire partition. Creates a reserved section in the head when the hard disk partition or create a physical volume, record LVM properties.

VG (volume group): one or more physical volumes as a whole. Many physical volumes may be composed of respective different volume group, the group name of the volume defined by the user.

LV (logical): a logical volume based on the volume group, and not directly related to physical volumes. For the logical volume, the volume of each group is as a whole.

2, the process of establishing LVM partition management mechanism:

First, the entire hard disk or partition ordinary physical volume is created; then dispersed in each storage space is the physical volume are physically grouped into a logical whole, i.e., volume group; finally, based on the overall volume group, divided different data storage forming a logical volume, the logical volume is formatted and mount the end user can use the memory unit.

3, LVM management command

The basic operation of LVM Logical Volume Manager

4, PV physical volume management command

pvscan: physical volume for all the scanning system, and outputs the information.

pvcreate: convert partitions or an entire hard disk as a physical volume, and the attribute information added mainly divided into LVM memory unit PE.

pvdisplay: show details of the physical volume.

5, VG volume group management

vgscan: information LVM volume group scanning system has been established.

vgcreate: to create one or more physical volumes to a volume group, a first command for setting a parameter name of the new volume group, followed by the need to specify the physical volume is added to volume group as a parameter.

vgremove: used to delete the specified volume group, the volume group name is specified as a parameter. To ensure that the logical volume group is not being used is deleted.

The basic operation of LVM Logical Volume Manager

The basic operation of LVM Logical Volume Manager

The basic operation of LVM Logical Volume Manager

6, LV Logical Volume Manager

lvscan: scanning for logical volume and related information systems established.

lvcreate: dividing space from the specified volume group to create new logical volumes. You need to specify the size of the logical volume, the volume name and the group name as a parameter.

lvdisplay: Displays detailed information of the logical volume.

lvremove: to delete the specified logical volume, the logical volume file directly using the device as a parameter.

The basic operation of LVM Logical Volume Manager
The basic operation of LVM Logical Volume Manager

The disk expansion

The basic operation of LVM Logical Volume Manager

When selecting the automatic installation process centos partition system will default to the LVM partitioning scheme, no further manual configuration. If you have special needs, you can also use the installation disk customization tools provided by the wizard to adjust the LVM partition. Note that "/ boot" partition can not be created on LVM, must be independent.

Guess you like

Origin blog.51cto.com/14557920/2448399