Blame gfs2/man/gfs2.5

Packit 6ef888
.TH gfs2 5
Packit 6ef888
Packit 6ef888
.SH NAME
Packit 6ef888
gfs2 \- GFS2 reference guide
Packit 6ef888
Packit 6ef888
.SH SYNOPSIS
Packit 6ef888
Overview of the GFS2 filesystem
Packit 6ef888
Packit 6ef888
.SH DESCRIPTION
Packit 6ef888
Packit 6ef888
GFS2 is a clustered filesystem, designed for sharing data between 
Packit 6ef888
multiple nodes
Packit 6ef888
connected to a common shared storage device. It can also be used as a
Packit 6ef888
local filesystem on a single node, however since the design is aimed
Packit 6ef888
at clusters, that will usually result in lower performance than using
Packit 6ef888
a filesystem designed specifically for single node use.
Packit 6ef888
Packit 6ef888
GFS2 is a journaling filesystem and one journal is required for each node
Packit 6ef888
that will mount the filesystem. The one exception to that is spectator
Packit 6ef888
mounts which are equivalent to mounting a read-only block device and as
Packit 6ef888
such can neither recover a journal or write to the filesystem, so do not
Packit 6ef888
require a journal assigned to them.
Packit 6ef888
Packit Service b32314
The GFS2 documentation has been split into a number of sections:
Packit Service b32314
Packit Service b32314
\fBmkfs.gfs2\fP(8) Create a GFS2 filesystem
Packit Service b32314
.br
Packit Service b32314
\fBfsck.gfs2\fP(8) The GFS2 filesystem checker
Packit Service b32314
.br
Packit Service b32314
\fBgfs2_grow\fP(8) Growing a GFS2 filesystem
Packit Service b32314
.br
Packit Service b32314
\fBgfs2_jadd\fP(8) Adding a journal to a GFS2 filesystem
Packit Service b32314
.br
Packit Service b32314
\fBtunegfs2\fP(8) Tool to manipulate GFS2 superblocks
Packit Service b32314
.br
Packit Service b32314
\fBgfs2_edit\fP(8) A GFS2 debug tool (use with caution)
Packit Service b32314
Packit 6ef888
.SH MOUNT OPTIONS
Packit 6ef888
Packit 6ef888
.TP
Packit 6ef888
\fBlockproto=\fP\fILockProtoName\fR
Packit 6ef888
This specifies which inter-node lock protocol is used by the GFS2 filesystem
Packit 6ef888
for this mount, overriding the default lock protocol name stored in the
Packit 6ef888
filesystem's on-disk superblock.
Packit 6ef888
Packit 6ef888
The \fILockProtoName\fR must be one of the supported locking protocols,
Packit 6ef888
currently these are \fIlock_nolock\fR and \fIlock_dlm\fR.
Packit 6ef888
Packit 6ef888
The default lock protocol name is written to disk initially when creating the
Packit 6ef888
filesystem with \fBmkfs.gfs2\fP(8), -p option.  It can be changed on-disk by
Packit Service 61d4c4
using the \fBtunegfs2\fP(8) command.
Packit 6ef888
Packit 6ef888
The \fBlockproto\fP mount option should be used only under special
Packit 6ef888
circumstances in which you want to temporarily use a different lock protocol
Packit 6ef888
without changing the on-disk default. Using the incorrect lock protocol
Packit 6ef888
on a cluster filesystem mounted from more than one node will almost
Packit 6ef888
certainly result in filesystem corruption.
Packit 6ef888
.TP
Packit 6ef888
\fBlocktable=\fP\fILockTableName\fR
Packit 6ef888
This specifies the identity of the cluster and of the filesystem for this
Packit 6ef888
mount, overriding the default cluster/filesystem identify stored in the
Packit 6ef888
filesystem's on-disk superblock.  The cluster/filesystem name is recognized
Packit 6ef888
globally throughout the cluster, and establishes a unique namespace for
Packit 6ef888
the inter-node locking system, enabling the mounting of multiple GFS2
Packit 6ef888
filesystems.
Packit 6ef888
Packit 6ef888
The format of \fILockTableName\fR is lock-module-specific.  For
Packit 6ef888
\fIlock_dlm\fR, the format is \fIclustername:fsname\fR.  For
Packit 6ef888
\fIlock_nolock\fR, the field is ignored.
Packit 6ef888
Packit 6ef888
The default cluster/filesystem name is written to disk initially when creating
Packit 6ef888
the filesystem with \fBmkfs.gfs2\fP(8), -t option.  It can be changed on-disk
Packit Service 61d4c4
by using the \fBtunegfs2\fP(8) command.
Packit 6ef888
Packit 6ef888
The \fBlocktable\fP mount option should be used only under special
Packit 6ef888
circumstances in which you want to mount the filesystem in a different cluster,
Packit 6ef888
or mount it as a different filesystem name, without changing the on-disk
Packit 6ef888
default.
Packit 6ef888
.TP
Packit 6ef888
\fBlocalflocks\fP
Packit 6ef888
This flag tells GFS2 that it is running as a local (not clustered) filesystem,
Packit 6ef888
so it can allow the kernel VFS layer to do all flock and fcntl file locking.
Packit 6ef888
When running in cluster mode, these file locks require inter-node locks,
Packit 6ef888
and require the support of GFS2.  When running locally, better performance
Packit 6ef888
is achieved by letting VFS handle the whole job.
Packit 6ef888
Packit 6ef888
This is turned on automatically by the lock_nolock module.
Packit 6ef888
.TP
Packit 6ef888
\fBerrors=\fP\fI[panic|withdraw]\fR
Packit 6ef888
Setting errors=panic causes GFS2 to oops when encountering an error that
Packit 6ef888
would otherwise cause the
Packit 6ef888
mount to withdraw or print an assertion warning. The default setting
Packit 6ef888
is errors=withdraw. This option should not be used in a production system.
Packit 6ef888
It replaces the earlier \fBdebug\fP option on kernel versions 2.6.31 and
Packit 6ef888
above.
Packit 6ef888
.TP
Packit 6ef888
\fBacl\fP
Packit 6ef888
Enables POSIX Access Control List \fBacl\fP(5) support within GFS2.
Packit 6ef888
.TP
Packit 6ef888
\fBspectator\fP
Packit 6ef888
Mount this filesystem using a special form of read-only mount.  The mount
Packit 6ef888
does not use one of the filesystem's journals. The node is unable to
Packit 6ef888
recover journals for other nodes.
Packit 6ef888
.TP
Packit 6ef888
\fBnorecovery\fP
Packit 6ef888
A synonym for spectator
Packit 6ef888
.TP
Packit 6ef888
\fBsuiddir\fP
Packit 6ef888
Sets owner of any newly created file or directory to be that of parent
Packit 6ef888
directory, if parent directory has S_ISUID permission attribute bit set.
Packit 6ef888
Sets S_ISUID in any new directory, if its parent directory's S_ISUID is set.
Packit 6ef888
Strips all execution bits on a new file, if parent directory owner is different
Packit 6ef888
from owner of process creating the file.  Set this option only if you know
Packit 6ef888
why you are setting it.
Packit 6ef888
.TP
Packit 6ef888
\fBquota=\fP\fI[off/account/on]\fR
Packit 6ef888
Turns quotas on or off for a filesystem.  Setting the quotas to be in
Packit 6ef888
the "account" state causes the per UID/GID usage statistics to be
Packit 6ef888
correctly maintained by the filesystem, limit and warn values are
Packit 6ef888
ignored.  The default value is "off".
Packit 6ef888
.TP
Packit 6ef888
\fBdiscard\fP
Packit 6ef888
Causes GFS2 to generate "discard" I/O requests for blocks which have
Packit 6ef888
been freed. These can be used by suitable hardware to implement
Packit 6ef888
thin-provisioning and similar schemes. This feature is supported
Packit 6ef888
in kernel version 2.6.30 and above.
Packit 6ef888
.TP
Packit 6ef888
\fBbarrier\fP
Packit 6ef888
This option, which defaults to on, causes GFS2 to send I/O barriers
Packit 6ef888
when flushing the journal. The option is automatically turned off
Packit 6ef888
if the underlying device does not support I/O barriers. We highly
Packit 6ef888
recommend the use of I/O barriers with GFS2 at all times unless
Packit 6ef888
the block device is designed so that it cannot lose its write cache
Packit 6ef888
content (e.g. its on a UPS, or it doesn't have a write cache)
Packit 6ef888
.TP
Packit 6ef888
\fBcommit=\fP\fIsecs\fR
Packit 6ef888
This is similar to the ext3 \fBcommit=\fP option in that it sets
Packit 6ef888
the maximum number of seconds between journal commits if there is
Packit 6ef888
dirty data in the journal. The default is 60 seconds. This option
Packit 6ef888
is only provided in kernel versions 2.6.31 and above.
Packit 6ef888
.TP
Packit 6ef888
\fBdata=\fP\fI[ordered|writeback]\fR
Packit 6ef888
When data=ordered is set, the user data modified by a transaction is
Packit 6ef888
flushed to the disk before the transaction is committed to disk.  This
Packit 6ef888
should prevent the user from seeing uninitialized blocks in a file
Packit 6ef888
after a crash.  Data=writeback mode writes the user data to the disk
Packit 6ef888
at any time after it's dirtied.  This doesn't provide the same
Packit 6ef888
consistency guarantee as ordered mode, but it should be slightly
Packit 6ef888
faster for some workloads.  The default is ordered mode.
Packit 6ef888
.TP
Packit 6ef888
\fBmeta\fP
Packit 6ef888
This option results in selecting the meta filesystem root rather than
Packit 6ef888
the normal filesystem root. This option is normally only used by
Packit 6ef888
the GFS2 utility functions. Altering any file on the GFS2 meta filesystem
Packit 6ef888
may render the filesystem unusable, so only experts in the GFS2
Packit 6ef888
on-disk layout should use this option.
Packit 6ef888
.TP
Packit 6ef888
\fBquota_quantum=\fP\fIsecs\fR
Packit 6ef888
This sets the number of seconds for which a change in the quota
Packit 6ef888
information may sit on one node before being written to the quota
Packit 6ef888
file. This is the preferred way to set this parameter. The value
Packit 6ef888
is an integer number of seconds greater than zero. The default is
Packit 6ef888
60 seconds. Shorter settings result in faster updates of the lazy
Packit 6ef888
quota information and less likelihood of someone exceeding their
Packit 6ef888
quota. Longer settings make filesystem operations involving quotas
Packit 6ef888
faster and more efficient.
Packit 6ef888
.TP
Packit 6ef888
\fBstatfs_quantum=\fP\fIsecs\fR
Packit 6ef888
Setting statfs_quantum to 0 is the preferred way to set the slow version
Packit 6ef888
of statfs. The default value is 30 secs which sets the maximum time
Packit 6ef888
period before statfs changes will be syned to the master statfs file.
Packit 6ef888
This can be adjusted to allow for faster, less accurate statfs values
Packit 6ef888
or slower more accurate values. When set to 0, statfs will always
Packit 6ef888
report the true values.
Packit 6ef888
.TP
Packit 6ef888
\fBstatfs_percent=\fP\fIvalue\fR
Packit 6ef888
This setting provides a bound on the maximum percentage change in
Packit 6ef888
the statfs information on a local basis before it is synced back
Packit 6ef888
to the master statfs file, even if the time period has not
Packit 6ef888
expired. If the setting of statfs_quantum is 0, then this setting
Packit 6ef888
is ignored.
Packit 6ef888
.TP
Packit 6ef888
\fBrgrplvb\fP
Packit 6ef888
This flag tells gfs2 to look for information about a resource group's free
Packit 6ef888
space and unlinked inodes in its glock lock value block. This keeps gfs2 from
Packit 6ef888
having to read in the resource group data from disk, speeding up allocations in
Packit 6ef888
some cases.  This option was added in the 3.6 Linux kernel. Prior to this
Packit 6ef888
kernel, no information was saved to the resource group lvb. \fBNote:\fP To
Packit 6ef888
safely turn on this option, all nodes mounting the filesystem must be running
Packit 6ef888
at least a 3.6 Linux kernel. If any nodes had previously mounted the filesystem
Packit 6ef888
using older kernels, the filesystem must be unmounted on all nodes before it
Packit 6ef888
can be mounted with this option enabled. This option does not need to be
Packit 6ef888
enabled on all nodes using a filesystem.
Packit 6ef888
.TP
Packit 6ef888
\fBloccookie\fP
Packit 6ef888
This flag tells gfs2 to use location based readdir cookies, instead of its
Packit 6ef888
usual filename hash readdir cookies.  The filename hash cookies are not
Packit 6ef888
guaranteed to be unique, and as the number of files in a directory increases,
Packit 6ef888
so does the likelihood of a collision.  NFS requires readdir cookies to be
Packit 6ef888
unique, which can cause problems with very large directories (over 100,000
Packit 6ef888
files). With this flag set, gfs2 will try to give out location based cookies.
Packit 6ef888
Since the cookie is 31 bits, gfs2 will eventually run out of unique cookies,
Packit 6ef888
and will fail back to using hash cookies. The maximum number of files that
Packit 6ef888
could have unique location cookies assuming perfectly even hashing and names of
Packit 6ef888
8 or fewer characters is 1,073,741,824. An average directory should be able to
Packit 6ef888
give out well over half a billion location based cookies. This option was added
Packit 6ef888
in the 4.5 Linux kernel. Prior to this kernel, gfs2 did not add directory
Packit 6ef888
entries in a way that allowed it to use location based readdir cookies.
Packit 6ef888
\fBNote:\fP To safely turn on this option, all nodes mounting the filesystem
Packit 6ef888
must be running at least a 4.5 Linux kernel. If this option is only enabled on
Packit 6ef888
some of the nodes mounting a filesystem, the cookies returned by nodes using
Packit 6ef888
this option will not be valid on nodes that are not using this option, and vice
Packit 6ef888
versa.  Finally, when first enabling this option on a filesystem that had been
Packit 6ef888
previously mounted without it, you must make sure that there are no outstanding
Packit 6ef888
cookies being cached by other software, such as NFS.
Packit 6ef888
Packit 6ef888
.SH SETUP
Packit 6ef888
Packit Service b32314
GFS2 clustering is driven by the dlm, which depends on dlm_controld to provide
Packit Service b32314
clustering from userspace.  dlm_controld clustering is built on corosync
Packit Service b32314
cluster/group membership and messaging. GFS2 also requires clustered lvm which
Packit Service b32314
is provided by lvmlockd or, previously, clvmd. Refer to the documentation for
Packit Service b32314
each of these components and ensure that they are configured before setting up
Packit Service b32314
a GFS2 filesystem. Also refer to your distribution's documentation for any
Packit Service b32314
specific support requirements.
Packit 6ef888
Packit Service b32314
Ensure that gfs2-utils is installed on all nodes which mount the filesystem as
Packit Service b32314
it provides scripts required for correct withdraw event response.
Packit 6ef888
Packit Service b32314
.B 1. Create the gfs2 filesystem
Packit 6ef888
Packit 6ef888
mkfs.gfs2 -p lock_dlm -t cluster_name:fs_name -j num /path/to/storage
Packit 6ef888
Packit Service b32314
The cluster_name must match the name configured in corosync (and thus dlm).
Packit Service b32314
The fs_name must be a unique name for the filesystem in the cluster.
Packit Service b32314
The -j option is the number of journals to create; there must
Packit Service b32314
be one for each node that will mount the filesystem.
Packit 6ef888
Packit 6ef888
.PP
Packit Service b32314
.B 2. Mount the gfs2 filesystem
Packit 6ef888
Packit Service b32314
If you are using a clustered resource manager, see its documentation for
Packit Service b32314
enabling a gfs2 filesystem resource. Otherwise, run:
Packit 6ef888
Packit 6ef888
mount /path/to/storage /mountpoint
Packit 6ef888
Packit 6ef888
Run "dlm_tool ls" to verify the nodes that have each fs mounted.
Packit 6ef888
Packit 6ef888
.PP
Packit Service b32314
.B 3. Shut down
Packit 6ef888
Packit Service b32314
If you are using a clustered resource manager, see its documentation for
Packit Service b32314
disabling a gfs2 filesystem resource. Otherwise, run:
Packit 6ef888
Packit 6ef888
umount -a -t gfs2
Packit 6ef888
Packit 6ef888
.PP
Packit Service b32314
.SH SEE ALSO
Packit 6ef888
Packit Service b32314
\fBmount\fP(8) and \fBumount\fP(8) for general mount information,
Packit Service b32314
\fBchmod\fP(1) and \fBchmod\fP(2) for access permission flags,
Packit Service b32314
\fBacl\fP(5) for access control lists,
Packit Service b32314
\fBlvm\fP(8) for volume management,
Packit Service b32314
\fBdlm_controld\fP(8),
Packit Service b32314
\fBdlm_tool\fP(8),
Packit Service b32314
\fBdlm.conf\fP(5),
Packit Service b32314
\fBcorosync\fP(8),
Packit Service b32314
\fBcorosync.conf\fP(5),