1.lvm
dm (device mapper)設備映射
設備文件 /dev/卷組名/邏輯卷名
/dev/mapper/卷組名-邏輯卷
2.物理卷管理命令pv
pvcreate pvremove pvs pvscan pvmove(移動數據) pvdisplay
3.卷組管理命令 vg -s pe大小 默認4M
vgcreate vgremove vgs vgscan vgextend vgreduce
4.邏輯卷管理命令 lv
lvcreate lvremove lvs lvscan lvextend lvreduce
lvcreate
-n 指定名稱
-L 指定大小
-l %vg|pvs|FREE 打算分配的百分比
5.邏輯卷的擴充步驟
a.先確保擴展的大小,並確保所屬的卷組有足夠的剩余空間
b.擴大物理邊界
lvextend -L [+] size lv_device
c.擴展物理邊界
resize2fs lv_device
6.縮減邏輯卷的步驟
a.卸載卷並強制執行檢查
e2fsck -f lv_device
b.縮減邏輯邊界
resize2fs lv_device SIZE
c.縮減物理邊界
lvreduce -L [-]size lv_device
d.掛載卷
7.快照卷 (邏輯卷的一種,提供過去某一時間的元卷的通道)
lvcreate -s -L SIZE -n name(卷組名) -p(訪問權限) r, rw lv_device
8.擴展卷組
a.准備要添加的物理卷
b.擴展卷組
添加物理卷至卷組中
vgextend vg_name pv_device
9.縮減卷
a.確定要移除的物理卷的空間小於VG當前可用的空間
b.要移除的物理卷上的所有pe移至其它pv
pvmove pv_device