Blame gfs2/man/gfs2.5

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