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