标签:lvm创建-rhel7
1、创建pv
[root@localhost ~]# pvcreate /dev/sdb[1-3]
[root@localhost ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 rhel lvm2 a-- 12.00g 4.00m
/dev/sdb1 lvm2 --- 100.00m 100.00m
/dev/sdb2 lvm2 --- 1.00g 1.00g
/dev/sdb3 lvm2 --- 1.00g 1.00g
2、创建VG
[root@localhost ~]# vgcreate datavg /dev/sdb[1-2]
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
datavg 2 0 0 wz--n- 1.09g 1.09g
rhel 1 2 0 wz--n- 12.00g 4.00m
3、创建2个lv
[root@localhost ~]# lvcreate -n datalv -L 500M datavg -n指定lv名字 -L指定大小
Logical volume "datalv" created.
[root@localhost ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
datalv datavg -wi-a----- 500.00m
root rhel -wi-ao---- 10.00g
swap rhel -wi-ao---- 2.00g
[root@localhost ~]# lvcreate -n applv -L 500M datavg
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
datavg 2 2 0 wz--n- 1.09g 116.00m
rhel 1 2 0 wz--n- 12.00g 4.00m
[root@localhost ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
applv datavg -wi-a----- 500.00m
datalv datavg -wi-a----- 500.00m
root rhel -wi-ao---- 10.00g
swap rhel -wi-ao---- 2.00g
4、格式化,挂载
[root@localhost ~]# mkfs.xfs /dev/datavg/applv
[root@localhost ~]# mkdir applv
[root@localhost ~]# mount /dev/datavg/applv /applv
[root@localhost ~]# echo "/dev/datavg/applv /root/applv xfs defaults 0 0" >>/etc/fstab
本文出自 “小行星” 博客,请务必保留此出处http://3203180.blog.51cto.com/3193180/1901210
标签:lvm创建-rhel7
原文地址:http://3203180.blog.51cto.com/3193180/1901210