Chapter 4. Managing GFS2
4.1. Making a File System
mkfs.gfs2command. You can also use the
mkfscommand with the
-t gfs2option specified. A file system is created on an activated LVM volume. The following information is required to run the
- Lock protocol/module name (the lock protocol for a cluster is
- Cluster name (when running as part of a cluster configuration)
- Number of journals (one journal required for each node that may be mounting the file system)
mkfs.gfs2command directly, or you can use the
mkfscommand with the
-tparameter specifying a file system of type
gfs2, followed by the gfs2 file system options.
mkfs.gfs2command, you cannot decrease the size of the file system. You can, however, increase the size of an existing file system with the
gfs2_growcommand, as described in Section 4.6, “Growing a File System”.
mkfs -t gfs2 -p
mkfs -t gfs2 -p
LockTableNameparameters. Improper use of the
LockTableNameparameters may cause file system or lock space corruption.
- Specifies the name of the locking protocol to use. The lock protocol for a cluster is
- This parameter is specified for GFS2 file system in a cluster configuration. It has two parts separated by a colon (no spaces) as follows:
ClusterName, the name of the cluster for which the GFS2 file system is being created.
FSName, the file system name, can be 1 to 16 characters long. The name must be unique for all
lock_dlmfile systems over the cluster, and for all file systems (
lock_nolock) on each local node.
- Specifies the number of journals to be created by the
mkfs.gfs2command. One journal is required for each node that mounts the file system. For GFS2 file systems, more journals can be added later without growing the file system, as described in Section 4.7, “Adding Journals to a File System”.
- Specifies a logical or physical volume.
lock_dlmis the locking protocol that the file system uses, since this is a clustered file system. The cluster name is
alpha, and the file system name is
mydata1. The file system contains eight journals and is created on
mkfs.gfs2 -p lock_dlm -t alpha:mydata1 -j 8 /dev/vg01/lvol0
mkfs -t gfs2 -p lock_dlm -t alpha:mydata1 -j 8 /dev/vg01/lvol0
lock_dlmfile system is made, which can be used in cluster
alpha. The file system name is
mydata2. The file system contains eight journals and is created on
mkfs.gfs2 -p lock_dlm -t alpha:mydata2 -j 8 /dev/vg01/lvol1
mkfs -t gfs2 -p lock_dlm -t alpha:mydata2 -j 8 /dev/vg01/lvol1
mkfs.gfs2” describes the
mkfs.gfs2command options (flags and parameters).
Table 4.1. Command Options:
|Sets the initial size of each journal's quota change file to |
|Enables debugging output.|
|Help. Displays available options.|
|Specifies the size of the journal in megabytes. Default journal size is 128 megabytes. The minimum size is 8 megabytes. Larger journals improve performance, although they use more memory than smaller journals.|
| Specifies the number of journals to be created by the |
|Prevents the |
|Quiet. Do not display anything.|
|Specifies the size of the resource groups in megabytes. The minimum resource group size is 32 MB. The maximum resource group size is 2048 MB. A large resource group size may increase performance on very large file systems. If this is not specified, mkfs.gfs2 chooses the resource group size based on the size of the file system: average size file systems will have 256 MB resource groups, and bigger file systems will have bigger RGs for better performance.|
|Specifies the initial size of each journal's unlinked tag file.|
|Displays command version information.|