Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
4.6. Growing a File System
gfs2_growcommand is used to expand a GFS2 file system after the device where the file system resides has been expanded. Running a
gfs2_growcommand 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.
A regression was found in
kernel-2.6.32-754.el6that can cause the
gfs2_growcommand to fail and potentially cause GFS2 metadata corruption. Before running the
gfs2_growcommand, ensure that you update to
gfs2_growcommand must be run on a mounted file system, but only needs to be run on one node in a cluster. All the other nodes sense that the expansion has occurred and automatically start using the new space.
Once you have created a GFS2 file system with the
mkfs.gfs2command, you cannot decrease the size of the file system.
- Specifies the GFS2 file system to which the actions apply.
Before running the
- Back up important data on the file system.
- Determine the volume that is used by the file system to be expanded by running a
- Expand the underlying cluster volume with LVM. For information on administering LVM volumes, see Logical Volume Manager Administration.
After running the
gfs2_growcommand, run a
dfcommand to check that the new space is now available in the file system.
In this example, the file system on the
/mygfs2fsdirectory is expanded.
gfs2_grow /mygfs2fsFS: 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.
- Specifies the directory where the GFS2 file system is mounted.
- Specifies the device node of the file system.
Table 4.3, “GFS2-specific Options Available While Expanding A File System” describes the GFS2-specific options that can be used while expanding a GFS2 file system.
Table 4.3. GFS2-specific Options Available While Expanding A File System
|Help. Displays a short usage message.|
|Quiet. Turns down the verbosity level.|
|Specifies the size of the new resource group. The default size is 256MB.|
|Test. Do all calculations, but do not write any data to the disk and do not expand the file system.|
|Displays command version information.|