General LVM operations, general LVM operations

Source: Internet
Author: User

General LVM operations, general LVM operations
1. Create a physical volume on the disk partition
# Fdisk/dev/hdb
# Pvdisplay/dev/hdb1 // create a physical volume on the created partition or hard disk
# Pvcreate/dev/hdb1
 
2. Create a volume group using physical volumes
# Vgcreate myVG/dev/hdb1 // create a volume group. You can add new physical volumes to an existing volume group as needed.
 
3. Create a logical volume in the volume group
# Lvcreate-L 10 M-n myLV1 myVG // create a logical volume from an existing volume group. Generally, only part of the space is allocated to this volume. //
 
4. Create a file system on a logical volume
5. Mount the file system to the directory tree of the Linux System
6. Add a new physical volume to the volume group.
When the volume group does not have enough space to allocate to the logical volume, you can use the vgextend command to add a new physical volume to the volume group to expand the volume group capacity. In special cases, you can also remove existing physical volumes from the volume group.
# Vgextend myVG/dev/hdb2
 
7. expand the capacity of the logical volume
When the space of the logical volume cannot meet the requirements, you can use the lvextend command to allocate the free space in the volume group to the logical volume to expand the capacity of the logical volume. When the free space of the logical volume is too large, you can also use the lvreduce command to reduce the capacity of the logical volume. In this way, the logical volume capacity is dynamically adjusted.
# Lvextend-L + 4 M/dev/myVG/myLV
 
8. Adjust the file system size in the logical volume
LVM Problems

If the system cannot be started, it will be late. LVM does not have redundancy. You should replace the data transfer and bad disk when the system is running.
Generally, we recommend that you first create redundant RAID and then use RAID as the hard disk as the LVM.

What is lvm used in linux?

Lvm is a linux logical volume group management technology used to manage disk partitions.
 

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.