Linux Logical Volume Partitioning

Source: Internet
Author: User

To create a logical Volume:
1. Create a physical volume
PVCREATE/DEV/SDA8/DEV/SDA9/DEV/SDA8/DEV/SDA9 (next two is the physical volume name)
Pvdisplay displaying a physical volume that has been built
2. Create a volume group
Vgcreate Vg0 (Volume group name)/DEV/SDA8/DEV/SDA9
Vgdisplay
3. Create a logical volume
Lvcreate-l 600M (volume size)-N lv0 (volume name) vg0
Lvdisplay

4. Setting Up Mounts
Mkdir/mnt/vg0/lv0
Vi/etc/fstab
/dev/vg0/lv0/mnt/vg0/lv0 ext3 Defaulte

5. File format
Mkfs.ext3/dev/vg0/lv0

Extending the logical volume size
Lvextend-l 1G (extended to 1G)
Resize2fs/dev/vg0/lv0 File System synchronization

Reducing the logical volume size
Umount
E2fscheck-f/dev/vg0/lv0
Resize2fs/dev/vg0/lv0 800M (reduced to 800M)
Lvreduce-l 800m/dev/vg0/lv0
Mount

Adding a new hard disk to a logical volume
1. Physical volume creation
2, expand to the volume group
Vgextend vg0/dev/sda10

Pull out the hard drive
Pvmove vg0/dev/sda10
Vgreduce vg0/dev/sda10

These are some of the operations on LVM

Linux Logical Volume Partitioning

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.