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 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 360c39
using the \fBgfs2_tool\fP(8) utility's \fBsb proto\fP 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 360c39
by using the \fBgfs2_tool\fP(8) utility's \fBsb table\fP 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 BUGS
Packit Service 360c39
Packit Service 360c39
GFS2 doesn't support \fBerrors=\fP\fIremount-ro\fR or \fBdata=\fP\fIjournal\fR.
Packit Service 360c39
It is not possible to switch support for user and group quotas on and
Packit Service 360c39
off independently of each other. Some of the error messages are rather
Packit Service 360c39
cryptic, if you encounter one of these messages check firstly that gfs_controld
Packit Service 360c39
is running and secondly that you have enough journals on the filesystem
Packit Service 360c39
for the number of nodes in use.
Packit Service 360c39
Packit Service 360c39
.SH SEE ALSO
Packit Service 360c39
Packit Service 360c39
\fBmount\fP(8) for general mount options,
Packit Service 360c39
\fBchmod\fP(1) and \fBchmod\fP(2) for access permission flags,
Packit Service 360c39
\fBacl\fP(5) for access control lists,
Packit Service 360c39
\fBlvm\fP(8) for volume management,
Packit Service 360c39
\fBccs\fP(7) for cluster management,
Packit Service 360c39
\fBumount\fP(8),
Packit Service 360c39
\fBinitrd\fP(4).
Packit Service 360c39
Packit Service 360c39
The GFS2 documentation has been split into a number of sections:
Packit Service 360c39
Packit Service 360c39
\fBgfs2_edit\fP(8) A GFS2 debug tool (use with caution)
Packit Service 360c39
\fBfsck.gfs2\fP(8) The GFS2 file system checker
Packit Service 360c39
\fBgfs2_grow\fP(8) Growing a GFS2 file system
Packit Service 360c39
\fBgfs2_jadd\fP(8) Adding a journal to a GFS2 file system
Packit Service 360c39
\fBmkfs.gfs2\fP(8) Make a GFS2 file system
Packit Service 360c39
\fBgfs2_quota\fP(8) Manipulate GFS2 disk quotas 
Packit Service 360c39
\fBgfs2_tool\fP(8) Tool to manipulate a GFS2 file system (obsolete)
Packit Service 360c39
\fBtunegfs2\fP(8) Tool to manipulate GFS2 superblocks
Packit Service 360c39
Packit Service 360c39
.SH SETUP
Packit Service 360c39
Packit Service 360c39
GFS2 clustering is driven by the dlm, which depends on dlm_controld to
Packit Service 360c39
provide clustering from userspace.  dlm_controld clustering is built on
Packit Service 360c39
corosync cluster/group membership and messaging.
Packit Service 360c39
Packit Service 360c39
Follow these steps to manually configure and run gfs2/dlm/corosync.
Packit Service 360c39
Packit Service 360c39
.B 1. create /etc/corosync/corosync.conf and copy to all nodes
Packit Service 360c39
Packit Service 360c39
In this sample, replace cluster_name and IP addresses, and add nodes as
Packit Service 360c39
needed.  If using only two nodes, uncomment the two_node line.
Packit Service 360c39
See corosync.conf(5) for more information.
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
totem {
Packit Service 360c39
        version: 2
Packit Service 360c39
        secauth: off
Packit Service 360c39
        cluster_name: abc
Packit Service 360c39
}
Packit Service 360c39
Packit Service 360c39
nodelist {
Packit Service 360c39
        node {
Packit Service 360c39
                ring0_addr: 10.10.10.1
Packit Service 360c39
                nodeid: 1
Packit Service 360c39
        }
Packit Service 360c39
        node {
Packit Service 360c39
                ring0_addr: 10.10.10.2
Packit Service 360c39
                nodeid: 2
Packit Service 360c39
        }
Packit Service 360c39
        node {
Packit Service 360c39
                ring0_addr: 10.10.10.3
Packit Service 360c39
                nodeid: 3
Packit Service 360c39
        }
Packit Service 360c39
}
Packit Service 360c39
Packit Service 360c39
quorum {
Packit Service 360c39
        provider: corosync_votequorum
Packit Service 360c39
#       two_node: 1
Packit Service 360c39
}
Packit Service 360c39
Packit Service 360c39
logging {
Packit Service 360c39
        to_syslog: yes
Packit Service 360c39
}
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B 2. start corosync on all nodes
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
systemctl start corosync
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
Run corosync-quorumtool to verify that all nodes are listed.
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B 3. create /etc/dlm/dlm.conf and copy to all nodes
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
To use no fencing, use this line:
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
enable_fencing=0
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
To use no fencing, but exercise fencing functions, use this line:
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
fence_all /bin/true
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
The "true" binary will be executed for all nodes and will succeed (exit 0)
Packit Service 360c39
immediately.
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
To use manual fencing, use this line:
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
fence_all /bin/false
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
The "false" binary will be executed for all nodes and will fail (exit 1)
Packit Service 360c39
immediately.
Packit Service 360c39
Packit Service 360c39
When a node fails, manually run: dlm_tool fence_ack <nodeid>
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
To use stonith/pacemaker for fencing, use this line:
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
fence_all /usr/sbin/dlm_stonith
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
The "dlm_stonith" binary will be executed for all nodes.  If
Packit Service 360c39
stonith/pacemaker systems are not available, dlm_stonith will fail and
Packit Service 360c39
this config becomes the equivalent of the previous /bin/false config.
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
To use an APC power switch, use these lines:
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
device  apc /usr/sbin/fence_apc ipaddr=1.1.1.1 login=admin password=pw
Packit Service 360c39
connect apc node=1 port=1
Packit Service 360c39
connect apc node=2 port=2
Packit Service 360c39
connect apc node=3 port=3
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
Other network switch based agents are configured similarly.
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
To use sanlock/watchdog fencing, use these lines:
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
device wd /usr/sbin/fence_sanlock path=/dev/fence/leases
Packit Service 360c39
connect wd node=1 host_id=1
Packit Service 360c39
connect wd node=2 host_id=2
Packit Service 360c39
unfence wd
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
See fence_sanlock(8) for more information.
Packit Service 360c39
Packit Service 360c39
.B *
Packit Service 360c39
For other fencing configurations see dlm.conf(5) man page.
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B 4. start dlm_controld on all nodes
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
systemctl start dlm
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
Run "dlm_tool status" to verify that all nodes are listed.
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B 5. if using clvm, start clvmd on all nodes
Packit Service 360c39
Packit Service 360c39
systemctl clvmd start
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B 6. make new gfs2 file systems
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 360c39
The cluster_name must match the name used in step 1 above.
Packit Service 360c39
The fs_name must be a unique name in the cluster.
Packit Service 360c39
The -j option is the number of journals to create, there must
Packit Service 360c39
be one for each node that will mount the fs.
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B 7. mount gfs2 file systems
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 360c39
Packit Service 360c39
.B 8. shut down
Packit Service 360c39
Packit Service 360c39
.nf
Packit Service 360c39
umount -a -t gfs2
Packit Service 360c39
systemctl clvmd stop
Packit Service 360c39
systemctl dlm stop
Packit Service 360c39
systemctl corosync stop
Packit Service 360c39
.fi
Packit Service 360c39
Packit Service 360c39
.PP
Packit Service 360c39
Packit Service 360c39
.B More setup information:
Packit Service 360c39
.br
Packit Service 360c39
.BR dlm_controld (8),
Packit Service 360c39
.br
Packit Service 360c39
.BR dlm_tool (8),
Packit Service 360c39
.br
Packit Service 360c39
.BR dlm.conf (5),
Packit Service 360c39
.br
Packit Service 360c39
.BR corosync (8),
Packit Service 360c39
.br
Packit Service 360c39
.BR corosync.conf (5)
Packit Service 360c39
.br