Basic use of LVM

Source: Internet
Author: User

 

LVM hierarchy (bottom to top ):

Ext3-> lv (logical volumn)-> pv (physical volumn)-> vg (volumn group)

 

LVM creation steps (for example, creating LVM on/dev/sdb ):

1. format the hard disk: fdisk/dev/sdb

N: Create a new disk partition (which can be a primary partition or an extended partition)

T: Change the partition to the Linux LVM format. The format is 8e.

W: Write and modify the above operations

 

2. Create pv: pvcreate/dev/sdb1

3. Create vg: vgcreate testvg/dev/sdb1

4. Create lv: lvcreate-L20G-n testlv testvg

5. Format lv: mkfs. ext3/dev/testvg/testlv

6. Complete

 

It is not recommended to use the lvreduce command to narrow down the lv partition. After multiple attempts, errors often occur in e2fsck-f.

 

Use the lvextend command to expand the lv partition:

1. lvextend-L + 20G/dev/testvg/testlv

2. e2fsck-f/dev/testvg/testlv

3. resize2fs/dev/testvg/testlv

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.