注意:gfs2只能增大,不能縮小!
模擬對共享磁盤進行讀寫:
<<test.sh.sh>>
查看可用空間
[root@node1 test]# vgdisplay VolGroup01
--- Volume group ---
VG Name VolGroup01
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.00 GiB
PE Size 4.00 MiB
Total PE 511
Alloc PE / Size 483 / 1.89 GiB
Free PE / Size 28 / 112.00 MiB
VG UUID HkVPjZ-uyo1-9ngU-C0br-1X4R-tJPx-tkuFwn
查看lv的名稱
[root@node1 test]# lvdisplay VolGroup01
--- Logical volume ---
LV Name /dev/VolGroup01/cartoon
VG Name VolGroup01
LV UUID nxRBSZ-lccc-KlnF-a3f3-4FMl-XwCx-Bm6WK3
LV Write Access read/write
LV Status available
# open 1
LV Size 500.00 MiB
Current LE 125
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Name /dev/VolGroup01/comic
VG Name VolGroup01
LV UUID pgspuD-QGsW-nz8T-kirk-88Wp-307l-9uf81P
LV Write Access read/write
LV Status available
# open 1
LV Size 1.01 GiB
Current LE 258
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
--- Logical volume ---
LV Name /dev/VolGroup01/test
VG Name VolGroup01
LV UUID hSPvi4-DXrN-D8Cl-1GXh-1x9E-tNbW-VSwQ9n
LV Write Access read/write
LV Status available
# open 1
LV Size 400.00 MiB
Current LE 100
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
執行lv擴容
[root@node1 test]# lvextend -L +20M /dev/VolGroup01/test
Extending logical volume test to 420.00 MiB
Logical volume test successfully resized
刷新gfs2大小
[root@node1 test]# gfs2_grow /dev/VolGroup01/test
Error: The device has grown by less than one Resource Group (RG).
The device grew by 20MB. One RG is 30MB for this file system.
gfs2_grow complete.
[root@node1 test]#
解決辦法:
因爲gfs2在創建時會自動估算最佳資源組大小,此處爲30MB,所以如果要進行數據擴容需要至少爲30MB,才能擴容。以下爲官網截圖。解決辦法1是擴容大小爲RG的倍數,解決辦法2爲在gfs2創建時調整RG的大小。
0
收藏