3.5. Growing a GFS2 File System
The
gfs2_grow
command is used to expand a GFS2 file system after the device where the file system resides has been expanded. Running the gfs2_grow
command on an existing GFS2 file system fills all spare space between the current end of the file system and the end of the device with a newly initialized GFS2 file system extension. When the fill operation is completed, the resource index for the file system is updated. All nodes in the cluster can then use the extra storage space that has been added.
gfs2_grow
必须在挂载的文件系统中运行,但只需要在群集的一个节点中运行。其它节点可感觉到扩展的发生,并可自动使用新的空间。
注意
Once you have created a GFS2 file system with the
mkfs.gfs2
command, you cannot decrease the size of the file system.
用法
gfs2_grow MountPoint
MountPoint
- 指定要执行动作的 GFS2 文件系统。
注释
在运行
gfs2_grow
命令前请您:
- 备份文件系统中的重要数据。
- Determine the volume that is used by the file system to be expanded by running the
df
command.MountPoint
- Expand the underlying cluster volume with LVM. For information on administering LVM volumes, see Logical Volume Manager Administration.
After running the
gfs2_grow
command, run the df
command to check that the new space is now available in the file system.
示例
在这个示例中扩展了
/mygfs2fs
目录中的文件系统。
# gfs2_grow /mygfs2fs
FS: Mount Point: /mygfs2fs
FS: Device: /dev/mapper/gfs2testvg-gfs2testlv
FS: Size: 524288 (0x80000)
FS: RG size: 65533 (0xfffd)
DEV: Size: 655360 (0xa0000)
The file system grew by 512MB.
gfs2_grow complete.
完整用法
gfs2_grow [Options
] {MountPoint
|Device
} [MountPoint
|Device
]
MountPoint
- 指定要挂载 GFS2 文件系统的目录。
Device
- 指定文件系统的设备节点。
表 3.3 “扩展文件系统是可用的 GFS2 特定选项” describes the GFS2-specific options that can be used while expanding a GFS2 file system.
选项 | 描述 |
---|---|
-h | 帮助,显示简短用法信息。 |
-q | 静默,降低详细等级。 |
-r Megabytes | Specifies the size of the new resource group. The default size is 256 megabytes. |
-T | 测试。完成所有计算,但不要向磁盘中写入数据,也不要扩展文件系统。 |
-V | 显示命令版本信息。 |