# /etc/fstab
# Created by anaconda on Thu Oct 27 14:05:24 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=feab1e37-ed03-4d4f-9734-4d4de8590e34 / xfs defaults 0 0
UUID=4357d916-ea92-49eb-b52e-250bb5ff9e15 /disk1 ext4 defaults 0 0
挂载fstab中定义的分区:
pvcreate:
[iyunv@hwvpntestcentos dev]# pvcreate /dev/sdc
Physical volume "/dev/sdc" successfully created
[iyunv@hwvpntestcentos dev]# pvcreate /dev/sdd
Physical volume "/dev/sdd" successfully created
[iyunv@hwvpntestcentos dev]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdc lvm2 --- 10.00g 10.00g
/dev/sdd lvm2 --- 10.00g 10.00g
[iyunv@hwvpntestcentos dev]# pvdisplay
"/dev/sdc" is a new physical volume of "10.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdc
VG Name
PV Size 10.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID TdVhKK-TDgM-wH52-a9Yd-fXuS-vWRf-6XpvE8
"/dev/sdd" is a new physical volume of "10.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdd
VG Name
PV Size 10.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID vZB460-GBeB-tgtX-6HGD-BTNY-e0nO-zqnTcU
vgcreate:
[iyunv@hwvpntestcentos dev]# vgcreate data-vg /dev/sdc /dev/sdd
Volume group "data-vg" successfully created
[iyunv@hwvpntestcentos dev]# vgs
VG #PV #LV #SN Attr VSize VFree
data-vg 2 0 0 wz--n- 19.99g 19.99g
[iyunv@hwvpntestcentos dev]# vgdisplay
--- Volume group ---
VG Name data-vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 19.99 GiB
PE Size 4.00 MiB
Total PE 5118
Alloc PE / Size 0 / 0
Free PE / Size 5118 / 19.99 GiB
VG UUID iCYHkh-jnPS-6YVT-ox6y-VT2s-vH2P-mCy6fZ
lvcreate:
[iyunv@hwvpntestcentos dev]# lvcreate -i 2 -I 1024 -l 5118 -n data-lv data-vg
Logical volume "data-lv" created.
[iyunv@hwvpntestcentos dev]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
data-lv data-vg -wi-a----- 19.99g
[iyunv@hwvpntestcentos dev]# lvdisplay
--- Logical volume ---
LV Path /dev/data-vg/data-lv
LV Name data-lv
VG Name data-vg
LV UUID 39jXWa-ncvE-Qz8X-aSKg-1n4o-7uVa-1VxGQE
LV Write Access read/write
LV Creation host, time hwvpntestcentos, 2017-02-07 08:48:05 +0000
LV Status available
# open 0
LV Size 19.99 GiB
Current LE 5118
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
其中-i表示采用Raid0的方式实现磁盘的逻辑卷。此时在/dev/data-vg中存在data-lv的逻辑卷:
# /etc/fstab
# Created by anaconda on Thu Oct 27 14:05:24 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=feab1e37-ed03-4d4f-9734-4d4de8590e34 / xfs defaults 0 0
/dev/data-vg/data-lv /disk1 ext4 defaults 0 0
进行挂载: