Mount LVM partitions in Linux

Source: Internet
Author: User
In general, the process of attaching LVM partitions is as follows: for a disk partition (fdisk) -- create a physical volume (pvcreate) -- create a volume Group (vgcreate) -- create a logical volume (lvcreate) -- create a file system (mkfs) -- mount -- add to the file system list (/etc/fstab) 1. use the partitioning tool fdisk to Create LVM

In general, the process of attaching LVM partitions is as follows:
Partitioning a disk (fdisk) --> creating a physical volume (pvcreate) --> Creating a volume Group (vgcreate) --> creating a logical volume (lvcreate) --> creating a file system (mkfs) --> mount a file system --> add to the file system list (/etc/fstab)
1. use the partitioning tool fdisk to Create LVM partitions (the normal LVM partition type is 8e ).


2. create a physical volume
  Pvcreate/dev/sda1/dev/sdb1
3. create a volume Group
  Vgcreate vg0/dev/sda1/dev/sdb1
4. activate the volume Group
  Vgchange-ay vg0
5. create a logical volume
  Vgdisplay vg0
  You can obtain the PE value of the volume group.
  Lvcreate-l 1192330-n lv0 vg0
  This command creates a logical volume named lv0 in the volume group vg0 with a PE size of 1192330, and the device entry is/dev/vg0/lv0 (vg0 is the volume group name, lv0 is the name of the logical volume ).
6. create a file system
  Mkfs. ext3/dev/vg0/lv0
7. after creating a file system, you can load and use it.
  Mkdir/mnt // Lvs
  Mount/dev/vg0/lv0/mnt/lvs
8. if you want to automatically load the file system when the system starts, you must add the following content to/etc/fstab:
# Vi/etc/fstab
/Dev/vg0/lv0/mnt/lvs ext3 defaults 1 2
Related Article

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.