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