MAN page from OpenSuSE gfs2-utils-3.1.9-lp152.3.5.x86_64.rpm
Section: Maintenance Commands (8)Index
mkfs.gfs2 - create a gfs2 filesystem
] device [block-count]
mkfs.gfs2 is used to create a gfs2 file system.
The default values of the following options have been chosen for best results.In most cases, there should be no need to choose different values. Theexceptions to this are the number of journals (-j
) and the lock table(-t
), as these options will be specific to your cluster.
- -b bytes
- Set the filesystem block size to bytes which must be a power of two. Theminimum block size is 512 and the block size cannot exceed the machine's memorypage size, which on most architectures is 4096 bytes. The default block sizeis 4096 bytes.
- -c megabytes
- Initial size of each journal's quota change file. The default is 1MB.
- Enable debugging output.
- Print out a help message describing the available options, then exit.
- -J megabytes
- The size of each journal. The default journal size is 128 megabytes and theminimum size is 8 megabytes.
- -j journals
- The number of journals for mkfs.gfs2 to create. At least one journal isrequired for each machine that will mount the filesystem concurrently. If thisoption is not specified, only one journal will be created. This number may beused as an indicator of the number of nodes in the cluster in order to optimizethe layout of the filesystem. As such, it is best to set this option with themaximum number of mounters in mind than to add more journals later.
- Do not attempt to discard the block device contents. Issuing discards to thedevice allows some solid state devices and sparse or thin-provisioned storagedevices to optimise free space. Other devices may emulate this behaviour byzeroing the device contents, which can be a slow process.
- Override. This option prevents mkfs.gfs2 from asking for confirmation beforewriting the filesystem.
- Specify extended options. Multiple options can be separated by commas. Validextended options are:
- Display an extended options help summary, then exit.
- This is used to specify the stripe unit for a RAID device or striped logicalvolume. This option ensures that resource groups will be stripe unit alignedand overrides the stripe unit value obtained by probing the device. This valuemust be a multiple of the file system block size and must be specified with theswidthoption.
- This is used to specify the stripe width for a RAID device or striped logicalvolume. This option ensures that resource groups will be stripe aligned andoverrides the stripe width value obtained by probing the device. This valuemust be a multiple of thesunitoption and must also be specified with it.
- Disable or enable the alignment of resource groups. The default behaviour is toalign resource groups to the stripe width and stripe unit values obtained fromprobing the device or specified with theswidthandsunitextended options.
- -p protocol
- Specify the locking protocol to use when no locking protocol is specified atmount time. Valid locking protocols are:
- This is the default. It enables DLM-based locking for use in shared storageconfigurations.
- This enables single-node locking
- Quiet mode. Do not print anything.
- -r megabytes
- mkfs.gfs2 will try to make resource groups approximately this large. Theminimum resource group size is 32 MB and the maximum is 2048 MB. A largeresource group size may increase performance on very large file systems. Ifnot specified, mkfs.gfs2 will choose the resource group size based on thesize and alignment characteristics of the target device.
- -t clustername:lockspace
- The "lock table" pair used to uniquely identify this filesystem in a cluster.The cluster name segment (maximum 32 characters) must match the name given toyour cluster in its configuration; only members of this cluster are permittedto use this file system. The lockspace segment (maximum 30 characters) is aunique file system name used to distinguish this gfs2 file system. Validclusternames and lockspaces may only contain alphanumericcharacters, hyphens (-) and underscores (_).
- Print program version information, then exit.
- Use block-count as the size of the filesystem instead of using the wholedevice. block-count is specified as a number of filesystem blocks.
- # mkfs.gfs2 -t mycluster:mygfs2 -p lock_dlm -j 2 /dev/vg0/lv_gfs2This will create a gfs2 filesystem on the block device /dev/vg0/lv_gfs2. Itwill belong to a cluster named "mycluster" and use the "mygfs2" lock space. Itwill use DLM for locking and create journals for a two-node cluster.# mkfs.gfs2 -t mycluster:mygfs2 -p lock_nolock -j 3 /dev/vg0/lv_gfs2This will create a filesystem on the block device /dev/vg0/lv_gfs2. Itwill belong to a cluster named "mycluster" and use the "mygfs2" lockspace, butit will have no cluster locking by default as lock_nolock is used. It willhave journals for a three-node cluster.
- SEE ALSO
This document was created byman2html,using the manual pages.