My Linux version is CentOS 6.3
Check whether the lvm tool is installed in your system.
Rpm-qa | grep lvm
6.3 By default, lvm tools are installed in the system. The version is 2.0.
Confirm that the system has LVM tools
Then, check the available disks in our system and run the command fdisk-l.
Assume that the current disk used by the system is/dev/sda and there are two idle disks, sdb sdc.
First, create a pv
Pvcreate/dev/sdb/dev/sdc this command can be used to create multiple disks at the same time, and then follow the disk number
After creation, view the created PV for the insurance period
Pvs or pvdisplay pvs: view more detailed information in pvdisplay.
If PV is successfully created, we will start to create a new VG (VG is composed of multiple PVs)
Vgcreate vgname/dev/sdb/dev/sdc vgname must be named with English letters
View VG information through vgs or vgdisplay
Finally, create the lv logical volume (the lv space is allocated from the vg)
Lvcreate-n lvname-L 2G/dev/vgname (-n specifies the name of the created lv,-L specifies the size of the created LV, /dev/vgname is the absolute path for creating VG)
The created LV must be mounted before it can be used.
Mount/dev/vgname/lvname/mnt
OK, our LV has been created.