Dynamic disk policy 2: LVM-Logical Volume Manager 1. role: LVM is short for logical disk volume management (LogicalVolumeManager). It is a mechanism for managing disk partitions in Linux, LVM is a logical layer built on hard disks and partitions to improve the flexibility of disk partition management. The LVM system administrator can easily manage disks.
Dynamic disk policy 2: LVM-Logical Volume Manager
1. role:
LVM is short for Logical volume management (Logical VolumeManager). It is a mechanism for managing disk partitions in Linux. LVM is a Logical layer built on hard disks and partitions, to improve the flexibility of disk partition management. The LVM system administrator can easily manage disk partitions. for example, you can connect several disk partitions to an entire volume Group (VolumeGroup) to form a storage pool. The administrator can create a logical volume Group (LogicalVolumes) and create a file system on the logical volume group. Through LVM, administrators can easily adjust the size of storage volume groups and name, manage, and allocate disk storage by group. for example, they can define disk storage by usage: "development" and "sales" instead of using the physical disk names "sda" and "sdb ". When a new disk is added to the system, the LVM administrator does not need to move the disk files to the new disk to make full use of the new storage space. Instead, the file system can be directly expanded to span the disk.
2. Application:
(1) create physical partitions: Use the fdisk command to create disk partitions sda1, sda2, and sda3, and use the t command to convert the partitions into LVM partitions.
(2) create a Physical Volume PV (Physical Volume ):
Command format: pvcreate <分区列表1> <分区列表2> ......
Example: pvcreate/dev/sda1/dev/sda2/dev/sda3
(3) scan physical volume partitions and create a partitioned database: vgscan (required)
(4) Create a Volume Group VG (Volume Group ):
Command format: vgcreate <卷组名> <物理卷列表>
Example: vgcreate vg0/dev/sda1/dev/sda2
View the volume group information: vgdisplay <卷组名> For example, vgdisplay vg0.
(5) create logical Volume LV (Logic Volume ):
Command format: lvcreate-n <卷名> -L <容量> <卷组名>
Example: lvcreate-n date-L 10 M vg0
(6) format the logical volume: mkfs. ext3/dev/vg0/date
(7) mount the logical volume: mount/dev/vg0/date/mnt
(8) check the logical partition size: lvdisplay/dev/vg0/date
(9) modify the logical volume size:
Unmount partition: umount/dev/vg0/date
Modify the volume size: e2fsadm-L <容量> <逻辑卷名>
Example: e2fsadm-L + 10 M/dev/vg0/date
(10) expand the volume group:
Command format: vgextend <卷组名>
Example:Vgextend vg0/dev/sda3
(11) display logical volume allocation: pvscan