[System/storage] configure LVM

Source: Internet
Author: User

Step 1 confirm the storage location]
Can be confirmed with the network or fdisk-l
Fdisk-l | grep/dev/mapper | grep53.7

############
Lvm
First look at the partition
Powermtdisplaydev = all | grepname
############

Step 2: Create the root directory]
First create mkdir/mysqlData,/mysqlLog


Step 3 create a physical volume-pvs]
1. pvcreate/dev/mapper/mpathb ---- the location of the storage. Refer to step 1.
2. pvcreate/dev/mapper/mpath [B-z] ---- supports regular expressions. For example, the storage file is mpathb to mpathz.
3. pvdisplay ---- view the created pv

Step 4: Create a lifecycle group-vgs]
1. vgcreatevgdata/dev/mapper/mpathb ---- the location where the storage is located. Refer to the first step. After the first storage is created, vgdata adds the other storage to vgdata as follows:
2. vgextendvgdata/dev/mapper/mpath [B-z] ---- Add a new physical volume to the volume group and support regular expressions. For example, the storage file is mpathb to mpathz.

Step 5: Create a logical volume-lvs]
Lvcreate-l100 % FREE-nlvdata-i2-I64vgdata
2. lvcreate-l100 % FREE-nlvlog-i2-I64vglog

Here-I/-I is not recommended if there are no special requirements-I needs to be an integer multiple of the added PV, and later expansion is also an integer multiple of the-I parameter)

Step 6: create a file system]
1. yuminstallxfsprogs ---- requires a rpm-ivhxfsprogs-3.0.0-1.x86_64.rpm or yum: yuminstallxfsprogs-devel.x86_64
2. mkfs. xfs-f/dev/vgdata/lvdata ---- rpm-ivhxfsprogs-3.0.0-1.x86_64.rpm or yum: yuminstallxfsprogs-devel.x86_64 is required

Step 7 mounting]
1. mount-txfs/dev/vgdata/lvdata/mysqlData/
2. mount-txfs/dev/vglog/lvlog/mysqlLog/

The eighth step is to add automatic mount to auto-start]
Vi/etc/rc. d/rc. local
Content
Mount-txfs/dev/vgdata/lvdata/mysqlData/
Mount-txfs/dev/vglog/lvlog/mysqlLog/

View pv/vg/lv]
Pvdisplay, PVS
Vgdisplay, VGS
Lvdisplay, LVS

Delete pv/vg/lv]
Lvremove
Vgremove

Http://blog.chinaunix.net/uid-7530389-id-2050017.html

Http://blog.sina.com.cn/s/blog_67288bc90100k4yc.html

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.