Blame gfs2/man/gfs2.5.bz1757115-gfs2_5_General_updates_and_layout_improvements

Packit a37e10
.TH gfs2 5
Packit a37e10
Packit a37e10
.SH NAME
Packit a37e10
gfs2 \- GFS2 reference guide
Packit a37e10
Packit a37e10
.SH SYNOPSIS
Packit a37e10
Overview of the GFS2 filesystem
Packit a37e10
Packit a37e10
.SH DESCRIPTION
Packit a37e10
Packit a37e10
GFS2 is a clustered filesystem, designed for sharing data between 
Packit a37e10
multiple nodes
Packit a37e10
connected to a common shared storage device. It can also be used as a
Packit a37e10
local filesystem on a single node, however since the design is aimed
Packit a37e10
at clusters, that will usually result in lower performance than using
Packit a37e10
a filesystem designed specifically for single node use.
Packit a37e10
Packit a37e10
GFS2 is a journaling filesystem and one journal is required for each node
Packit a37e10
that will mount the filesystem. The one exception to that is spectator
Packit a37e10
mounts which are equivalent to mounting a read-only block device and as
Packit a37e10
such can neither recover a journal or write to the filesystem, so do not
Packit a37e10
require a journal assigned to them.
Packit a37e10
Packit a37e10
.SH MOUNT OPTIONS
Packit a37e10
Packit a37e10
.TP
Packit a37e10
\fBlockproto=\fP\fILockProtoName\fR
Packit a37e10
This specifies which inter-node lock protocol is used by the GFS2 filesystem
Packit a37e10
for this mount, overriding the default lock protocol name stored in the
Packit a37e10
filesystem's on-disk superblock.
Packit a37e10
Packit a37e10
The \fILockProtoName\fR must be one of the supported locking protocols,
Packit a37e10
currently these are \fIlock_nolock\fR and \fIlock_dlm\fR.
Packit a37e10
Packit a37e10
The default lock protocol name is written to disk initially when creating the
Packit a37e10
filesystem with \fBmkfs.gfs2\fP(8), -p option.  It can be changed on-disk by
Packit a37e10
using the \fBgfs2_tool\fP(8) utility's \fBsb proto\fP command.
Packit a37e10
Packit a37e10
The \fBlockproto\fP mount option should be used only under special
Packit a37e10
circumstances in which you want to temporarily use a different lock protocol
Packit a37e10
without changing the on-disk default. Using the incorrect lock protocol
Packit a37e10
on a cluster filesystem mounted from more than one node will almost
Packit a37e10
certainly result in filesystem corruption.
Packit a37e10
.TP
Packit a37e10
\fBlocktable=\fP\fILockTableName\fR
Packit a37e10
This specifies the identity of the cluster and of the filesystem for this
Packit a37e10
mount, overriding the default cluster/filesystem identify stored in the
Packit a37e10
filesystem's on-disk superblock.  The cluster/filesystem name is recognized
Packit a37e10
globally throughout the cluster, and establishes a unique namespace for
Packit a37e10
the inter-node locking system, enabling the mounting of multiple GFS2
Packit a37e10
filesystems.
Packit a37e10
Packit a37e10
The format of \fILockTableName\fR is lock-module-specific.  For
Packit a37e10
\fIlock_dlm\fR, the format is \fIclustername:fsname\fR.  For
Packit a37e10
\fIlock_nolock\fR, the field is ignored.
Packit a37e10
Packit a37e10
The default cluster/filesystem name is written to disk initially when creating
Packit a37e10
the filesystem with \fBmkfs.gfs2\fP(8), -t option.  It can be changed on-disk
Packit a37e10
by using the \fBgfs2_tool\fP(8) utility's \fBsb table\fP command.
Packit a37e10
Packit a37e10
The \fBlocktable\fP mount option should be used only under special
Packit a37e10
circumstances in which you want to mount the filesystem in a different cluster,
Packit a37e10
or mount it as a different filesystem name, without changing the on-disk
Packit a37e10
default.
Packit a37e10
.TP
Packit a37e10
\fBlocalflocks\fP
Packit a37e10
This flag tells GFS2 that it is running as a local (not clustered) filesystem,
Packit a37e10
so it can allow the kernel VFS layer to do all flock and fcntl file locking.
Packit a37e10
When running in cluster mode, these file locks require inter-node locks,
Packit a37e10
and require the support of GFS2.  When running locally, better performance
Packit a37e10
is achieved by letting VFS handle the whole job.
Packit a37e10
Packit a37e10
This is turned on automatically by the lock_nolock module.
Packit a37e10
.TP
Packit a37e10
\fBerrors=\fP\fI[panic|withdraw]\fR
Packit a37e10
Setting errors=panic causes GFS2 to oops when encountering an error that
Packit a37e10
would otherwise cause the
Packit a37e10
mount to withdraw or print an assertion warning. The default setting
Packit a37e10
is errors=withdraw. This option should not be used in a production system.
Packit a37e10
It replaces the earlier \fBdebug\fP option on kernel versions 2.6.31 and
Packit a37e10
above.
Packit a37e10
.TP
Packit a37e10
\fBacl\fP
Packit a37e10
Enables POSIX Access Control List \fBacl\fP(5) support within GFS2.
Packit a37e10
.TP
Packit a37e10
\fBspectator\fP
Packit a37e10
Mount this filesystem using a special form of read-only mount.  The mount
Packit a37e10
does not use one of the filesystem's journals. The node is unable to
Packit a37e10
recover journals for other nodes.
Packit a37e10
.TP
Packit a37e10
\fBnorecovery\fP
Packit a37e10
A synonym for spectator
Packit a37e10
.TP
Packit a37e10
\fBsuiddir\fP
Packit a37e10
Sets owner of any newly created file or directory to be that of parent
Packit a37e10
directory, if parent directory has S_ISUID permission attribute bit set.
Packit a37e10
Sets S_ISUID in any new directory, if its parent directory's S_ISUID is set.
Packit a37e10
Strips all execution bits on a new file, if parent directory owner is different
Packit a37e10
from owner of process creating the file.  Set this option only if you know
Packit a37e10
why you are setting it.
Packit a37e10
.TP
Packit a37e10
\fBquota=\fP\fI[off/account/on]\fR
Packit a37e10
Turns quotas on or off for a filesystem.  Setting the quotas to be in
Packit a37e10
the "account" state causes the per UID/GID usage statistics to be
Packit a37e10
correctly maintained by the filesystem, limit and warn values are
Packit a37e10
ignored.  The default value is "off".
Packit a37e10
.TP
Packit a37e10
\fBdiscard\fP
Packit a37e10
Causes GFS2 to generate "discard" I/O requests for blocks which have
Packit a37e10
been freed. These can be used by suitable hardware to implement
Packit a37e10
thin-provisioning and similar schemes. This feature is supported
Packit a37e10
in kernel version 2.6.30 and above.
Packit a37e10
.TP
Packit a37e10
\fBbarrier\fP
Packit a37e10
This option, which defaults to on, causes GFS2 to send I/O barriers
Packit a37e10
when flushing the journal. The option is automatically turned off
Packit a37e10
if the underlying device does not support I/O barriers. We highly
Packit a37e10
recommend the use of I/O barriers with GFS2 at all times unless
Packit a37e10
the block device is designed so that it cannot lose its write cache
Packit a37e10
content (e.g. its on a UPS, or it doesn't have a write cache)
Packit a37e10
.TP
Packit a37e10
\fBcommit=\fP\fIsecs\fR
Packit a37e10
This is similar to the ext3 \fBcommit=\fP option in that it sets
Packit a37e10
the maximum number of seconds between journal commits if there is
Packit a37e10
dirty data in the journal. The default is 60 seconds. This option
Packit a37e10
is only provided in kernel versions 2.6.31 and above.
Packit a37e10
.TP
Packit a37e10
\fBdata=\fP\fI[ordered|writeback]\fR
Packit a37e10
When data=ordered is set, the user data modified by a transaction is
Packit a37e10
flushed to the disk before the transaction is committed to disk.  This
Packit a37e10
should prevent the user from seeing uninitialized blocks in a file
Packit a37e10
after a crash.  Data=writeback mode writes the user data to the disk
Packit a37e10
at any time after it's dirtied.  This doesn't provide the same
Packit a37e10
consistency guarantee as ordered mode, but it should be slightly
Packit a37e10
faster for some workloads.  The default is ordered mode.
Packit a37e10
.TP
Packit a37e10
\fBmeta\fP
Packit a37e10
This option results in selecting the meta filesystem root rather than
Packit a37e10
the normal filesystem root. This option is normally only used by
Packit a37e10
the GFS2 utility functions. Altering any file on the GFS2 meta filesystem
Packit a37e10
may render the filesystem unusable, so only experts in the GFS2
Packit a37e10
on-disk layout should use this option.
Packit a37e10
.TP
Packit a37e10
\fBquota_quantum=\fP\fIsecs\fR
Packit a37e10
This sets the number of seconds for which a change in the quota
Packit a37e10
information may sit on one node before being written to the quota
Packit a37e10
file. This is the preferred way to set this parameter. The value
Packit a37e10
is an integer number of seconds greater than zero. The default is
Packit a37e10
60 seconds. Shorter settings result in faster updates of the lazy
Packit a37e10
quota information and less likelihood of someone exceeding their
Packit a37e10
quota. Longer settings make filesystem operations involving quotas
Packit a37e10
faster and more efficient.
Packit a37e10
.TP
Packit a37e10
\fBstatfs_quantum=\fP\fIsecs\fR
Packit a37e10
Setting statfs_quantum to 0 is the preferred way to set the slow version
Packit a37e10
of statfs. The default value is 30 secs which sets the maximum time
Packit a37e10
period before statfs changes will be syned to the master statfs file.
Packit a37e10
This can be adjusted to allow for faster, less accurate statfs values
Packit a37e10
or slower more accurate values. When set to 0, statfs will always
Packit a37e10
report the true values.
Packit a37e10
.TP
Packit a37e10
\fBstatfs_percent=\fP\fIvalue\fR
Packit a37e10
This setting provides a bound on the maximum percentage change in
Packit a37e10
the statfs information on a local basis before it is synced back
Packit a37e10
to the master statfs file, even if the time period has not
Packit a37e10
expired. If the setting of statfs_quantum is 0, then this setting
Packit a37e10
is ignored.
Packit a37e10
.TP
Packit a37e10
\fBrgrplvb\fP
Packit a37e10
This flag tells gfs2 to look for information about a resource group's free
Packit a37e10
space and unlinked inodes in its glock lock value block. This keeps gfs2 from
Packit a37e10
having to read in the resource group data from disk, speeding up allocations in
Packit a37e10
some cases.  This option was added in the 3.6 Linux kernel. Prior to this
Packit a37e10
kernel, no information was saved to the resource group lvb. \fBNote:\fP To
Packit a37e10
safely turn on this option, all nodes mounting the filesystem must be running
Packit a37e10
at least a 3.6 Linux kernel. If any nodes had previously mounted the filesystem
Packit a37e10
using older kernels, the filesystem must be unmounted on all nodes before it
Packit a37e10
can be mounted with this option enabled. This option does not need to be
Packit a37e10
enabled on all nodes using a filesystem.
Packit a37e10
.TP
Packit a37e10
\fBloccookie\fP
Packit a37e10
This flag tells gfs2 to use location based readdir cookies, instead of its
Packit a37e10
usual filename hash readdir cookies.  The filename hash cookies are not
Packit a37e10
guaranteed to be unique, and as the number of files in a directory increases,
Packit a37e10
so does the likelihood of a collision.  NFS requires readdir cookies to be
Packit a37e10
unique, which can cause problems with very large directories (over 100,000
Packit a37e10
files). With this flag set, gfs2 will try to give out location based cookies.
Packit a37e10
Since the cookie is 31 bits, gfs2 will eventually run out of unique cookies,
Packit a37e10
and will fail back to using hash cookies. The maximum number of files that
Packit a37e10
could have unique location cookies assuming perfectly even hashing and names of
Packit a37e10
8 or fewer characters is 1,073,741,824. An average directory should be able to
Packit a37e10
give out well over half a billion location based cookies. This option was added
Packit a37e10
in the 4.5 Linux kernel. Prior to this kernel, gfs2 did not add directory
Packit a37e10
entries in a way that allowed it to use location based readdir cookies.
Packit a37e10
\fBNote:\fP To safely turn on this option, all nodes mounting the filesystem
Packit a37e10
must be running at least a 4.5 Linux kernel. If this option is only enabled on
Packit a37e10
some of the nodes mounting a filesystem, the cookies returned by nodes using
Packit a37e10
this option will not be valid on nodes that are not using this option, and vice
Packit a37e10
versa.  Finally, when first enabling this option on a filesystem that had been
Packit a37e10
previously mounted without it, you must make sure that there are no outstanding
Packit a37e10
cookies being cached by other software, such as NFS.
Packit a37e10
Packit a37e10
.SH BUGS
Packit a37e10
Packit a37e10
GFS2 doesn't support \fBerrors=\fP\fIremount-ro\fR or \fBdata=\fP\fIjournal\fR.
Packit a37e10
It is not possible to switch support for user and group quotas on and
Packit a37e10
off independently of each other. Some of the error messages are rather
Packit a37e10
cryptic, if you encounter one of these messages check firstly that gfs_controld
Packit a37e10
is running and secondly that you have enough journals on the filesystem
Packit a37e10
for the number of nodes in use.
Packit a37e10
Packit a37e10
.SH SEE ALSO
Packit a37e10
Packit a37e10
\fBmount\fP(8) for general mount options,
Packit a37e10
\fBchmod\fP(1) and \fBchmod\fP(2) for access permission flags,
Packit a37e10
\fBacl\fP(5) for access control lists,
Packit a37e10
\fBlvm\fP(8) for volume management,
Packit a37e10
\fBccs\fP(7) for cluster management,
Packit a37e10
\fBumount\fP(8),
Packit a37e10
\fBinitrd\fP(4).
Packit a37e10
Packit a37e10
The GFS2 documentation has been split into a number of sections:
Packit a37e10
Packit a37e10
\fBgfs2_edit\fP(8) A GFS2 debug tool (use with caution)
Packit a37e10
\fBfsck.gfs2\fP(8) The GFS2 file system checker
Packit a37e10
\fBgfs2_grow\fP(8) Growing a GFS2 file system
Packit a37e10
\fBgfs2_jadd\fP(8) Adding a journal to a GFS2 file system
Packit a37e10
\fBmkfs.gfs2\fP(8) Make a GFS2 file system
Packit a37e10
\fBgfs2_quota\fP(8) Manipulate GFS2 disk quotas 
Packit a37e10
\fBgfs2_tool\fP(8) Tool to manipulate a GFS2 file system (obsolete)
Packit a37e10
\fBtunegfs2\fP(8) Tool to manipulate GFS2 superblocks
Packit a37e10
Packit a37e10
.SH SETUP
Packit a37e10
Packit a37e10
GFS2 clustering is driven by the dlm, which depends on dlm_controld to
Packit a37e10
provide clustering from userspace.  dlm_controld clustering is built on
Packit a37e10
corosync cluster/group membership and messaging.
Packit a37e10
Packit a37e10
Follow these steps to manually configure and run gfs2/dlm/corosync.
Packit a37e10
Packit a37e10
.B 1. create /etc/corosync/corosync.conf and copy to all nodes
Packit a37e10
Packit a37e10
In this sample, replace cluster_name and IP addresses, and add nodes as
Packit a37e10
needed.  If using only two nodes, uncomment the two_node line.
Packit a37e10
See corosync.conf(5) for more information.
Packit a37e10
Packit a37e10
.nf
Packit a37e10
totem {
Packit a37e10
        version: 2
Packit a37e10
        secauth: off
Packit a37e10
        cluster_name: abc
Packit a37e10
}
Packit a37e10
Packit a37e10
nodelist {
Packit a37e10
        node {
Packit a37e10
                ring0_addr: 10.10.10.1
Packit a37e10
                nodeid: 1
Packit a37e10
        }
Packit a37e10
        node {
Packit a37e10
                ring0_addr: 10.10.10.2
Packit a37e10
                nodeid: 2
Packit a37e10
        }
Packit a37e10
        node {
Packit a37e10
                ring0_addr: 10.10.10.3
Packit a37e10
                nodeid: 3
Packit a37e10
        }
Packit a37e10
}
Packit a37e10
Packit a37e10
quorum {
Packit a37e10
        provider: corosync_votequorum
Packit a37e10
#       two_node: 1
Packit a37e10
}
Packit a37e10
Packit a37e10
logging {
Packit a37e10
        to_syslog: yes
Packit a37e10
}
Packit a37e10
.fi
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 2. start corosync on all nodes
Packit a37e10
Packit a37e10
.nf
Packit a37e10
systemctl start corosync
Packit a37e10
.fi
Packit a37e10
Packit a37e10
Run corosync-quorumtool to verify that all nodes are listed.
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 3. create /etc/dlm/dlm.conf and copy to all nodes
Packit a37e10
Packit a37e10
.B *
Packit a37e10
To use no fencing, use this line:
Packit a37e10
Packit a37e10
.nf
Packit a37e10
enable_fencing=0
Packit a37e10
.fi
Packit a37e10
Packit a37e10
.B *
Packit a37e10
To use no fencing, but exercise fencing functions, use this line:
Packit a37e10
Packit a37e10
.nf
Packit a37e10
fence_all /bin/true
Packit a37e10
.fi
Packit a37e10
Packit a37e10
The "true" binary will be executed for all nodes and will succeed (exit 0)
Packit a37e10
immediately.
Packit a37e10
Packit a37e10
.B *
Packit a37e10
To use manual fencing, use this line:
Packit a37e10
Packit a37e10
.nf
Packit a37e10
fence_all /bin/false
Packit a37e10
.fi
Packit a37e10
Packit a37e10
The "false" binary will be executed for all nodes and will fail (exit 1)
Packit a37e10
immediately.
Packit a37e10
Packit a37e10
When a node fails, manually run: dlm_tool fence_ack <nodeid>
Packit a37e10
Packit a37e10
.B *
Packit a37e10
To use stonith/pacemaker for fencing, use this line:
Packit a37e10
Packit a37e10
.nf
Packit a37e10
fence_all /usr/sbin/dlm_stonith
Packit a37e10
.fi
Packit a37e10
Packit a37e10
The "dlm_stonith" binary will be executed for all nodes.  If
Packit a37e10
stonith/pacemaker systems are not available, dlm_stonith will fail and
Packit a37e10
this config becomes the equivalent of the previous /bin/false config.
Packit a37e10
Packit a37e10
.B *
Packit a37e10
To use an APC power switch, use these lines:
Packit a37e10
Packit a37e10
.nf
Packit a37e10
device  apc /usr/sbin/fence_apc ipaddr=1.1.1.1 login=admin password=pw
Packit a37e10
connect apc node=1 port=1
Packit a37e10
connect apc node=2 port=2
Packit a37e10
connect apc node=3 port=3
Packit a37e10
.fi
Packit a37e10
Packit a37e10
Other network switch based agents are configured similarly.
Packit a37e10
Packit a37e10
.B *
Packit a37e10
To use sanlock/watchdog fencing, use these lines:
Packit a37e10
Packit a37e10
.nf
Packit a37e10
device wd /usr/sbin/fence_sanlock path=/dev/fence/leases
Packit a37e10
connect wd node=1 host_id=1
Packit a37e10
connect wd node=2 host_id=2
Packit a37e10
unfence wd
Packit a37e10
.fi
Packit a37e10
Packit a37e10
See fence_sanlock(8) for more information.
Packit a37e10
Packit a37e10
.B *
Packit a37e10
For other fencing configurations see dlm.conf(5) man page.
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 4. start dlm_controld on all nodes
Packit a37e10
Packit a37e10
.nf
Packit a37e10
systemctl start dlm
Packit a37e10
.fi
Packit a37e10
Packit a37e10
Run "dlm_tool status" to verify that all nodes are listed.
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 5. if using clvm, start clvmd on all nodes
Packit a37e10
Packit a37e10
systemctl clvmd start
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 6. make new gfs2 file systems
Packit a37e10
Packit a37e10
mkfs.gfs2 -p lock_dlm -t cluster_name:fs_name -j num /path/to/storage
Packit a37e10
Packit a37e10
The cluster_name must match the name used in step 1 above.
Packit a37e10
The fs_name must be a unique name in the cluster.
Packit a37e10
The -j option is the number of journals to create, there must
Packit a37e10
be one for each node that will mount the fs.
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 7. mount gfs2 file systems
Packit a37e10
Packit a37e10
mount /path/to/storage /mountpoint
Packit a37e10
Packit a37e10
Run "dlm_tool ls" to verify the nodes that have each fs mounted.
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B 8. shut down
Packit a37e10
Packit a37e10
.nf
Packit a37e10
umount -a -t gfs2
Packit a37e10
systemctl clvmd stop
Packit a37e10
systemctl dlm stop
Packit a37e10
systemctl corosync stop
Packit a37e10
.fi
Packit a37e10
Packit a37e10
.PP
Packit a37e10
Packit a37e10
.B More setup information:
Packit a37e10
.br
Packit a37e10
.BR dlm_controld (8),
Packit a37e10
.br
Packit a37e10
.BR dlm_tool (8),
Packit a37e10
.br
Packit a37e10
.BR dlm.conf (5),
Packit a37e10
.br
Packit a37e10
.BR corosync (8),
Packit a37e10
.br
Packit a37e10
.BR corosync.conf (5)
Packit a37e10
.br