blob: f179287e51d36177ffd00ec9bb08212d2ddedc75 [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=log_device device mountpoint</command></para>
<para>Use an external log (metadata journal) and real-time device:</para>
<para><command>mount -o logdev=log_device,rtdev=rt_device device mountpoint</command></para>
</section>
<section>
<title>Mount Options - 64bit Inodes</title>
<para>By default XFS uses 32bit inodes</para>
<itemizedlist>
<listitem><para>The inode’s number roughly equates to its location on disk
<itemizedlist>
<listitem><para>Combination of allocation group, cluster and block</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para>Inode on Linux is 32bit on 32bit machines
<itemizedlist>
<listitem><para>May change in future kernels</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para>Allocator will 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>
</itemizedlist>
<para>inode64 option on 64bit machines allows inodes to span the entire filesystem</para>
<itemizedlist>
<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 identify file between 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 device mountpoint</command></para>
<para><command>swalloc</command> 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><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>
<listitem><para>If neither of these two options are specified, then filesystem will behave as
if <command>nolargeio</command> was specified.</para></listitem>
</itemizedlist>
<para><command>largeio</command></para>
<itemizedlist>
<listitem><para>The optimal I/O reported in <command>st_blksize</command> by <command>stat(2)</command>
will be as small as possible to allow user applications to avoid inefficient
read/modify/write I/O.</para></listitem>
</itemizedlist>
</section>
<section>
<title>Mount Options - Performance Tweaks</title>
<para><command>osyncisdsync (default/deprecated)</command></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 osyncisosync 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>
</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 device mountpoint</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 device mountpoint</command></para>
</section>
<section>
<title>Mount Options - Barriers</title>
<para>Write cache on disk can result in filesystem corruption since XFS is told the
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
the metadata is updated, but this may not be true with write caching</para></listitem>
</itemizedlist>
<para>XFS is able to issue write barriers if the device supports 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 is 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>
</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 device mountpoint</command></para>
<para>Group disk quota accounting enabled, and limits (optionally) enforced.</para>
<para><command>mount -o grpquota device mountpoint</command></para>
<para>Project quota accounting enabled, and limits (optionally) enforced.</para>
<para><command>mount -o prjquota device mountpoint</command></para>
<para>Can optionally specify <command>uqnoenforce, gqnoenforce</command> and
<command>pqnoenforce</command> to use soft limits.</para>
</section>
<section>
<title>Mount Options - DMAPI</title>
<para><command>dmapi</command></para>
<itemizedlist>
<listitem><para>Enable the DMAPI (Data Management API) event callouts.</para></listitem>
</itemizedlist>
<para><command>mtpt</command></para>
<itemizedlist>
<listitem><para>Specify a value to be included in the DMAPI mount event, and should be
the path of the actual mountpoint that is used.</para></listitem>
</itemizedlist>
<para><command>mount -o dmapi,mtpt=mountpoint device mountpoint</command></para>
</section>
</chapter>