LVM management

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
Reference document:

Study the disk management liunx, is used to the new virtual machine operating system with a hard disk to do experiments. After the basic understanding of the disk management, when I modify the fstab file automatically mount, I saw something strange /dev/VolGroup00/LogVol00 /, checked the information, to know that this is the logical disk. Because the stored knowledge has certain knowledge, so this is not a new concept. Today is the summary about the logical volume operation.

The concept of LVM

Lvm Logical Volume Manager (for the entire logical volume management). Is in between the physical disk and operating system adds another layer, logic layer, this layer of the physical layer for shielding the partition information. As we know, the physical volume management do not have a lot of flexibility, for example if you resize a partition between the two partition size must modify the adjacent partitions can be achieved, the space can not be more blocks on the disk are integrated together to use...... Logical volume is to a physical partition into a logic of large disk, then the logical disk to distinguish a logical partition. This method is easy to implement expansion and contraction, can also use the hard disk space is very flexible. Specific process is like this:

PV: (physical volume)The physical volume, is to partition. These partitions can be located on different disk.
VG: (volume group)Volume group, the hard disk is logically.
LV: (logical volume)Logical volume. Is divided into VG in the disk, with the traditional sense of the partition a meaning.
The concept of things it.

Said the following under the logical volume management.

Logical volume management is a software implementation of LVM. In the use of logic required to install this software roll before.

Create a logical volume steps:

Create partition using the fdisk command. And modify the partition type is 8e, namely the LVM.
Use the partprobe command to make the partition table entry.
The partition into PV. The use of pvcreate /dev/sdb5 (disk partition path) to complete the conversion. Use pvdisplay to view the existing physical volume information.
Create a volume group VG. The use of vgcreate volume group name physical volume (/dev/sdb5). With an empty multiple physical volumes separated. Use vgdisplay to view the volume group information.
Create a logical volume LV. Use the lvcreate -L size (200MB) -n as the logical partition naming volume group name. Use lvdisplay to view the logical volume information. Good logical volume corresponding to a file on the /etc/ volume group name / down. For example, the volume group VG01 under a LV01 partition, then the partition corresponding documents/etc/VG01/LV01.
After the partition created with physical partition no what difference, after type of file system, and then to mount.

LVM said that under expansion.

The specific process to create the class like, original creation process; only the volume group and create a logical volume to modify volume set and modify the logical volume.
The first partition, type selection for 8E. The Partprobe command to make the partition table entry.
Use the pvcreate command to complete the partition into physical volume.
The use of vgextend volume group name new physical volume path. The physical volume is added to the volume group. Completion of the expansion volume group.
Use the lvextend -L extension space size will expand the logical volume. Spatial logical volume expansion.
The use of resize2fs has just extended logical volume path. The logical volume information preservation.

The contraction.

First uninstall the logical volume.
The use of resize2fs device name the new size. Reduce the size of the file system.
Use lvresize -L to modify the size of the. Reduce the size of logical volume.
To re adjust the file system, mount on the line.

Some of the other orders.

Delete Pvremove physical volume
Vgreduce remove physical volume group volume
Vgremove to delete the volume group
Lvremove delete logical volume
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Wesley at December 21, 2013 - 7:58 PM