RHEL5.4LVM logical volume Group Management Configuration

Source: Internet
Author: User
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. In short, lvm supports the creation of disconsecutive cylinders into a partition, which can be freely increased, reduced, and supported by snapshots, providing excellent scalability, at the same time, a volume group can be composed of unequal partitions. Like RAID5, this LVM has been recorded before, but this is too heavy for rhce.

LVM is short for Logical Volume Manager. 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. In short, lvm supports creating a partition with Discontinuous cylinders, which can be freely increased, reduce partitions, support snapshots, and good scalability. At the same time, you can create a volume group by using different partitions. Like RAID5, this LVM has been recorded before, but for rhce, this is too important to be ignored, so we have to sort it out...

1: Use the fdisk tool to divide the data into three partitions and convert the data into 8e format. The partition size can be different here.
[Root @ yang ~] # Fdisk-l | grep LVM
Disk/dev/md1 doesn't contain a valid partition table
/Dev/hda9 5670 6886 9775521 8e Linux LVM
/Dev/hda10 6887 8103 9775521 8e Linux LVM
/Dev/hda11 8104 9320 9775521 8e Linux LVM

2: Convert the divided lvm format into physical volumes
[Root @ yang ~] # Pvcreate/dev/hda9/dev/hda10/dev/hda11
Physical volume "/dev/hda9" successfully created
Physical volume "/dev/hda10" successfully created
Physical volume "/dev/hda11" successfully created

[Root @ yang ~] # Pvs // view the summary. You can use pvdisplay to view the details.
Pv vg Fmt Attr PSize PFree
/Dev/hda10 lvg01 lvm2 a-9.32G 9.32G
/Dev/hda11 lvg01 lvm2 a-9.32G 9.32G
/Dev/hda9 lvg01 lvm2 a-9.32G 9.32G

3: add the previously created physical volume to the volume group named lvg01. If you forget the vgcreate command format, you can use the-h option to obtain command help.
[Root @ yang ~] # Vgcreate lvg01/dev/hda {9, 10, 11}
Volume group "lvg01" successfully created
[Root @ yang ~] # Vgs // view the summary. You can use vgdisplay to view the details.
VG # PV # LV # SN Attr VSize VFree
Lvg01 3 0 0 wz -- n-27.96G 27.96G

4: select a 10 Gb partition from the volume group. The partition name is yang.
[Root @ yang ~] # Lvcreate-L 10G-n yang lvg01
Logical volume "yang" created

[Root @ yang ~] # Lvs // view the summary. You can use lvdisplay to view the details.
Lv vg Attr LSize Origin Snap % Move Log Copy % Convert
Yang lvg01-wi-a-10.00G

5: The format is divided into three levels:/dev/lvg01/yang and mounted.
[Root @ yang ~] # Mkfs. ext3/dev/lvg01/yang
[Root @ yang ~] # Tune2fs-c 0-I 0-o acl/dev/lvg01/yang
Tune2fs 1.39 (29-may-2006)
Setting maximal mount count to-1
Setting interval between checks to 0 seconds
[Root @ yang ~] # Mkdir/data2
[Root @ yang ~] # Mount/dev/lvg01/yang/data2
[Root @ yang ~] # Df-h | grep data2
9.9G 151 M 9.2G 2%/data2

6: View details in the volume group
[Root @ yang ~] # Vgdisplay
--- Volume group ---
VG Name lvg01 // The Name previously defined
System ID
Format lvm2 // Format
Metadata Areas 3
Metadata Sequence No 2
VG Access read/write
VG Status resizable
Max lv 0 // maximum number of logical volumes, 0 is not limited
Cur LV 1 // Number of Current Logical volumes
Open LV 1 // number of currently available logical volumes
Max PV 0
Cur PV 3 // The current volume group contains three physical volumes
Act PV 3 // The active physical volume in the current volume group is three
VG Size 27.96 GB // The total volume group Size is 27.96 GB
PE Size 4.00 MB // The minimum I/O unit of the volume group
Total PE 7158 // The volume group has a Total of 7158 pile points, 7158*4 M = 27.96G
Alloc PE/Size 2560/10 .00 GB // current used point and disk Size
Free PE/Size 4598/17 .96 GB // currently available pile points and disk Size
Vg uuid k1bRbG-2ttW-DgYy-QH9O-NwHB-pyoV-QM0ZnI

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.