注意: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

收藏

luyx30

132篇文章,46W+人气,0粉丝