blob: e84d154954b0893b0e770bf07672d41bf5d7a419 [file] [log] [blame]
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
]>
<chapter id="xfs-mount">
<title>mount</title>
<section>
<title>Mounting XFS Filesystems</title>
<para>This section describes some XFS-specific mount options and how they affect the behaviour of XFS</para>
</section>
<section>
<title>Mount Options</title>
<para>Described in</para>
<itemizedlist>
<listitem><para>In linux tree:
<itemizedlist>
<listitem><para>Documentation/filesystems/xfs.txt</para></listitem>
<listitem><para>xfs/fs/xfs_vfsops.c</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para><command>mount(8)</command></para></listitem>
</itemizedlist>
<para>What options are specific to XFS?</para>
<para>What common Linux mount options does XFS not support?</para>
</section>
<section>
<title>Mount Options - Log &amp; Realtime Devices</title>
<para>Use an external log (metadata journal) device:</para>
<para><command>mount -o logdev=<replaceable>log_device</replaceable> <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
<para>Use an external log (metadata journal) and real-time device:</para>
<para><command>mount -o logdev=<replaceable>log_device</replaceable>,rtdev=<replaceable>rt_device</replaceable> <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
</section>
<section>
<title>Mount Options - 32 or 64 bit Inodes</title>
<para>The inode's number is derived from its location on disk
<itemizedlist>
<listitem><para>Combination of allocation group, cluster and block</para></listitem>
</itemizedlist>
</para>
<para>32 bit inodes (default):</para>
<itemizedlist>
<listitem><para>Allocator can only place 32bit inodes in the first terabyte
<itemizedlist>
<listitem><para>Using a larger inode size means less inodes per cluster allowing 32bit
inodes to be located beyond the first terabyte</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para>Allocator will rotate data extents across allocations groups to leave room for inodes</para></listitem>
</itemizedlist>
<para>64 bit inodes:</para>
<itemizedlist>
<listitem><para>Only available on 64bit machines</para></listitem>
<listitem><para>Use inode64 mount option to enable</para></listitem>
<listitem><para>Allows inodes to span the entire filesystem</para></listitem>
<listitem><para>Allocator will try to put file extents in same allocation group as inode</para></listitem>
<listitem><para>Not all backup tools support 64bit inodes
<itemizedlist>
<listitem><para>Inode number used to uniquely identify files in backups</para></listitem>
</itemizedlist>
</para></listitem>
</itemizedlist>
</section>
<section>
<title>Mount Options - Stripes</title>
<para>Specify the stripe unit and width for a RAID device or a stripe volume.</para>
<para>Values must be specified in 512-byte block units.</para>
<para>For example, to use a stripe unit of 1MB and a stripe width of 8MB:</para>
<para><command>mount -o sunit=2048,swidth=16384 <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
<para><command>swalloc</command> mount option</para>
<itemizedlist>
<listitem><para>data allocations will be rounded up to stripe width boundaries when the
current end of file is being extended and the file size is larger than the
stripe width size.</para></listitem>
</itemizedlist>
</section>
<section>
<title>Mount Options - Large I/O</title>
<para>These mount options affect the preferred filesystem I/O size reported by <command>stat(2)</command></para>
<para><command>largeio</command></para>
<itemizedlist>
<listitem><para>A filesystem that has a <command>swidth</command> specified will return the
<command>swidth</command> value (in bytes) in st_blksize</para></listitem>
<listitem><para>If the filesystem does not have a <command>swidth</command> specified but does
specify an <command>allocsize</command> then <command>allocsize</command>
(in bytes) will be returned instead.</para></listitem>
</itemizedlist>
<para><command>nolargeio</command> (default)</para>
<itemizedlist>
<listitem><para>The optimal I/O reported in st_blksize will be as small as possible to
allow user applications to avoid inefficient read/modify/write I/O.</para></listitem>
</itemizedlist>
<para>If neither of these two options are specified, then the filesystem will behave as if
<command>nolargeio</command> was specified.</para>
</section>
<section>
<title>Mount Options - Performance Tweaks</title>
<para><command>osyncisdsync</command> (default/deprecated)</para>
<itemizedlist>
<listitem><para>Writes to files opened with the O_SYNC flag set will behave as if the O_DSYNC
flag had been used instead.</para></listitem>
<listitem><para>This can result in better performance without compromising data safety.</para></listitem>
<listitem><para>However timestamp updates from O_SYNC writes can be lost if the system crashes.
Use <command>osyncisosync</command> to disable this setting.</para></listitem>
</itemizedlist>
<para><command>ikeep</command></para>
<itemizedlist>
<listitem><para>When inode clusters are emptied of inodes, keep them around on the disk.</para></listitem>
<listitem><para>Use the <command>noikeep</command> option to force empty inode clusters to be returned to
the free space pool.</para></listitem>
</itemizedlist>
</section>
<section>
<title>Mount Options - Extended Attributes</title>
<para><command>attr2 (default)</command></para>
<itemizedlist>
<listitem><para>Enable the use of version two of the extended attribute inline allocation policy.</para></listitem>
</itemizedlist>
<para><command>noattr2</command></para>
<itemizedlist>
<listitem><para>Force the use of version one of the extended attribute inline allocation policy.</para></listitem>
</itemizedlist>
<para>When the new form is used for the first time (by setting or removing extended attributes)
the on-disk superblock feature bit field will be updated to reflect this format being in use.</para>
<para><command>mount -o attr2 <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
</section>
<section>
<title>Mount Options - Group Ids</title>
<para>These options define what group ID a newly created file gets.</para>
<para><command>grpid/bsdgroups</command></para>
<itemizedlist>
<listitem><para>Take the group ID of the directory in which it is created</para></listitem>
</itemizedlist>
<para><command>nogrpid/sysvgroups</command></para>
<itemizedlist>
<listitem><para>Take the fsgid of the current process, unless the directory has the setgid bit
set, in which case it takes the gid from the parent directory, and also gets the
setgid bit set if it is a directory itself.</para></listitem>
</itemizedlist>
</section>
<section>
<title>Mount Options - Recovery</title>
<para>An XFS filesystem can be mounted without running log recovery.</para>
<para>If the filesystem was not cleanly unmounted, it is likely to be inconsistent when mounted
in <command>norecovery</command> mode. Some files or directories may not be accessible because of this.</para>
<para>Filesystems mounted <command>norecovery</command> must be mounted read-only or the mount will fail.</para>
<para><command>mount -o ro,norecovery <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
</section>
<section>
<title>Mount Options - Barriers</title>
<para>Write caches on disks can result in filesystem corruption since XFS may be told a
log transaction has reached the disk when in fact it is still in the disk cache.</para>
<itemizedlist>
<listitem><para>A journal log assumes that the log transaction is updated on disk before
updating the metadata in the filesystem, but this may not be true with
write caching</para></listitem>
</itemizedlist>
<para>XFS is able to issue write barriers if the underlying devices support it</para>
<itemizedlist>
<listitem><para>Ensures that the log entry is written before any other data</para></listitem>
</itemizedlist>
<para>Write barriers are enabled by default in XFS</para>
<itemizedlist>
<listitem><para>Filesystem will attempt to determine if barriers are supported and will
issue a warning to the syslog if they are not</para></listitem>
<listitem><para>The <command>nobarrier</command> option disables write barriers</para></listitem>
<listitem><para>Barriers should be disabled when using a RAID with battery backed controller
cache (but only if the individual disk write caches are disabled)</para></listitem>
</itemizedlist>
<para>See</para>
<itemizedlist>
<listitem><para><ulink
url="http://xfs.org/index.php/XFS_FAQ#Q:_What_is_the_problem_with_the_write_cache_on_journaled_filesystems.3F">http://xfs.org/index.php/XFS_FAQ#Q:_What_is_the_problem_with_the_write_cache_on_journaled_filesystems.3F</ulink></para></listitem>
</itemizedlist>
</section>
<section>
<title>Mount Options - User/Group/Project Quotas</title>
<para>User disk quota accounting enabled, and limits (optionally) enforced.</para>
<para><command>mount -o uquota <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
<para>Group disk quota accounting enabled, and limits (optionally) enforced.</para>
<para><command>mount -o grpquota <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
<para>Project quota accounting enabled, and limits (optionally) enforced.</para>
<para><command>mount -o prjquota <replaceable>device</replaceable> <replaceable>mountpoint</replaceable></command></para>
<para>Can optionally specify <command>uqnoenforce</command>,
<command>gqnoenforce</command> and <command>pqnoenforce</command>
to use soft limits.</para>
</section>
</chapter>