Create logical volumes of LVM in Linux

Source: Internet
Author: User

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.

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.