<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://xfs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cattelan</id>
	<title>xfs.org - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://xfs.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cattelan"/>
	<link rel="alternate" type="text/html" href="https://xfs.org/index.php/Special:Contributions/Cattelan"/>
	<updated>2026-04-20T10:10:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_Papers_and_Documentation&amp;diff=3053</id>
		<title>XFS Papers and Documentation</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_Papers_and_Documentation&amp;diff=3053"/>
		<updated>2024-11-29T19:28:18Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Primary XFS Documentation ===&lt;br /&gt;
&lt;br /&gt;
The XFS documentation started by SGI has been converted to docbook/[https://fedorahosted.org/publican/ Publican] format.  The material is suitable for experienced users as well as developers and support staff.  The XML source is available in a [http://git.kernel.org/?p=fs/xfs/xfsdocs-xml-dev.git;a=summary git repository] and builds of the documentation are available here:&lt;br /&gt;
&lt;br /&gt;
* [http://xfs.org/docs/xfsdocs-xml-dev/XFS_User_Guide//tmp/en-US/html/index.html XFS User Guide]&lt;br /&gt;
&lt;br /&gt;
* [http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure//tmp/en-US/html/index.html XFS File System Structure]&lt;br /&gt;
** [http://sites.google.com/site/kandamotohiro/xfs Japanese translation] is also available.&lt;br /&gt;
&lt;br /&gt;
* [http://xfs.org/docs/xfsdocs-xml-dev/XFS_Labs/tmp/en-US/html/index.html XFS Training Labs]&lt;br /&gt;
&lt;br /&gt;
* (Original versions of this material are still available at [http://oss.sgi.com/projects/xfs/training/index.html XFS Overview and Internals (html)] and [http://xfs.org/docs/papers/xfs_filesystem_structure.pdf XFS Filesystem Structure (pdf)]&lt;br /&gt;
&lt;br /&gt;
The format of &amp;lt;tt&amp;gt;/proc/fs/xfs/stat&amp;lt;/tt&amp;gt; also has been documented:&lt;br /&gt;
* [[Runtime_Stats|Runtime_Stats]]&lt;br /&gt;
&lt;br /&gt;
=== Papers, Presentations, Etc ===&lt;br /&gt;
&lt;br /&gt;
At the linux.conf.au 2012 event, Dave Chinner presented a talk on filesystem metadata scalability:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS - Recent and Future Adventures in Filesystem Scalability&#039;&#039; [[http://www.youtube.com/watch?v=FegjLbCnoBw Video]] [ [[:File:Xfs-scalability-lca2012.pdf|Presentation Slides]] ]&lt;br /&gt;
&lt;br /&gt;
The October 2009 issue of the USENIX ;login: magazine published an article about XFS targeted at system administrators:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS: The big storage file system for Linux&#039;&#039; [[http://xfs.org/docs/papers/hellwig.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the Ottawa Linux Symposium (July 2006), Dave Chinner presented a paper on filesystem scalability in Linux 2.6 kernels:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;High Bandwidth Filesystems on Large Systems&#039;&#039; (July 2006) [[http://xfs.org/docs/papers/ols2006/ols-2006-paper.pdf paper]] [[http://xfs.org/docs/papers/ols2006/ols-2006-presentation.pdf presentation]]&lt;br /&gt;
&lt;br /&gt;
At linux.conf.au 2008 Dave Chinner gave a presentation about xfs_repair that he co-authored with Barry Naujok:&lt;br /&gt;
&lt;br /&gt;
* Fixing XFS Filesystems Faster [[http://mirror.linux.org.au/pub/linux.conf.au/2008/slides/135-fixing_xfs_faster.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
In July 2006, SGI storage marketing updated the XFS datasheet:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Open Source XFS for Linux&#039;&#039; [[http://oss.sgi.com/projects/xfs/datasheet.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At UKUUG 2003, Christoph Hellwig presented a talk on XFS:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS for Linux&#039;&#039; (July 2003) [[http://xfs.org/docs/papers/ukuug2003.pdf pdf]] [[http://verein.lst.de/~hch/talks/ukuug2003/ html]]&lt;br /&gt;
&lt;br /&gt;
Originally published in Proceedings of the FREENIX Track: 2002 Usenix Annual Technical Conference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Filesystem Performance and Scalability in Linux 2.4.17&#039;&#039; (June 2002) [[http://xfs.org/docs/papers/filesystem-perf-tm.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the Ottawa Linux Symposium, an updated presentation on porting XFS to Linux was given:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Porting XFS to Linux&#039;&#039; (July 2000) [[http://xfs.org/docs/papers/ols2000/ols-xfs.htm html]]&lt;br /&gt;
&lt;br /&gt;
At the Atlanta Linux Showcase, SGI presented the following paper on the port of XFS to Linux:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Porting the SGI XFS File System to Linux&#039;&#039; (October 1999) [[http://xfs.org/docs/papers/als/als.ps ps]] [[http://xfs.org/docs/papers/als/als.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the 6th Linux Kongress &amp;amp;amp; the Linux Storage Management Workshop (LSMW) in Germany in September, 1999, SGI had a few presentations including the following:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SGI&#039;s port of XFS to Linux&#039;&#039; (September 1999) [[http://xfs.org/docs/papers/linux_kongress/index.htm html]]&lt;br /&gt;
* &#039;&#039;Overview of DMF&#039;&#039; (September 1999) [[http://xfs.org/docs/papers/DMF-over/index.htm html]]&lt;br /&gt;
&lt;br /&gt;
At the LinuxWorld Conference &amp;amp;amp; Expo in August 1999, SGI published:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;An Open Source XFS data sheet&#039;&#039; (August 1999) [[http://xfs.org/docs/papers/xfs_GPL.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
From the 1996 USENIX conference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;An XFS white paper&#039;&#039; [[http://xfs.org/docs/papers/xfs_usenix/index.html html]]&lt;br /&gt;
&lt;br /&gt;
=== Other historical articles, press-releases, etc ===&lt;br /&gt;
&lt;br /&gt;
* IBM&#039;s &#039;&#039;Advanced Filesystem Implementor&#039;s Guide&#039;&#039; has a chapter &#039;&#039;Introducing XFS&#039;&#039; [[http://www-106.ibm.com/developerworks/library/l-fs9.html html]]&lt;br /&gt;
&lt;br /&gt;
* An editorial titled &#039;&#039;Tired of fscking? Try a journaling filesystem!&#039;&#039;, Freshmeat (February 2001) [[http://freshmeat.net/articles/view/212/ html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Who give a fsck about filesystems&#039;&#039; provides an overview of the Linux 2.4 filesystems [[http://www.linuxuser.co.uk/articles/issue6/lu6-All_you_need_to_know_about-Filesystems.pdf html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Journal File Systems&#039;&#039; in issue 55 of &#039;&#039;Linux Gazette&#039;&#039; provides a comparison of journaled filesystems.&lt;br /&gt;
&lt;br /&gt;
* The original XFS beta release announcement was published in &#039;&#039;Linux Today&#039;&#039; (September 2000) [[http://linuxtoday.com/news_story.php3?ltsn=2000-09-26-017-04-OS-SW html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS: It&#039;s worth the wait&#039;&#039; was published on &#039;&#039;EarthWeb&#039;&#039; (July 2000) [[http://networking.earthweb.com/netos/oslin/article/0,,12284_623661,00.html html]]&lt;br /&gt;
&lt;br /&gt;
* An &#039;&#039;IRIX-XFS data sheet&#039;&#039; (July 1999) [[http://xfs.org/docs/papers/IRIX_xfs_data_sheet.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;Getting Started with XFS&#039;&#039; book (1994) [[http://xfs.org/docs/papers/getting_started_with_xfs.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
* Original &#039;&#039;XFS design documents&#039;&#039; (1993) ([http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_ps/ ps], [http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_pdf/ pdf])&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_Papers_and_Documentation&amp;diff=3052</id>
		<title>XFS Papers and Documentation</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_Papers_and_Documentation&amp;diff=3052"/>
		<updated>2024-11-29T19:08:57Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Primary XFS Documentation ===&lt;br /&gt;
&lt;br /&gt;
The XFS documentation started by SGI has been converted to docbook/[https://fedorahosted.org/publican/ Publican] format.  The material is suitable for experienced users as well as developers and support staff.  The XML source is available in a [http://git.kernel.org/?p=fs/xfs/xfsdocs-xml-dev.git;a=summary git repository] and builds of the documentation are available here:&lt;br /&gt;
&lt;br /&gt;
* [http://xfs.org/docs/xfsdocs-xml-dev/XFS_User_Guide//tmp/en-US/html/index.html XFS User Guide]&lt;br /&gt;
&lt;br /&gt;
* [http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure//tmp/en-US/html/index.html XFS File System Structure]&lt;br /&gt;
** [http://sites.google.com/site/kandamotohiro/xfs Japanese translation] is also available.&lt;br /&gt;
&lt;br /&gt;
* [http://xfs.org/docs/xfsdocs-xml-dev/XFS_Labs/tmp/en-US/html/index.html XFS Training Labs]&lt;br /&gt;
&lt;br /&gt;
* (Original versions of this material are still available at [http://oss.sgi.com/projects/xfs/training/index.html XFS Overview and Internals (html)] and [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS Filesystem Structure (pdf)]&lt;br /&gt;
&lt;br /&gt;
The format of &amp;lt;tt&amp;gt;/proc/fs/xfs/stat&amp;lt;/tt&amp;gt; also has been documented:&lt;br /&gt;
* [[Runtime_Stats|Runtime_Stats]]&lt;br /&gt;
&lt;br /&gt;
=== Papers, Presentations, Etc ===&lt;br /&gt;
&lt;br /&gt;
At the linux.conf.au 2012 event, Dave Chinner presented a talk on filesystem metadata scalability:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS - Recent and Future Adventures in Filesystem Scalability&#039;&#039; [[http://www.youtube.com/watch?v=FegjLbCnoBw Video]] [ [[:File:Xfs-scalability-lca2012.pdf|Presentation Slides]] ]&lt;br /&gt;
&lt;br /&gt;
The October 2009 issue of the USENIX ;login: magazine published an article about XFS targeted at system administrators:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS: The big storage file system for Linux&#039;&#039; [[http://oss.sgi.com/projects/xfs/papers/hellwig.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the Ottawa Linux Symposium (July 2006), Dave Chinner presented a paper on filesystem scalability in Linux 2.6 kernels:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;High Bandwidth Filesystems on Large Systems&#039;&#039; (July 2006) [[http://xfs.org/docs/papers/ols2006/ols-2006-paper.pdf paper]] [[http://xfs.org/docs/papers/ols2006/ols-2006-presentation.pdf presentation]]&lt;br /&gt;
&lt;br /&gt;
At linux.conf.au 2008 Dave Chinner gave a presentation about xfs_repair that he co-authored with Barry Naujok:&lt;br /&gt;
&lt;br /&gt;
* Fixing XFS Filesystems Faster [[http://mirror.linux.org.au/pub/linux.conf.au/2008/slides/135-fixing_xfs_faster.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
In July 2006, SGI storage marketing updated the XFS datasheet:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Open Source XFS for Linux&#039;&#039; [[http://oss.sgi.com/projects/xfs/datasheet.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At UKUUG 2003, Christoph Hellwig presented a talk on XFS:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS for Linux&#039;&#039; (July 2003) [[http://oss.sgi.com/projects/xfs/papers/ukuug2003.pdf pdf]] [[http://verein.lst.de/~hch/talks/ukuug2003/ html]]&lt;br /&gt;
&lt;br /&gt;
Originally published in Proceedings of the FREENIX Track: 2002 Usenix Annual Technical Conference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Filesystem Performance and Scalability in Linux 2.4.17&#039;&#039; (June 2002) [[http://oss.sgi.com/projects/xfs/papers/filesystem-perf-tm.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the Ottawa Linux Symposium, an updated presentation on porting XFS to Linux was given:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Porting XFS to Linux&#039;&#039; (July 2000) [[http://oss.sgi.com/projects/xfs/papers/ols2000/ols-xfs.htm html]]&lt;br /&gt;
&lt;br /&gt;
At the Atlanta Linux Showcase, SGI presented the following paper on the port of XFS to Linux:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Porting the SGI XFS File System to Linux&#039;&#039; (October 1999) [[http://oss.sgi.com/projects/xfs/papers/als/als.ps ps]] [[http://oss.sgi.com/projects/xfs/papers/als/als.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the 6th Linux Kongress &amp;amp;amp; the Linux Storage Management Workshop (LSMW) in Germany in September, 1999, SGI had a few presentations including the following:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SGI&#039;s port of XFS to Linux&#039;&#039; (September 1999) [[http://oss.sgi.com/projects/xfs/papers/linux_kongress/index.htm html]]&lt;br /&gt;
* &#039;&#039;Overview of DMF&#039;&#039; (September 1999) [[http://oss.sgi.com/projects/xfs/papers/DMF-over/index.htm html]]&lt;br /&gt;
&lt;br /&gt;
At the LinuxWorld Conference &amp;amp;amp; Expo in August 1999, SGI published:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;An Open Source XFS data sheet&#039;&#039; (August 1999) [[http://oss.sgi.com/projects/xfs/papers/xfs_GPL.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
From the 1996 USENIX conference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;An XFS white paper&#039;&#039; [[http://oss.sgi.com/projects/xfs/papers/xfs_usenix/index.html html]]&lt;br /&gt;
&lt;br /&gt;
=== Other historical articles, press-releases, etc ===&lt;br /&gt;
&lt;br /&gt;
* IBM&#039;s &#039;&#039;Advanced Filesystem Implementor&#039;s Guide&#039;&#039; has a chapter &#039;&#039;Introducing XFS&#039;&#039; [[http://www-106.ibm.com/developerworks/library/l-fs9.html html]]&lt;br /&gt;
&lt;br /&gt;
* An editorial titled &#039;&#039;Tired of fscking? Try a journaling filesystem!&#039;&#039;, Freshmeat (February 2001) [[http://freshmeat.net/articles/view/212/ html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Who give a fsck about filesystems&#039;&#039; provides an overview of the Linux 2.4 filesystems [[http://www.linuxuser.co.uk/articles/issue6/lu6-All_you_need_to_know_about-Filesystems.pdf html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Journal File Systems&#039;&#039; in issue 55 of &#039;&#039;Linux Gazette&#039;&#039; provides a comparison of journaled filesystems.&lt;br /&gt;
&lt;br /&gt;
* The original XFS beta release announcement was published in &#039;&#039;Linux Today&#039;&#039; (September 2000) [[http://linuxtoday.com/news_story.php3?ltsn=2000-09-26-017-04-OS-SW html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS: It&#039;s worth the wait&#039;&#039; was published on &#039;&#039;EarthWeb&#039;&#039; (July 2000) [[http://networking.earthweb.com/netos/oslin/article/0,,12284_623661,00.html html]]&lt;br /&gt;
&lt;br /&gt;
* An &#039;&#039;IRIX-XFS data sheet&#039;&#039; (July 1999) [[http://oss.sgi.com/projects/xfs/papers/IRIX_xfs_data_sheet.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;Getting Started with XFS&#039;&#039; book (1994) [[http://oss.sgi.com/projects/xfs/papers/getting_started_with_xfs.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
* Original &#039;&#039;XFS design documents&#039;&#039; (1993) ([http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_ps/ ps], [http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_pdf/ pdf])&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=User_talk:Cattelan&amp;diff=3045</id>
		<title>User talk:Cattelan</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=User_talk:Cattelan&amp;diff=3045"/>
		<updated>2021-05-17T04:08:13Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Cattelan moved page User talk:Anshul.kundra to User talk:Cattelan: Automatically moved page while merging the account &amp;quot;Anshul.kundra&amp;quot; to &amp;quot;Cattelan&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== XFS_IOCORE_R ==&lt;br /&gt;
&lt;br /&gt;
To Developers , &lt;br /&gt;
I have read about the new member named as xfs_extdelta that is passed in different xfs internal routines i.e xfs_bmapi , In the 2.4 versions instead of using it is just passed as NULL can anyone provide info regarding that where to initialize and if I pass it NULl then is there any adverse effect of it &lt;br /&gt;
&lt;br /&gt;
XFS_IOCORE_RT  not been used in 2.6 version , so if instead of this flag I will pass XFS_IOCORE_EXCL it will be ok or will cause any crash or adverse effects or either there is any alternative present to sought out from these two problems &lt;br /&gt;
&lt;br /&gt;
Regards &lt;br /&gt;
Anshul Kundra &lt;br /&gt;
HCL TECHNOLOGIES &lt;br /&gt;
ERS&lt;br /&gt;
: Has been answered on the [http://www.spinics.net/lists/xfs/msg09007.html mailinglist] -- [[User:Ckujau|Ckujau]] 23:39, 16 February 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
== XFS File Inode number is changing using the utilities  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To Developers,&lt;br /&gt;
&lt;br /&gt;
I have seen a different behaviour in XFS  &lt;br /&gt;
&lt;br /&gt;
Suppose I have a file with inode number &amp;quot;131&amp;quot;, I have noticed that the inode number of file got changed without deleting the file. When we change the data of the file everytime it changes the inode number. The complete description over the test is as follows &lt;br /&gt;
&lt;br /&gt;
Steps are as follows:&lt;br /&gt;
&lt;br /&gt;
1) I have created a file using &amp;quot;dd&amp;quot; of size 100MB:&lt;br /&gt;
&lt;br /&gt;
#dd if=/dev/zero of=xfs.img bs=1M count=100&lt;br /&gt;
&lt;br /&gt;
2) Created a loopback device over the image:&lt;br /&gt;
#losetup /dev/loop1 xfs.img&lt;br /&gt;
&lt;br /&gt;
3) Created file system:&lt;br /&gt;
#mkfs.xfs /dev/loop1 &lt;br /&gt;
&lt;br /&gt;
4) Mounted:&lt;br /&gt;
#mount /dev/loop1 /mnt/xfs_mnt &lt;br /&gt;
&lt;br /&gt;
5) Please check the mount output:&lt;br /&gt;
# mount&lt;br /&gt;
&lt;br /&gt;
/dev/sdb2 on / type ext3 (rw,acl,user_xattr)&lt;br /&gt;
proc on /proc type proc (rw)&lt;br /&gt;
sysfs on /sys type sysfs (rw)&lt;br /&gt;
debugfs on /sys/kernel/debug type debugfs (rw)&lt;br /&gt;
devtmpfs on /dev type devtmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,mode=1777)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)&lt;br /&gt;
fusectl on /sys/fs/fuse/connections type fusectl (rw)&lt;br /&gt;
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
/dev/loop0 on /mnt/mount_test type xfs (rw)&lt;br /&gt;
/dev/loop1 on /mnt/xfs_mnt type xfs (rw)&lt;br /&gt;
&lt;br /&gt;
6) Created a file using &amp;quot;touch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# touch kundra.txt&lt;br /&gt;
&lt;br /&gt;
7) Checking the file and its inode number:&lt;br /&gt;
&lt;br /&gt;
# ls -li &lt;br /&gt;
total 0&lt;br /&gt;
131 -rw-r--r-- 1 root root 0 2012-10-20 01:41 kundra.txt&lt;br /&gt;
&lt;br /&gt;
8) I have written some data using the vim editor, I can&#039;t provide snapshot of vim on the list:&lt;br /&gt;
&lt;br /&gt;
#vim kundra.txt&lt;br /&gt;
&lt;br /&gt;
9) Now I checked the inode number using the &amp;quot;ls -li&amp;quot;&lt;br /&gt;
# ls -li&lt;br /&gt;
&lt;br /&gt;
total 4&lt;br /&gt;
133 -rw-r--r-- 1 root root 19 2012-10-20 01:43 kundra.txt&lt;br /&gt;
&lt;br /&gt;
Please check that the inode number ( from &amp;quot;131&amp;quot; to &amp;quot;133&amp;quot; )  and total value (from &amp;quot;0&amp;quot; to &amp;quot;4&amp;quot; )in the filesystem got changed, I am assuming that the reasom may be due to filesystem of small size but it is showing unexpected behaviour. &lt;br /&gt;
&lt;br /&gt;
Please provide some description over this issue, I am working on Linux SLES &lt;br /&gt;
&lt;br /&gt;
# cat /etc/issue&lt;br /&gt;
&lt;br /&gt;
Welcome to SUSE Linux Enterprise Server 11 SP1  (x86_64) - Kernel \r (\l).&lt;br /&gt;
&lt;br /&gt;
# uname -a &lt;br /&gt;
Linux linux-sles 2.6.32.19-0.6-default #1 SMP Fri Aug 31 01:37:50 IST 2012 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
Thanks &amp;amp; Best Regards  &lt;br /&gt;
Anshul Kundra&lt;br /&gt;
: Anshul, as I have suggested [[User:Anshul.kundra|earlier]]: please ask questions on the [[XFS_email_list_and_archives|mailing lists]]. Also, your question [https://encrypted.google.com/search?hl=en&amp;amp;q=vi%20inode%20change has been answered many times] already. -- [[User:Ckujau|Ckujau]] ([[User talk:Ckujau|talk]]) 19:07, 19 October 2012 (UTC)&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2993</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2993"/>
		<updated>2016-08-10T21:25:47Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* SSD disks or rotational disks but with hardware raid card that has cache enabled */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
What you need to report depend on the problem you are seeing. Firstly, your machine hardware and storage configuration needs to be described. That includes:&lt;br /&gt;
&lt;br /&gt;
* kernel version (uname -a)&lt;br /&gt;
* xfsprogs version (xfs_repair -V)&lt;br /&gt;
* number of CPUs&lt;br /&gt;
* contents of /proc/meminfo&lt;br /&gt;
* contents of /proc/mounts&lt;br /&gt;
* contents of /proc/partitions&lt;br /&gt;
* RAID layout (hardware and/or software)&lt;br /&gt;
* LVM configuration&lt;br /&gt;
* type of disks you are using&lt;br /&gt;
* write cache status of drives&lt;br /&gt;
* size of BBWC and mode it is running in&lt;br /&gt;
* xfs_info output on the filesystem in question&lt;br /&gt;
* dmesg output showing all error messages and stack traces&lt;br /&gt;
 &lt;br /&gt;
Then you need to describe your workload that is causing the problem, and a demonstration of the bad behaviour that is occurring. If it is a performance problem, then 30s - 1 minute samples of:&lt;br /&gt;
&lt;br /&gt;
# iostat -x -d -m 5&lt;br /&gt;
# vmstat 5&lt;br /&gt;
 &lt;br /&gt;
can give us insight into the IO and memory utilisation of your machine at the time of the problem.&lt;br /&gt;
&lt;br /&gt;
If the filesystem is hanging, then capture the output of the dmesg command after running:&lt;br /&gt;
&lt;br /&gt;
 # echo w &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
 # dmesg&lt;br /&gt;
&lt;br /&gt;
will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.&lt;br /&gt;
&lt;br /&gt;
And for advanced users, capturing an event trace using &#039;&#039;&#039;trace-cmd&#039;&#039;&#039; (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it&#039;s a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd record -e xfs\*&lt;br /&gt;
&lt;br /&gt;
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd report &amp;gt; trace_report.txt&lt;br /&gt;
&lt;br /&gt;
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039;, make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS.&lt;br /&gt;
&lt;br /&gt;
However, if an inode is unlinked but neither it nor its associated data blocks get immediately re-used and overwritten, there is some small chance to recover the file from the disk.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;photorec&#039;&#039;, &#039;&#039;xfs_irecover&#039;&#039; or &#039;&#039;xfsr&#039;&#039; are some tools which attempt to do this, with varying success.&lt;br /&gt;
&lt;br /&gt;
There are also commercial data recovery services and closed source software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS] which claims to recover data, although this has not been tested by the XFS developers.&lt;br /&gt;
&lt;br /&gt;
As always, the best advice is to keep good backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE) (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAIDs have a persistent write cache which is preserved across power failure, interface resets, system crashes, etc.  The same may be true of some SSD devices.  This sort of hardware should report to the operating system that no flushes are required, and in that case barriers will not be issued, even without the &amp;quot;nobarrier&amp;quot; option.  Quoting Christoph Hellwig [http://oss.sgi.com/archives/xfs/2015-12/msg00281.html on the xfs list],&lt;br /&gt;
  If the device does not need cache flushes it should not report requiring&lt;br /&gt;
  flushes, in which case nobarrier will be a noop.  Or to phrase it&lt;br /&gt;
  differently:  If nobarrier makes a difference skipping it is not safe.&lt;br /&gt;
On modern kernels with hardware which properly reports write cache behavior, there is no need to change barrier options at mount time.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery or flash backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. This battery backed cache should ensure that if power fails or a PSU dies, the contents of the cache will be written to disk on next boot. However, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents.&lt;br /&gt;
&lt;br /&gt;
If you do not have a battery or flash backed cache you should seriously consider disabling write cache if you value your data.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, this will disable the controller and disk cache (see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf, page 86); &lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
 MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL                          # flushes the controller cache&lt;br /&gt;
 MegaCli -LDGetProp -Cache    -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the controller cache settings&lt;br /&gt;
 MegaCli -LDGetProp -DskCache -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the disk cache settings (for all phys. disks in logical disk)&lt;br /&gt;
 MegaCli -LDSetProp -EnDskCache|DisDskCache  -LN|-L0,1,2|-LAll  -aN|-a0,1,2|-aALL # set disk cache setting&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039; should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/archives/xfs/2009-01/msg01023.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. This was an issue with the older &amp;quot;inode32&amp;quot; inode allocation mode, where inode allocation is restricted to lower filesysetm blocks.  To fix this, [http://oss.sgi.com/archives/xfs/2009-01/msg01031.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Alternately, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
However, &#039;inode64&#039; has been the default behavior since kernel v3.7...&lt;br /&gt;
&lt;br /&gt;
Unfortunately, v3.7 also added a bug present from kernel v3.7 to v3.17 which caused new allocation groups added by growfs to be unavailable for inode allocation.  This was fixed by commit &amp;lt;tt&amp;gt;[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9de67c3ba9ea961ba420573d56479d09d33a7587 9de67c3b xfs: allow inode allocations in post-growfs disk space.]&amp;lt;/tt&amp;gt; in kernel v3.17.&lt;br /&gt;
Without that commit, the problem can be worked around by doing a &amp;quot;mount -o remount,inode64&amp;quot; after the growfs operation.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Premature optimization is the root of all evil.&#039;&#039; - Donald Knuth&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;br /&gt;
&lt;br /&gt;
As of kernel 3.2.12, the default i/o scheduler, CFQ, will defeat much of the parallelization in XFS.&lt;br /&gt;
&lt;br /&gt;
== Q: Which factors influence the memory usage of xfs_repair? ==&lt;br /&gt;
&lt;br /&gt;
This is best explained with an example. The example filesystem is 16Tb, but basically empty (look at icount).&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -n -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 64, imem = 0, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2096.&lt;br /&gt;
  #&lt;br /&gt;
&lt;br /&gt;
xfs_repair is saying it needs at least 2096MB of RAM to repair the filesystem,&lt;br /&gt;
of which 2,097,152KB is needed for tracking free space. &lt;br /&gt;
(The -m 1 argument was telling xfs_repair to use ony 1 MB of memory.)&lt;br /&gt;
&lt;br /&gt;
Now if we add some inodes (50 million) to the filesystem (look at icount again), and the result is:&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 50401792, imem = 196882, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2289.&lt;br /&gt;
&lt;br /&gt;
That is now needs at least another 200MB of RAM to run.&lt;br /&gt;
&lt;br /&gt;
The numbers reported by xfs_repair are the absolute minimum required and approximate at that;&lt;br /&gt;
more RAM than this may be required to complete successfully.&lt;br /&gt;
Also, if you only give xfs_repair the minimum required RAM, it will be slow;&lt;br /&gt;
for best repair performance, the more RAM you can give it the better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why some files of my filesystem shows as &amp;quot;?????????? ? ?      ?          ?                ? filename&amp;quot; ? ==&lt;br /&gt;
&lt;br /&gt;
If ls -l shows you a listing as&lt;br /&gt;
&lt;br /&gt;
  # ?????????? ? ?      ?          ?                ? file1&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file2&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file3&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file4&lt;br /&gt;
&lt;br /&gt;
and errors like:&lt;br /&gt;
  # ls /pathtodir/&lt;br /&gt;
    ls: cannot access /pathtodir/file1: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file2: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file3: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file4: Invalid argument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or even:&lt;br /&gt;
  # failed to stat /pathtodir/file1&lt;br /&gt;
&lt;br /&gt;
It is very probable your filesystem must be mounted with inode64&lt;br /&gt;
  # mount -oremount,inode64 /dev/diskpart /mnt/xfs&lt;br /&gt;
&lt;br /&gt;
should make it work ok again.&lt;br /&gt;
If it works, add the option to fstab.&lt;br /&gt;
&lt;br /&gt;
== Q: The xfs_db &amp;quot;frag&amp;quot; command says I&#039;m over 50%.  Is that bad? ==&lt;br /&gt;
&lt;br /&gt;
It depends.  It&#039;s important to know how the value is calculated.  xfs_db looks at the extents in all files, and returns:&lt;br /&gt;
&lt;br /&gt;
  (actual extents - ideal extents) / actual extents&lt;br /&gt;
&lt;br /&gt;
This means that if, for example, you have an average of 2 extents per file, you&#039;ll get an answer of 50%.  4 extents per file would give you 75%.  This may or may not be a problem, especially depending on the size of the files in question.  (i.e. 400GB files in four 100GB extents would hardly be considered badly fragmented).  The xfs_bmap command can be useful for displaying the actual fragmentation/layout of individual files.&lt;br /&gt;
&lt;br /&gt;
Note that above a few average extents per file, the fragmentation factor rapidly approaches 100%:&lt;br /&gt;
[[Image:Frag_factor.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Q: I&#039;m getting &amp;quot;Internal error xfs_sb_read_verify&amp;quot; errors when I try to run xfs_growfs under kernels v3.10 through v3.12 ==&lt;br /&gt;
&lt;br /&gt;
This may happen when running xfs_growfs under a v3.10-v3.12 kernel,&lt;br /&gt;
if the filesystem was previously grown under a kernel prior to v3.8.&lt;br /&gt;
&lt;br /&gt;
Old kernel versions prior to v3.8 did not zero the empty part of&lt;br /&gt;
new secondary superblocks when growing the filesystem with xfs_growfs.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.10 and later began detecting this non-zero part of the&lt;br /&gt;
superblock as corruption, and emit the &lt;br /&gt;
&lt;br /&gt;
    Internal error xfs_sb_read_verify&lt;br /&gt;
&lt;br /&gt;
error message.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.13 and later are more forgiving about this - if the non-zero &lt;br /&gt;
data is found on a Version 4 superblock, it will not be flagged as&lt;br /&gt;
corruption.&lt;br /&gt;
&lt;br /&gt;
The problematic secondary superblocks may be repaired by using an xfs_repair&lt;br /&gt;
version 3.2.0-alpha1 or above.&lt;br /&gt;
&lt;br /&gt;
The relevant kernelspace commits are as follows:&lt;br /&gt;
&lt;br /&gt;
    v3.8  1375cb6 xfs: growfs: don&#039;t read garbage for new secondary superblocks &amp;lt;- fixed underlying problem &lt;br /&gt;
    v3.10 04a1e6c xfs: add CRC checks to the superblock &amp;lt;- detected old underlying problem&lt;br /&gt;
    v3.13 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields &amp;lt;- is more forgiving of old underlying problem&lt;br /&gt;
&lt;br /&gt;
This commit allows xfs_repair to detect and correct the problem:&lt;br /&gt;
&lt;br /&gt;
    v3.2.0-alpha1 cbd7508 xfs_repair: zero out unused parts of superblocks&lt;br /&gt;
&lt;br /&gt;
== Q: Why do files on XFS use more data blocks than expected? ==&lt;br /&gt;
&lt;br /&gt;
The XFS speculative preallocation algorithm allocates extra blocks beyond end of file (EOF) to minimize file fragmentation during buffered write workloads. Workloads that benefit from this behaviour include slowly growing files, concurrent writers and mixed reader/writer workloads. It also provides fragmentation resistance in situations where memory pressure prevents adequate buffering of dirty data to allow formation of large contiguous regions of data in memory.&lt;br /&gt;
&lt;br /&gt;
This post-EOF block allocation is accounted identically to blocks within EOF. It is visible in &#039;st_blocks&#039; counts via stat() system calls, accounted as globally allocated space and against quotas that apply to the associated file. The space is reported by various userspace utilities (stat, du, df, ls) and thus provides a common source of confusion for administrators. Post-EOF blocks are temporary in most situations and are usually reclaimed via several possible mechanisms in XFS.&lt;br /&gt;
&lt;br /&gt;
See the FAQ entry on speculative preallocation for details.&lt;br /&gt;
&lt;br /&gt;
== Q: What is speculative preallocation? ==&lt;br /&gt;
&lt;br /&gt;
XFS speculatively preallocates post-EOF blocks on file extending writes in anticipation of future extending writes. The size of a preallocation is dynamic and depends on the runtime state of the file and fs. Generally speaking, preallocation is disabled for very small files and preallocation sizes grow as files grow larger.&lt;br /&gt;
&lt;br /&gt;
Preallocations are capped to the maximum extent size supported by the filesystem. Preallocation size is throttled automatically as the filesystem approaches low free space conditions or other allocation limits on a file (such as a quota).&lt;br /&gt;
&lt;br /&gt;
In most cases, speculative preallocation is automatically reclaimed when a file is closed. Applications that repeatedly trigger preallocation and reclaim cycles (e.g., this is common in file server or log file workloads) can cause fragmentation. Therefore, this pattern is detected and causes the preallocation to persist beyond the lifecycle of the file descriptor.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I speed up or avoid delayed removal of speculative preallocation?  ==&lt;br /&gt;
&lt;br /&gt;
Linux 3.8 (and later) includes a scanner to perform background trimming of files with lingering post-EOF preallocations. The scanner bypasses dirty files to avoid interference with ongoing writes. A 5 minute scan interval is used by default and can be adjusted via the following file (value in seconds):&lt;br /&gt;
&lt;br /&gt;
        /proc/sys/fs/xfs/speculative_prealloc_lifetime&lt;br /&gt;
&lt;br /&gt;
== Q: Is speculative preallocation permanent? ==&lt;br /&gt;
&lt;br /&gt;
Preallocated blocks are normally reclaimed on file close, inode reclaim, unmount or in the background once file write activity subsides. They can be explicitly made permanent via fallocate or a similar interface. They can be implicitly made permanent in situations where file size is extended beyond a range of post-EOF blocks (i.e., via an extending truncate) or following a crash. In the event of a crash, the in-memory state used to track and reclaim the speculative preallocation is lost.&lt;br /&gt;
&lt;br /&gt;
== Q: My workload has known characteristics - can I disable speculative preallocation or tune it to an optimal fixed size? ==&lt;br /&gt;
&lt;br /&gt;
Speculative preallocation can not be disabled but XFS can be tuned to a fixed allocation size with the &#039;allocsize=&#039; mount option. Speculative preallocation is not dynamically resized when the allocsize mount option is set and thus the potential for fragmentation is increased. Use &#039;allocsize=64k&#039; to revert to the default XFS behavior prior to support for dynamic speculative preallocation.&lt;br /&gt;
&lt;br /&gt;
== Q: mount (or umount) takes minutes or even hours - what could be the reason ? ==&lt;br /&gt;
&lt;br /&gt;
In some cases xfs log (journal) can become quite big. For example if it accumulates many entries and doesn&#039;t get chance to apply these to disk (due to lockup, crash, hard reset etc). xfs will try to reapply these at mount (in dmesg: &amp;quot;Starting recovery (logdev: internal)&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
That process with big log to be reapplied can take very long time (minutes or even hours). Similar problem can happen with unmount taking hours when there are hundreds of thousands of dirty inode in memory that need to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
(http://oss.sgi.com/pipermail/xfs/2015-October/044457.html)&lt;br /&gt;
&lt;br /&gt;
== Q: Which I/O scheduler for XFS? ==&lt;br /&gt;
&lt;br /&gt;
=== On rotational disks without hardware raid ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;CFQ&#039;&#039;: not great for XFS parallelism:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt; dchinner&amp;gt; it doesn&#039;t allow other threads to get IO issued immediately after the first one&lt;br /&gt;
  &amp;lt; dchinner&amp;gt; it waits, instead, for a timeslice to expire before moving to the IO of a different process.&lt;br /&gt;
  &amp;lt; dchinner&amp;gt; so instead of interleaving the IO of multiple jobs in a single sweep across the disk,&lt;br /&gt;
              it enforces single threaded access to the disk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;deadline&#039;&#039;: good option, doesn&#039;t have such problem&lt;br /&gt;
&lt;br /&gt;
Note that some kernels have block multiqueue enabled which (currently - 08/2016) doesn&#039;t support I/O schedulers at all thus there is no optimisation and reordering IO for best seek order, so disable blk-mq for rotational disks (see CONFIG_SCSI_MQ_DEFAULT, CONFIG_DM_MQ_DEFAULT options and use_blk_mq parameter for scsi-mod/dm-mod kernel modules).&lt;br /&gt;
&lt;br /&gt;
Also hardware raid can be smart enough to cache and reorder I/O requests thus additional layer of reordering&lt;br /&gt;
(like Linux I/O scheduler) can potentially conflict and make performance worse. If you have such raid card&lt;br /&gt;
then try method described below.&lt;br /&gt;
&lt;br /&gt;
=== SSD disks or rotational disks but with hardware raid card that has cache enabled ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Block multiqueue&#039;&#039; enabled (and thus no I/O scheduler at all) or block multiqueue disabled and &#039;&#039;noop&#039;&#039; or &#039;&#039;deadline&#039;&#039; I/O scheduler activated is good solution. SSD disks don&#039;t really need I/O schedulers while smart raid cards do I/O ordering on their own.&lt;br /&gt;
&lt;br /&gt;
Note that if your raid is very dumb and/or has no cache enabled then it likely cannot reorder I/O requests and thus it could benefit from I/O scheduler.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2992</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2992"/>
		<updated>2016-08-10T21:24:04Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* On rotational disks without hardware raid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
What you need to report depend on the problem you are seeing. Firstly, your machine hardware and storage configuration needs to be described. That includes:&lt;br /&gt;
&lt;br /&gt;
* kernel version (uname -a)&lt;br /&gt;
* xfsprogs version (xfs_repair -V)&lt;br /&gt;
* number of CPUs&lt;br /&gt;
* contents of /proc/meminfo&lt;br /&gt;
* contents of /proc/mounts&lt;br /&gt;
* contents of /proc/partitions&lt;br /&gt;
* RAID layout (hardware and/or software)&lt;br /&gt;
* LVM configuration&lt;br /&gt;
* type of disks you are using&lt;br /&gt;
* write cache status of drives&lt;br /&gt;
* size of BBWC and mode it is running in&lt;br /&gt;
* xfs_info output on the filesystem in question&lt;br /&gt;
* dmesg output showing all error messages and stack traces&lt;br /&gt;
 &lt;br /&gt;
Then you need to describe your workload that is causing the problem, and a demonstration of the bad behaviour that is occurring. If it is a performance problem, then 30s - 1 minute samples of:&lt;br /&gt;
&lt;br /&gt;
# iostat -x -d -m 5&lt;br /&gt;
# vmstat 5&lt;br /&gt;
 &lt;br /&gt;
can give us insight into the IO and memory utilisation of your machine at the time of the problem.&lt;br /&gt;
&lt;br /&gt;
If the filesystem is hanging, then capture the output of the dmesg command after running:&lt;br /&gt;
&lt;br /&gt;
 # echo w &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
 # dmesg&lt;br /&gt;
&lt;br /&gt;
will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.&lt;br /&gt;
&lt;br /&gt;
And for advanced users, capturing an event trace using &#039;&#039;&#039;trace-cmd&#039;&#039;&#039; (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it&#039;s a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd record -e xfs\*&lt;br /&gt;
&lt;br /&gt;
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd report &amp;gt; trace_report.txt&lt;br /&gt;
&lt;br /&gt;
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039;, make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS.&lt;br /&gt;
&lt;br /&gt;
However, if an inode is unlinked but neither it nor its associated data blocks get immediately re-used and overwritten, there is some small chance to recover the file from the disk.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;photorec&#039;&#039;, &#039;&#039;xfs_irecover&#039;&#039; or &#039;&#039;xfsr&#039;&#039; are some tools which attempt to do this, with varying success.&lt;br /&gt;
&lt;br /&gt;
There are also commercial data recovery services and closed source software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS] which claims to recover data, although this has not been tested by the XFS developers.&lt;br /&gt;
&lt;br /&gt;
As always, the best advice is to keep good backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE) (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAIDs have a persistent write cache which is preserved across power failure, interface resets, system crashes, etc.  The same may be true of some SSD devices.  This sort of hardware should report to the operating system that no flushes are required, and in that case barriers will not be issued, even without the &amp;quot;nobarrier&amp;quot; option.  Quoting Christoph Hellwig [http://oss.sgi.com/archives/xfs/2015-12/msg00281.html on the xfs list],&lt;br /&gt;
  If the device does not need cache flushes it should not report requiring&lt;br /&gt;
  flushes, in which case nobarrier will be a noop.  Or to phrase it&lt;br /&gt;
  differently:  If nobarrier makes a difference skipping it is not safe.&lt;br /&gt;
On modern kernels with hardware which properly reports write cache behavior, there is no need to change barrier options at mount time.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery or flash backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. This battery backed cache should ensure that if power fails or a PSU dies, the contents of the cache will be written to disk on next boot. However, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents.&lt;br /&gt;
&lt;br /&gt;
If you do not have a battery or flash backed cache you should seriously consider disabling write cache if you value your data.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, this will disable the controller and disk cache (see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf, page 86); &lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
 MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL                          # flushes the controller cache&lt;br /&gt;
 MegaCli -LDGetProp -Cache    -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the controller cache settings&lt;br /&gt;
 MegaCli -LDGetProp -DskCache -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the disk cache settings (for all phys. disks in logical disk)&lt;br /&gt;
 MegaCli -LDSetProp -EnDskCache|DisDskCache  -LN|-L0,1,2|-LAll  -aN|-a0,1,2|-aALL # set disk cache setting&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039; should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/archives/xfs/2009-01/msg01023.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. This was an issue with the older &amp;quot;inode32&amp;quot; inode allocation mode, where inode allocation is restricted to lower filesysetm blocks.  To fix this, [http://oss.sgi.com/archives/xfs/2009-01/msg01031.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Alternately, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
However, &#039;inode64&#039; has been the default behavior since kernel v3.7...&lt;br /&gt;
&lt;br /&gt;
Unfortunately, v3.7 also added a bug present from kernel v3.7 to v3.17 which caused new allocation groups added by growfs to be unavailable for inode allocation.  This was fixed by commit &amp;lt;tt&amp;gt;[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9de67c3ba9ea961ba420573d56479d09d33a7587 9de67c3b xfs: allow inode allocations in post-growfs disk space.]&amp;lt;/tt&amp;gt; in kernel v3.17.&lt;br /&gt;
Without that commit, the problem can be worked around by doing a &amp;quot;mount -o remount,inode64&amp;quot; after the growfs operation.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Premature optimization is the root of all evil.&#039;&#039; - Donald Knuth&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;br /&gt;
&lt;br /&gt;
As of kernel 3.2.12, the default i/o scheduler, CFQ, will defeat much of the parallelization in XFS.&lt;br /&gt;
&lt;br /&gt;
== Q: Which factors influence the memory usage of xfs_repair? ==&lt;br /&gt;
&lt;br /&gt;
This is best explained with an example. The example filesystem is 16Tb, but basically empty (look at icount).&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -n -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 64, imem = 0, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2096.&lt;br /&gt;
  #&lt;br /&gt;
&lt;br /&gt;
xfs_repair is saying it needs at least 2096MB of RAM to repair the filesystem,&lt;br /&gt;
of which 2,097,152KB is needed for tracking free space. &lt;br /&gt;
(The -m 1 argument was telling xfs_repair to use ony 1 MB of memory.)&lt;br /&gt;
&lt;br /&gt;
Now if we add some inodes (50 million) to the filesystem (look at icount again), and the result is:&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 50401792, imem = 196882, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2289.&lt;br /&gt;
&lt;br /&gt;
That is now needs at least another 200MB of RAM to run.&lt;br /&gt;
&lt;br /&gt;
The numbers reported by xfs_repair are the absolute minimum required and approximate at that;&lt;br /&gt;
more RAM than this may be required to complete successfully.&lt;br /&gt;
Also, if you only give xfs_repair the minimum required RAM, it will be slow;&lt;br /&gt;
for best repair performance, the more RAM you can give it the better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why some files of my filesystem shows as &amp;quot;?????????? ? ?      ?          ?                ? filename&amp;quot; ? ==&lt;br /&gt;
&lt;br /&gt;
If ls -l shows you a listing as&lt;br /&gt;
&lt;br /&gt;
  # ?????????? ? ?      ?          ?                ? file1&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file2&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file3&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file4&lt;br /&gt;
&lt;br /&gt;
and errors like:&lt;br /&gt;
  # ls /pathtodir/&lt;br /&gt;
    ls: cannot access /pathtodir/file1: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file2: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file3: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file4: Invalid argument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or even:&lt;br /&gt;
  # failed to stat /pathtodir/file1&lt;br /&gt;
&lt;br /&gt;
It is very probable your filesystem must be mounted with inode64&lt;br /&gt;
  # mount -oremount,inode64 /dev/diskpart /mnt/xfs&lt;br /&gt;
&lt;br /&gt;
should make it work ok again.&lt;br /&gt;
If it works, add the option to fstab.&lt;br /&gt;
&lt;br /&gt;
== Q: The xfs_db &amp;quot;frag&amp;quot; command says I&#039;m over 50%.  Is that bad? ==&lt;br /&gt;
&lt;br /&gt;
It depends.  It&#039;s important to know how the value is calculated.  xfs_db looks at the extents in all files, and returns:&lt;br /&gt;
&lt;br /&gt;
  (actual extents - ideal extents) / actual extents&lt;br /&gt;
&lt;br /&gt;
This means that if, for example, you have an average of 2 extents per file, you&#039;ll get an answer of 50%.  4 extents per file would give you 75%.  This may or may not be a problem, especially depending on the size of the files in question.  (i.e. 400GB files in four 100GB extents would hardly be considered badly fragmented).  The xfs_bmap command can be useful for displaying the actual fragmentation/layout of individual files.&lt;br /&gt;
&lt;br /&gt;
Note that above a few average extents per file, the fragmentation factor rapidly approaches 100%:&lt;br /&gt;
[[Image:Frag_factor.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Q: I&#039;m getting &amp;quot;Internal error xfs_sb_read_verify&amp;quot; errors when I try to run xfs_growfs under kernels v3.10 through v3.12 ==&lt;br /&gt;
&lt;br /&gt;
This may happen when running xfs_growfs under a v3.10-v3.12 kernel,&lt;br /&gt;
if the filesystem was previously grown under a kernel prior to v3.8.&lt;br /&gt;
&lt;br /&gt;
Old kernel versions prior to v3.8 did not zero the empty part of&lt;br /&gt;
new secondary superblocks when growing the filesystem with xfs_growfs.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.10 and later began detecting this non-zero part of the&lt;br /&gt;
superblock as corruption, and emit the &lt;br /&gt;
&lt;br /&gt;
    Internal error xfs_sb_read_verify&lt;br /&gt;
&lt;br /&gt;
error message.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.13 and later are more forgiving about this - if the non-zero &lt;br /&gt;
data is found on a Version 4 superblock, it will not be flagged as&lt;br /&gt;
corruption.&lt;br /&gt;
&lt;br /&gt;
The problematic secondary superblocks may be repaired by using an xfs_repair&lt;br /&gt;
version 3.2.0-alpha1 or above.&lt;br /&gt;
&lt;br /&gt;
The relevant kernelspace commits are as follows:&lt;br /&gt;
&lt;br /&gt;
    v3.8  1375cb6 xfs: growfs: don&#039;t read garbage for new secondary superblocks &amp;lt;- fixed underlying problem &lt;br /&gt;
    v3.10 04a1e6c xfs: add CRC checks to the superblock &amp;lt;- detected old underlying problem&lt;br /&gt;
    v3.13 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields &amp;lt;- is more forgiving of old underlying problem&lt;br /&gt;
&lt;br /&gt;
This commit allows xfs_repair to detect and correct the problem:&lt;br /&gt;
&lt;br /&gt;
    v3.2.0-alpha1 cbd7508 xfs_repair: zero out unused parts of superblocks&lt;br /&gt;
&lt;br /&gt;
== Q: Why do files on XFS use more data blocks than expected? ==&lt;br /&gt;
&lt;br /&gt;
The XFS speculative preallocation algorithm allocates extra blocks beyond end of file (EOF) to minimize file fragmentation during buffered write workloads. Workloads that benefit from this behaviour include slowly growing files, concurrent writers and mixed reader/writer workloads. It also provides fragmentation resistance in situations where memory pressure prevents adequate buffering of dirty data to allow formation of large contiguous regions of data in memory.&lt;br /&gt;
&lt;br /&gt;
This post-EOF block allocation is accounted identically to blocks within EOF. It is visible in &#039;st_blocks&#039; counts via stat() system calls, accounted as globally allocated space and against quotas that apply to the associated file. The space is reported by various userspace utilities (stat, du, df, ls) and thus provides a common source of confusion for administrators. Post-EOF blocks are temporary in most situations and are usually reclaimed via several possible mechanisms in XFS.&lt;br /&gt;
&lt;br /&gt;
See the FAQ entry on speculative preallocation for details.&lt;br /&gt;
&lt;br /&gt;
== Q: What is speculative preallocation? ==&lt;br /&gt;
&lt;br /&gt;
XFS speculatively preallocates post-EOF blocks on file extending writes in anticipation of future extending writes. The size of a preallocation is dynamic and depends on the runtime state of the file and fs. Generally speaking, preallocation is disabled for very small files and preallocation sizes grow as files grow larger.&lt;br /&gt;
&lt;br /&gt;
Preallocations are capped to the maximum extent size supported by the filesystem. Preallocation size is throttled automatically as the filesystem approaches low free space conditions or other allocation limits on a file (such as a quota).&lt;br /&gt;
&lt;br /&gt;
In most cases, speculative preallocation is automatically reclaimed when a file is closed. Applications that repeatedly trigger preallocation and reclaim cycles (e.g., this is common in file server or log file workloads) can cause fragmentation. Therefore, this pattern is detected and causes the preallocation to persist beyond the lifecycle of the file descriptor.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I speed up or avoid delayed removal of speculative preallocation?  ==&lt;br /&gt;
&lt;br /&gt;
Linux 3.8 (and later) includes a scanner to perform background trimming of files with lingering post-EOF preallocations. The scanner bypasses dirty files to avoid interference with ongoing writes. A 5 minute scan interval is used by default and can be adjusted via the following file (value in seconds):&lt;br /&gt;
&lt;br /&gt;
        /proc/sys/fs/xfs/speculative_prealloc_lifetime&lt;br /&gt;
&lt;br /&gt;
== Q: Is speculative preallocation permanent? ==&lt;br /&gt;
&lt;br /&gt;
Preallocated blocks are normally reclaimed on file close, inode reclaim, unmount or in the background once file write activity subsides. They can be explicitly made permanent via fallocate or a similar interface. They can be implicitly made permanent in situations where file size is extended beyond a range of post-EOF blocks (i.e., via an extending truncate) or following a crash. In the event of a crash, the in-memory state used to track and reclaim the speculative preallocation is lost.&lt;br /&gt;
&lt;br /&gt;
== Q: My workload has known characteristics - can I disable speculative preallocation or tune it to an optimal fixed size? ==&lt;br /&gt;
&lt;br /&gt;
Speculative preallocation can not be disabled but XFS can be tuned to a fixed allocation size with the &#039;allocsize=&#039; mount option. Speculative preallocation is not dynamically resized when the allocsize mount option is set and thus the potential for fragmentation is increased. Use &#039;allocsize=64k&#039; to revert to the default XFS behavior prior to support for dynamic speculative preallocation.&lt;br /&gt;
&lt;br /&gt;
== Q: mount (or umount) takes minutes or even hours - what could be the reason ? ==&lt;br /&gt;
&lt;br /&gt;
In some cases xfs log (journal) can become quite big. For example if it accumulates many entries and doesn&#039;t get chance to apply these to disk (due to lockup, crash, hard reset etc). xfs will try to reapply these at mount (in dmesg: &amp;quot;Starting recovery (logdev: internal)&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
That process with big log to be reapplied can take very long time (minutes or even hours). Similar problem can happen with unmount taking hours when there are hundreds of thousands of dirty inode in memory that need to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
(http://oss.sgi.com/pipermail/xfs/2015-October/044457.html)&lt;br /&gt;
&lt;br /&gt;
== Q: Which I/O scheduler for XFS? ==&lt;br /&gt;
&lt;br /&gt;
=== On rotational disks without hardware raid ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;CFQ&#039;&#039;: not great for XFS parallelism:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt; dchinner&amp;gt; it doesn&#039;t allow other threads to get IO issued immediately after the first one&lt;br /&gt;
  &amp;lt; dchinner&amp;gt; it waits, instead, for a timeslice to expire before moving to the IO of a different process.&lt;br /&gt;
  &amp;lt; dchinner&amp;gt; so instead of interleaving the IO of multiple jobs in a single sweep across the disk,&lt;br /&gt;
              it enforces single threaded access to the disk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;deadline&#039;&#039;: good option, doesn&#039;t have such problem&lt;br /&gt;
&lt;br /&gt;
Note that some kernels have block multiqueue enabled which (currently - 08/2016) doesn&#039;t support I/O schedulers at all thus there is no optimisation and reordering IO for best seek order, so disable blk-mq for rotational disks (see CONFIG_SCSI_MQ_DEFAULT, CONFIG_DM_MQ_DEFAULT options and use_blk_mq parameter for scsi-mod/dm-mod kernel modules).&lt;br /&gt;
&lt;br /&gt;
Also hardware raid can be smart enough to cache and reorder I/O requests thus additional layer of reordering&lt;br /&gt;
(like Linux I/O scheduler) can potentially conflict and make performance worse. If you have such raid card&lt;br /&gt;
then try method described below.&lt;br /&gt;
&lt;br /&gt;
=== SSD disks or rotational disks but with hardware raid card that has cache enabled ===&lt;br /&gt;
&lt;br /&gt;
Block multiqueue enabled (and thus no I/O scheduler at all) or block multiqueue disabled and noop or deadline I/O scheduler activated is good solution. SSD disks don&#039;t really need I/O schedulers while smart raid cards do I/O ordering on their own.&lt;br /&gt;
&lt;br /&gt;
Note that if your raid is very dumb and/or has no cache enabled then it likely cannot reorder I/O requests and thus it could benefit from I/O scheduler.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2991</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2991"/>
		<updated>2016-08-10T21:22:55Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: trying to explain which I/O scheduler is good choice for xfs. Based on dchinner knowledge (hopefully translated without errors into FAQ entry).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
What you need to report depend on the problem you are seeing. Firstly, your machine hardware and storage configuration needs to be described. That includes:&lt;br /&gt;
&lt;br /&gt;
* kernel version (uname -a)&lt;br /&gt;
* xfsprogs version (xfs_repair -V)&lt;br /&gt;
* number of CPUs&lt;br /&gt;
* contents of /proc/meminfo&lt;br /&gt;
* contents of /proc/mounts&lt;br /&gt;
* contents of /proc/partitions&lt;br /&gt;
* RAID layout (hardware and/or software)&lt;br /&gt;
* LVM configuration&lt;br /&gt;
* type of disks you are using&lt;br /&gt;
* write cache status of drives&lt;br /&gt;
* size of BBWC and mode it is running in&lt;br /&gt;
* xfs_info output on the filesystem in question&lt;br /&gt;
* dmesg output showing all error messages and stack traces&lt;br /&gt;
 &lt;br /&gt;
Then you need to describe your workload that is causing the problem, and a demonstration of the bad behaviour that is occurring. If it is a performance problem, then 30s - 1 minute samples of:&lt;br /&gt;
&lt;br /&gt;
# iostat -x -d -m 5&lt;br /&gt;
# vmstat 5&lt;br /&gt;
 &lt;br /&gt;
can give us insight into the IO and memory utilisation of your machine at the time of the problem.&lt;br /&gt;
&lt;br /&gt;
If the filesystem is hanging, then capture the output of the dmesg command after running:&lt;br /&gt;
&lt;br /&gt;
 # echo w &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
 # dmesg&lt;br /&gt;
&lt;br /&gt;
will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.&lt;br /&gt;
&lt;br /&gt;
And for advanced users, capturing an event trace using &#039;&#039;&#039;trace-cmd&#039;&#039;&#039; (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it&#039;s a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd record -e xfs\*&lt;br /&gt;
&lt;br /&gt;
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd report &amp;gt; trace_report.txt&lt;br /&gt;
&lt;br /&gt;
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039;, make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS.&lt;br /&gt;
&lt;br /&gt;
However, if an inode is unlinked but neither it nor its associated data blocks get immediately re-used and overwritten, there is some small chance to recover the file from the disk.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;photorec&#039;&#039;, &#039;&#039;xfs_irecover&#039;&#039; or &#039;&#039;xfsr&#039;&#039; are some tools which attempt to do this, with varying success.&lt;br /&gt;
&lt;br /&gt;
There are also commercial data recovery services and closed source software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS] which claims to recover data, although this has not been tested by the XFS developers.&lt;br /&gt;
&lt;br /&gt;
As always, the best advice is to keep good backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE) (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAIDs have a persistent write cache which is preserved across power failure, interface resets, system crashes, etc.  The same may be true of some SSD devices.  This sort of hardware should report to the operating system that no flushes are required, and in that case barriers will not be issued, even without the &amp;quot;nobarrier&amp;quot; option.  Quoting Christoph Hellwig [http://oss.sgi.com/archives/xfs/2015-12/msg00281.html on the xfs list],&lt;br /&gt;
  If the device does not need cache flushes it should not report requiring&lt;br /&gt;
  flushes, in which case nobarrier will be a noop.  Or to phrase it&lt;br /&gt;
  differently:  If nobarrier makes a difference skipping it is not safe.&lt;br /&gt;
On modern kernels with hardware which properly reports write cache behavior, there is no need to change barrier options at mount time.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery or flash backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. This battery backed cache should ensure that if power fails or a PSU dies, the contents of the cache will be written to disk on next boot. However, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents.&lt;br /&gt;
&lt;br /&gt;
If you do not have a battery or flash backed cache you should seriously consider disabling write cache if you value your data.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, this will disable the controller and disk cache (see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf, page 86); &lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
 MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL                          # flushes the controller cache&lt;br /&gt;
 MegaCli -LDGetProp -Cache    -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the controller cache settings&lt;br /&gt;
 MegaCli -LDGetProp -DskCache -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the disk cache settings (for all phys. disks in logical disk)&lt;br /&gt;
 MegaCli -LDSetProp -EnDskCache|DisDskCache  -LN|-L0,1,2|-LAll  -aN|-a0,1,2|-aALL # set disk cache setting&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039; should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/archives/xfs/2009-01/msg01023.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. This was an issue with the older &amp;quot;inode32&amp;quot; inode allocation mode, where inode allocation is restricted to lower filesysetm blocks.  To fix this, [http://oss.sgi.com/archives/xfs/2009-01/msg01031.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Alternately, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
However, &#039;inode64&#039; has been the default behavior since kernel v3.7...&lt;br /&gt;
&lt;br /&gt;
Unfortunately, v3.7 also added a bug present from kernel v3.7 to v3.17 which caused new allocation groups added by growfs to be unavailable for inode allocation.  This was fixed by commit &amp;lt;tt&amp;gt;[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9de67c3ba9ea961ba420573d56479d09d33a7587 9de67c3b xfs: allow inode allocations in post-growfs disk space.]&amp;lt;/tt&amp;gt; in kernel v3.17.&lt;br /&gt;
Without that commit, the problem can be worked around by doing a &amp;quot;mount -o remount,inode64&amp;quot; after the growfs operation.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Premature optimization is the root of all evil.&#039;&#039; - Donald Knuth&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;br /&gt;
&lt;br /&gt;
As of kernel 3.2.12, the default i/o scheduler, CFQ, will defeat much of the parallelization in XFS.&lt;br /&gt;
&lt;br /&gt;
== Q: Which factors influence the memory usage of xfs_repair? ==&lt;br /&gt;
&lt;br /&gt;
This is best explained with an example. The example filesystem is 16Tb, but basically empty (look at icount).&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -n -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 64, imem = 0, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2096.&lt;br /&gt;
  #&lt;br /&gt;
&lt;br /&gt;
xfs_repair is saying it needs at least 2096MB of RAM to repair the filesystem,&lt;br /&gt;
of which 2,097,152KB is needed for tracking free space. &lt;br /&gt;
(The -m 1 argument was telling xfs_repair to use ony 1 MB of memory.)&lt;br /&gt;
&lt;br /&gt;
Now if we add some inodes (50 million) to the filesystem (look at icount again), and the result is:&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 50401792, imem = 196882, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2289.&lt;br /&gt;
&lt;br /&gt;
That is now needs at least another 200MB of RAM to run.&lt;br /&gt;
&lt;br /&gt;
The numbers reported by xfs_repair are the absolute minimum required and approximate at that;&lt;br /&gt;
more RAM than this may be required to complete successfully.&lt;br /&gt;
Also, if you only give xfs_repair the minimum required RAM, it will be slow;&lt;br /&gt;
for best repair performance, the more RAM you can give it the better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why some files of my filesystem shows as &amp;quot;?????????? ? ?      ?          ?                ? filename&amp;quot; ? ==&lt;br /&gt;
&lt;br /&gt;
If ls -l shows you a listing as&lt;br /&gt;
&lt;br /&gt;
  # ?????????? ? ?      ?          ?                ? file1&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file2&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file3&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file4&lt;br /&gt;
&lt;br /&gt;
and errors like:&lt;br /&gt;
  # ls /pathtodir/&lt;br /&gt;
    ls: cannot access /pathtodir/file1: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file2: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file3: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file4: Invalid argument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or even:&lt;br /&gt;
  # failed to stat /pathtodir/file1&lt;br /&gt;
&lt;br /&gt;
It is very probable your filesystem must be mounted with inode64&lt;br /&gt;
  # mount -oremount,inode64 /dev/diskpart /mnt/xfs&lt;br /&gt;
&lt;br /&gt;
should make it work ok again.&lt;br /&gt;
If it works, add the option to fstab.&lt;br /&gt;
&lt;br /&gt;
== Q: The xfs_db &amp;quot;frag&amp;quot; command says I&#039;m over 50%.  Is that bad? ==&lt;br /&gt;
&lt;br /&gt;
It depends.  It&#039;s important to know how the value is calculated.  xfs_db looks at the extents in all files, and returns:&lt;br /&gt;
&lt;br /&gt;
  (actual extents - ideal extents) / actual extents&lt;br /&gt;
&lt;br /&gt;
This means that if, for example, you have an average of 2 extents per file, you&#039;ll get an answer of 50%.  4 extents per file would give you 75%.  This may or may not be a problem, especially depending on the size of the files in question.  (i.e. 400GB files in four 100GB extents would hardly be considered badly fragmented).  The xfs_bmap command can be useful for displaying the actual fragmentation/layout of individual files.&lt;br /&gt;
&lt;br /&gt;
Note that above a few average extents per file, the fragmentation factor rapidly approaches 100%:&lt;br /&gt;
[[Image:Frag_factor.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Q: I&#039;m getting &amp;quot;Internal error xfs_sb_read_verify&amp;quot; errors when I try to run xfs_growfs under kernels v3.10 through v3.12 ==&lt;br /&gt;
&lt;br /&gt;
This may happen when running xfs_growfs under a v3.10-v3.12 kernel,&lt;br /&gt;
if the filesystem was previously grown under a kernel prior to v3.8.&lt;br /&gt;
&lt;br /&gt;
Old kernel versions prior to v3.8 did not zero the empty part of&lt;br /&gt;
new secondary superblocks when growing the filesystem with xfs_growfs.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.10 and later began detecting this non-zero part of the&lt;br /&gt;
superblock as corruption, and emit the &lt;br /&gt;
&lt;br /&gt;
    Internal error xfs_sb_read_verify&lt;br /&gt;
&lt;br /&gt;
error message.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.13 and later are more forgiving about this - if the non-zero &lt;br /&gt;
data is found on a Version 4 superblock, it will not be flagged as&lt;br /&gt;
corruption.&lt;br /&gt;
&lt;br /&gt;
The problematic secondary superblocks may be repaired by using an xfs_repair&lt;br /&gt;
version 3.2.0-alpha1 or above.&lt;br /&gt;
&lt;br /&gt;
The relevant kernelspace commits are as follows:&lt;br /&gt;
&lt;br /&gt;
    v3.8  1375cb6 xfs: growfs: don&#039;t read garbage for new secondary superblocks &amp;lt;- fixed underlying problem &lt;br /&gt;
    v3.10 04a1e6c xfs: add CRC checks to the superblock &amp;lt;- detected old underlying problem&lt;br /&gt;
    v3.13 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields &amp;lt;- is more forgiving of old underlying problem&lt;br /&gt;
&lt;br /&gt;
This commit allows xfs_repair to detect and correct the problem:&lt;br /&gt;
&lt;br /&gt;
    v3.2.0-alpha1 cbd7508 xfs_repair: zero out unused parts of superblocks&lt;br /&gt;
&lt;br /&gt;
== Q: Why do files on XFS use more data blocks than expected? ==&lt;br /&gt;
&lt;br /&gt;
The XFS speculative preallocation algorithm allocates extra blocks beyond end of file (EOF) to minimize file fragmentation during buffered write workloads. Workloads that benefit from this behaviour include slowly growing files, concurrent writers and mixed reader/writer workloads. It also provides fragmentation resistance in situations where memory pressure prevents adequate buffering of dirty data to allow formation of large contiguous regions of data in memory.&lt;br /&gt;
&lt;br /&gt;
This post-EOF block allocation is accounted identically to blocks within EOF. It is visible in &#039;st_blocks&#039; counts via stat() system calls, accounted as globally allocated space and against quotas that apply to the associated file. The space is reported by various userspace utilities (stat, du, df, ls) and thus provides a common source of confusion for administrators. Post-EOF blocks are temporary in most situations and are usually reclaimed via several possible mechanisms in XFS.&lt;br /&gt;
&lt;br /&gt;
See the FAQ entry on speculative preallocation for details.&lt;br /&gt;
&lt;br /&gt;
== Q: What is speculative preallocation? ==&lt;br /&gt;
&lt;br /&gt;
XFS speculatively preallocates post-EOF blocks on file extending writes in anticipation of future extending writes. The size of a preallocation is dynamic and depends on the runtime state of the file and fs. Generally speaking, preallocation is disabled for very small files and preallocation sizes grow as files grow larger.&lt;br /&gt;
&lt;br /&gt;
Preallocations are capped to the maximum extent size supported by the filesystem. Preallocation size is throttled automatically as the filesystem approaches low free space conditions or other allocation limits on a file (such as a quota).&lt;br /&gt;
&lt;br /&gt;
In most cases, speculative preallocation is automatically reclaimed when a file is closed. Applications that repeatedly trigger preallocation and reclaim cycles (e.g., this is common in file server or log file workloads) can cause fragmentation. Therefore, this pattern is detected and causes the preallocation to persist beyond the lifecycle of the file descriptor.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I speed up or avoid delayed removal of speculative preallocation?  ==&lt;br /&gt;
&lt;br /&gt;
Linux 3.8 (and later) includes a scanner to perform background trimming of files with lingering post-EOF preallocations. The scanner bypasses dirty files to avoid interference with ongoing writes. A 5 minute scan interval is used by default and can be adjusted via the following file (value in seconds):&lt;br /&gt;
&lt;br /&gt;
        /proc/sys/fs/xfs/speculative_prealloc_lifetime&lt;br /&gt;
&lt;br /&gt;
== Q: Is speculative preallocation permanent? ==&lt;br /&gt;
&lt;br /&gt;
Preallocated blocks are normally reclaimed on file close, inode reclaim, unmount or in the background once file write activity subsides. They can be explicitly made permanent via fallocate or a similar interface. They can be implicitly made permanent in situations where file size is extended beyond a range of post-EOF blocks (i.e., via an extending truncate) or following a crash. In the event of a crash, the in-memory state used to track and reclaim the speculative preallocation is lost.&lt;br /&gt;
&lt;br /&gt;
== Q: My workload has known characteristics - can I disable speculative preallocation or tune it to an optimal fixed size? ==&lt;br /&gt;
&lt;br /&gt;
Speculative preallocation can not be disabled but XFS can be tuned to a fixed allocation size with the &#039;allocsize=&#039; mount option. Speculative preallocation is not dynamically resized when the allocsize mount option is set and thus the potential for fragmentation is increased. Use &#039;allocsize=64k&#039; to revert to the default XFS behavior prior to support for dynamic speculative preallocation.&lt;br /&gt;
&lt;br /&gt;
== Q: mount (or umount) takes minutes or even hours - what could be the reason ? ==&lt;br /&gt;
&lt;br /&gt;
In some cases xfs log (journal) can become quite big. For example if it accumulates many entries and doesn&#039;t get chance to apply these to disk (due to lockup, crash, hard reset etc). xfs will try to reapply these at mount (in dmesg: &amp;quot;Starting recovery (logdev: internal)&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
That process with big log to be reapplied can take very long time (minutes or even hours). Similar problem can happen with unmount taking hours when there are hundreds of thousands of dirty inode in memory that need to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
(http://oss.sgi.com/pipermail/xfs/2015-October/044457.html)&lt;br /&gt;
&lt;br /&gt;
== Q: Which I/O scheduler for XFS? ==&lt;br /&gt;
&lt;br /&gt;
=== On rotational disks without hardware raid ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;CFQ&#039;&#039;: not great for XFS parallelism:&lt;br /&gt;
&lt;br /&gt;
&amp;lt; dchinner&amp;gt; it doesn&#039;t allow other threads to get IO issued immediately after the first one&lt;br /&gt;
&amp;lt; dchinner&amp;gt; it waits, instead, for a timeslice to expire before moving to the IO of a different process.&lt;br /&gt;
&amp;lt; dchinner&amp;gt; so instead of interleaving the IO of multiple jobs in a single sweep across the disk, it enforces single threaded access to the disk&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;deadline&#039;&#039;: good option, doesn&#039;t have such problem&lt;br /&gt;
&lt;br /&gt;
Note that some kernels have block multiqueue enabled which (currently - 08/2016) doesn&#039;t support I/O schedulers at all thus there is no optimisation and reordering IO for best seek order, so disable blk-mq for rotational disks (see CONFIG_SCSI_MQ_DEFAULT, CONFIG_DM_MQ_DEFAULT options and use_blk_mq parameter for scsi-mod/dm-mod kernel modules).&lt;br /&gt;
&lt;br /&gt;
Also hardware raid can be smart enough to cache and reorder I/O requests thus additional layer of reordering&lt;br /&gt;
(like Linux I/O scheduler) can potentially conflict and make performance worse. If you have such raid card&lt;br /&gt;
then try method described below.&lt;br /&gt;
&lt;br /&gt;
=== SSD disks or rotational disks but with hardware raid card that has cache enabled ===&lt;br /&gt;
&lt;br /&gt;
Block multiqueue enabled (and thus no I/O scheduler at all) or block multiqueue disabled and noop or deadline I/O scheduler activated is good solution. SSD disks don&#039;t really need I/O schedulers while smart raid cards do I/O ordering on their own.&lt;br /&gt;
&lt;br /&gt;
Note that if your raid is very dumb and/or has no cache enabled then it likely cannot reorder I/O requests and thus it could benefit from I/O scheduler.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org:Terms_of_Service&amp;diff=2985</id>
		<title>Xfs.org:Terms of Service</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org:Terms_of_Service&amp;diff=2985"/>
		<updated>2015-12-22T02:26:28Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Created page with &amp;quot;Please be kind to all who enter. Share openly. Don&amp;#039;t spam anybody.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please be kind to all who enter.&lt;br /&gt;
Share openly.&lt;br /&gt;
Don&#039;t spam anybody.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2983</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2983"/>
		<updated>2015-12-13T08:32:48Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Other link also fixed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
What you need to report depend on the problem you are seeing. Firstly, your machine hardware and storage configuration needs to be described. That includes:&lt;br /&gt;
&lt;br /&gt;
* kernel version (uname -a)&lt;br /&gt;
* xfsprogs version (xfs_repair -V)&lt;br /&gt;
* number of CPUs&lt;br /&gt;
* contents of /proc/meminfo&lt;br /&gt;
* contents of /proc/mounts&lt;br /&gt;
* contents of /proc/partitions&lt;br /&gt;
* RAID layout (hardware and/or software)&lt;br /&gt;
* LVM configuration&lt;br /&gt;
* type of disks you are using&lt;br /&gt;
* write cache status of drives&lt;br /&gt;
* size of BBWC and mode it is running in&lt;br /&gt;
* xfs_info output on the filesystem in question&lt;br /&gt;
* dmesg output showing all error messages and stack traces&lt;br /&gt;
 &lt;br /&gt;
Then you need to describe your workload that is causing the problem, and a demonstration of the bad behaviour that is occurring. If it is a performance problem, then 30s - 1 minute samples of:&lt;br /&gt;
&lt;br /&gt;
# iostat -x -d -m 5&lt;br /&gt;
# vmstat 5&lt;br /&gt;
 &lt;br /&gt;
can give us insight into the IO and memory utilisation of your machine at the time of the problem.&lt;br /&gt;
&lt;br /&gt;
If the filesystem is hanging, then capture the output of the dmesg command after running:&lt;br /&gt;
&lt;br /&gt;
 # echo w &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
 # dmesg&lt;br /&gt;
&lt;br /&gt;
will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.&lt;br /&gt;
&lt;br /&gt;
And for advanced users, capturing an event trace using &#039;&#039;&#039;trace-cmd&#039;&#039;&#039; (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it&#039;s a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd record -e xfs\*&lt;br /&gt;
&lt;br /&gt;
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd report &amp;gt; trace_report.txt&lt;br /&gt;
&lt;br /&gt;
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039;, make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS.&lt;br /&gt;
&lt;br /&gt;
However, if an inode is unlinked but neither it nor its associated data blocks get immediately re-used and overwritten, there is some small chance to recover the file from the disk.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;photorec&#039;&#039;, &#039;&#039;xfs_irecover&#039;&#039; or &#039;&#039;xfsr&#039;&#039; are some tools which attempt to do this, with varying success.&lt;br /&gt;
&lt;br /&gt;
There are also commercial data recovery services and closed source software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS] which claims to recover data, although this has not been tested by the XFS developers.&lt;br /&gt;
&lt;br /&gt;
As always, the best advice is to keep good backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE) (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with &amp;quot;nobarrier&amp;quot;, assuming your RAID controller is infallible and not resetting randomly like some common ones do.  But take care about the hard disk write cache, which should be off.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery or flash backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. This battery backed cache should ensure that if power fails or a PSU dies, the contents of the cache will be written to disk on next boot. However, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents.&lt;br /&gt;
&lt;br /&gt;
If you do not have a battery or flash backed cache you should seriously consider disabling write cache if you value your data.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, this will disable the controller and disk cache (see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf, page 86); &lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
 MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL                          # flushes the controller cache&lt;br /&gt;
 MegaCli -LDGetProp -Cache    -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the controller cache settings&lt;br /&gt;
 MegaCli -LDGetProp -DskCache -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the disk cache settings (for all phys. disks in logical disk)&lt;br /&gt;
 MegaCli -LDSetProp -EnDskCache|DisDskCache  -LN|-L0,1,2|-LAll  -aN|-a0,1,2|-aALL # set disk cache setting&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039; should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/archives/xfs/2009-01/msg01023.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. This was an issue with the older &amp;quot;inode32&amp;quot; inode allocation mode, where inode allocation is restricted to lower filesysetm blocks.  To fix this, [http://oss.sgi.com/archives/xfs/2009-01/msg01031.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Alternately, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
However, &#039;inode64&#039; has been the default behavior since kernel v3.7...&lt;br /&gt;
&lt;br /&gt;
Unfortunately, v3.7 also added a bug present from kernel v3.7 to v3.17 which caused new allocation groups added by growfs to be unavailable for inode allocation.  This was fixed by commit &amp;lt;tt&amp;gt;[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9de67c3ba9ea961ba420573d56479d09d33a7587 9de67c3b xfs: allow inode allocations in post-growfs disk space.]&amp;lt;/tt&amp;gt; in kernel v3.17.&lt;br /&gt;
Without that commit, the problem can be worked around by doing a &amp;quot;mount -o remount,inode64&amp;quot; after the growfs operation.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Premature optimization is the root of all evil.&#039;&#039; - Donald Knuth&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;br /&gt;
&lt;br /&gt;
As of kernel 3.2.12, the default i/o scheduler, CFQ, will defeat much of the parallelization in XFS.&lt;br /&gt;
&lt;br /&gt;
== Q: Which factors influence the memory usage of xfs_repair? ==&lt;br /&gt;
&lt;br /&gt;
This is best explained with an example. The example filesystem is 16Tb, but basically empty (look at icount).&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -n -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 64, imem = 0, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2096.&lt;br /&gt;
  #&lt;br /&gt;
&lt;br /&gt;
xfs_repair is saying it needs at least 2096MB of RAM to repair the filesystem,&lt;br /&gt;
of which 2,097,152KB is needed for tracking free space. &lt;br /&gt;
(The -m 1 argument was telling xfs_repair to use ony 1 MB of memory.)&lt;br /&gt;
&lt;br /&gt;
Now if we add some inodes (50 million) to the filesystem (look at icount again), and the result is:&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 50401792, imem = 196882, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2289.&lt;br /&gt;
&lt;br /&gt;
That is now needs at least another 200MB of RAM to run.&lt;br /&gt;
&lt;br /&gt;
The numbers reported by xfs_repair are the absolute minimum required and approximate at that;&lt;br /&gt;
more RAM than this may be required to complete successfully.&lt;br /&gt;
Also, if you only give xfs_repair the minimum required RAM, it will be slow;&lt;br /&gt;
for best repair performance, the more RAM you can give it the better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why some files of my filesystem shows as &amp;quot;?????????? ? ?      ?          ?                ? filename&amp;quot; ? ==&lt;br /&gt;
&lt;br /&gt;
If ls -l shows you a listing as&lt;br /&gt;
&lt;br /&gt;
  # ?????????? ? ?      ?          ?                ? file1&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file2&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file3&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file4&lt;br /&gt;
&lt;br /&gt;
and errors like:&lt;br /&gt;
  # ls /pathtodir/&lt;br /&gt;
    ls: cannot access /pathtodir/file1: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file2: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file3: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file4: Invalid argument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or even:&lt;br /&gt;
  # failed to stat /pathtodir/file1&lt;br /&gt;
&lt;br /&gt;
It is very probable your filesystem must be mounted with inode64&lt;br /&gt;
  # mount -oremount,inode64 /dev/diskpart /mnt/xfs&lt;br /&gt;
&lt;br /&gt;
should make it work ok again.&lt;br /&gt;
If it works, add the option to fstab.&lt;br /&gt;
&lt;br /&gt;
== Q: The xfs_db &amp;quot;frag&amp;quot; command says I&#039;m over 50%.  Is that bad? ==&lt;br /&gt;
&lt;br /&gt;
It depends.  It&#039;s important to know how the value is calculated.  xfs_db looks at the extents in all files, and returns:&lt;br /&gt;
&lt;br /&gt;
  (actual extents - ideal extents) / actual extents&lt;br /&gt;
&lt;br /&gt;
This means that if, for example, you have an average of 2 extents per file, you&#039;ll get an answer of 50%.  4 extents per file would give you 75%.  This may or may not be a problem, especially depending on the size of the files in question.  (i.e. 400GB files in four 100GB extents would hardly be considered badly fragmented).  The xfs_bmap command can be useful for displaying the actual fragmentation/layout of individual files.&lt;br /&gt;
&lt;br /&gt;
Note that above a few average extents per file, the fragmentation factor rapidly approaches 100%:&lt;br /&gt;
[[Image:Frag_factor.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Q: I&#039;m getting &amp;quot;Internal error xfs_sb_read_verify&amp;quot; errors when I try to run xfs_growfs under kernels v3.10 through v3.12 ==&lt;br /&gt;
&lt;br /&gt;
This may happen when running xfs_growfs under a v3.10-v3.12 kernel,&lt;br /&gt;
if the filesystem was previously grown under a kernel prior to v3.8.&lt;br /&gt;
&lt;br /&gt;
Old kernel versions prior to v3.8 did not zero the empty part of&lt;br /&gt;
new secondary superblocks when growing the filesystem with xfs_growfs.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.10 and later began detecting this non-zero part of the&lt;br /&gt;
superblock as corruption, and emit the &lt;br /&gt;
&lt;br /&gt;
    Internal error xfs_sb_read_verify&lt;br /&gt;
&lt;br /&gt;
error message.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.13 and later are more forgiving about this - if the non-zero &lt;br /&gt;
data is found on a Version 4 superblock, it will not be flagged as&lt;br /&gt;
corruption.&lt;br /&gt;
&lt;br /&gt;
The problematic secondary superblocks may be repaired by using an xfs_repair&lt;br /&gt;
version 3.2.0-alpha1 or above.&lt;br /&gt;
&lt;br /&gt;
The relevant kernelspace commits are as follows:&lt;br /&gt;
&lt;br /&gt;
    v3.8  1375cb6 xfs: growfs: don&#039;t read garbage for new secondary superblocks &amp;lt;- fixed underlying problem &lt;br /&gt;
    v3.10 04a1e6c xfs: add CRC checks to the superblock &amp;lt;- detected old underlying problem&lt;br /&gt;
    v3.13 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields &amp;lt;- is more forgiving of old underlying problem&lt;br /&gt;
&lt;br /&gt;
This commit allows xfs_repair to detect and correct the problem:&lt;br /&gt;
&lt;br /&gt;
    v3.2.0-alpha1 cbd7508 xfs_repair: zero out unused parts of superblocks&lt;br /&gt;
&lt;br /&gt;
== Q: Why do files on XFS use more data blocks than expected? ==&lt;br /&gt;
&lt;br /&gt;
The XFS speculative preallocation algorithm allocates extra blocks beyond end of file (EOF) to minimize file fragmentation during buffered write workloads. Workloads that benefit from this behaviour include slowly growing files, concurrent writers and mixed reader/writer workloads. It also provides fragmentation resistance in situations where memory pressure prevents adequate buffering of dirty data to allow formation of large contiguous regions of data in memory.&lt;br /&gt;
&lt;br /&gt;
This post-EOF block allocation is accounted identically to blocks within EOF. It is visible in &#039;st_blocks&#039; counts via stat() system calls, accounted as globally allocated space and against quotas that apply to the associated file. The space is reported by various userspace utilities (stat, du, df, ls) and thus provides a common source of confusion for administrators. Post-EOF blocks are temporary in most situations and are usually reclaimed via several possible mechanisms in XFS.&lt;br /&gt;
&lt;br /&gt;
See the FAQ entry on speculative preallocation for details.&lt;br /&gt;
&lt;br /&gt;
== Q: What is speculative preallocation? ==&lt;br /&gt;
&lt;br /&gt;
XFS speculatively preallocates post-EOF blocks on file extending writes in anticipation of future extending writes. The size of a preallocation is dynamic and depends on the runtime state of the file and fs. Generally speaking, preallocation is disabled for very small files and preallocation sizes grow as files grow larger.&lt;br /&gt;
&lt;br /&gt;
Preallocations are capped to the maximum extent size supported by the filesystem. Preallocation size is throttled automatically as the filesystem approaches low free space conditions or other allocation limits on a file (such as a quota).&lt;br /&gt;
&lt;br /&gt;
In most cases, speculative preallocation is automatically reclaimed when a file is closed. Applications that repeatedly trigger preallocation and reclaim cycles (e.g., this is common in file server or log file workloads) can cause fragmentation. Therefore, this pattern is detected and causes the preallocation to persist beyond the lifecycle of the file descriptor.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I speed up or avoid delayed removal of speculative preallocation?  ==&lt;br /&gt;
&lt;br /&gt;
Linux 3.8 (and later) includes a scanner to perform background trimming of files with lingering post-EOF preallocations. The scanner bypasses dirty files to avoid interference with ongoing writes. A 5 minute scan interval is used by default and can be adjusted via the following file (value in seconds):&lt;br /&gt;
&lt;br /&gt;
        /proc/sys/fs/xfs/speculative_prealloc_lifetime&lt;br /&gt;
&lt;br /&gt;
== Q: Is speculative preallocation permanent? ==&lt;br /&gt;
&lt;br /&gt;
Preallocated blocks are normally reclaimed on file close, inode reclaim, unmount or in the background once file write activity subsides. They can be explicitly made permanent via fallocate or a similar interface. They can be implicitly made permanent in situations where file size is extended beyond a range of post-EOF blocks (i.e., via an extending truncate) or following a crash. In the event of a crash, the in-memory state used to track and reclaim the speculative preallocation is lost.&lt;br /&gt;
&lt;br /&gt;
== Q: My workload has known characteristics - can I disable speculative preallocation or tune it to an optimal fixed size? ==&lt;br /&gt;
&lt;br /&gt;
Speculative preallocation can not be disabled but XFS can be tuned to a fixed allocation size with the &#039;allocsize=&#039; mount option. Speculative preallocation is not dynamically resized when the allocsize mount option is set and thus the potential for fragmentation is increased. Use &#039;allocsize=64k&#039; to revert to the default XFS behavior prior to support for dynamic speculative preallocation.&lt;br /&gt;
&lt;br /&gt;
== Q: mount (or umount) takes minutes or even hours - what could be the reason ? ==&lt;br /&gt;
&lt;br /&gt;
In some cases xfs log (journal) can become quite big. For example if it accumulates many entries and doesn&#039;t get chance to apply these to disk (due to lockup, crash, hard reset etc). xfs will try to reapply these at mount (in dmesg: &amp;quot;Starting recovery (logdev: internal)&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
That process with big log to be reapplied can take very long time (minutes or even hours). Similar problem can happen with unmount taking hours when there are hundreds of thousands of dirty inode in memory that need to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
(http://oss.sgi.com/pipermail/xfs/2015-October/044457.html)&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2982</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2982"/>
		<updated>2015-12-13T08:18:18Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Fix url&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
What you need to report depend on the problem you are seeing. Firstly, your machine hardware and storage configuration needs to be described. That includes:&lt;br /&gt;
&lt;br /&gt;
* kernel version (uname -a)&lt;br /&gt;
* xfsprogs version (xfs_repair -V)&lt;br /&gt;
* number of CPUs&lt;br /&gt;
* contents of /proc/meminfo&lt;br /&gt;
* contents of /proc/mounts&lt;br /&gt;
* contents of /proc/partitions&lt;br /&gt;
* RAID layout (hardware and/or software)&lt;br /&gt;
* LVM configuration&lt;br /&gt;
* type of disks you are using&lt;br /&gt;
* write cache status of drives&lt;br /&gt;
* size of BBWC and mode it is running in&lt;br /&gt;
* xfs_info output on the filesystem in question&lt;br /&gt;
* dmesg output showing all error messages and stack traces&lt;br /&gt;
 &lt;br /&gt;
Then you need to describe your workload that is causing the problem, and a demonstration of the bad behaviour that is occurring. If it is a performance problem, then 30s - 1 minute samples of:&lt;br /&gt;
&lt;br /&gt;
# iostat -x -d -m 5&lt;br /&gt;
# vmstat 5&lt;br /&gt;
 &lt;br /&gt;
can give us insight into the IO and memory utilisation of your machine at the time of the problem.&lt;br /&gt;
&lt;br /&gt;
If the filesystem is hanging, then capture the output of the dmesg command after running:&lt;br /&gt;
&lt;br /&gt;
 # echo w &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
 # dmesg&lt;br /&gt;
&lt;br /&gt;
will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.&lt;br /&gt;
&lt;br /&gt;
And for advanced users, capturing an event trace using &#039;&#039;&#039;trace-cmd&#039;&#039;&#039; (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it&#039;s a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd record -e xfs\*&lt;br /&gt;
&lt;br /&gt;
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd report &amp;gt; trace_report.txt&lt;br /&gt;
&lt;br /&gt;
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039;, make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS.&lt;br /&gt;
&lt;br /&gt;
However, if an inode is unlinked but neither it nor its associated data blocks get immediately re-used and overwritten, there is some small chance to recover the file from the disk.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;photorec&#039;&#039;, &#039;&#039;xfs_irecover&#039;&#039; or &#039;&#039;xfsr&#039;&#039; are some tools which attempt to do this, with varying success.&lt;br /&gt;
&lt;br /&gt;
There are also commercial data recovery services and closed source software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS] which claims to recover data, although this has not been tested by the XFS developers.&lt;br /&gt;
&lt;br /&gt;
As always, the best advice is to keep good backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE) (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with &amp;quot;nobarrier&amp;quot;, assuming your RAID controller is infallible and not resetting randomly like some common ones do.  But take care about the hard disk write cache, which should be off.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery or flash backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. This battery backed cache should ensure that if power fails or a PSU dies, the contents of the cache will be written to disk on next boot. However, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents.&lt;br /&gt;
&lt;br /&gt;
If you do not have a battery or flash backed cache you should seriously consider disabling write cache if you value your data.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, this will disable the controller and disk cache (see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf, page 86); &lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
 MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL                          # flushes the controller cache&lt;br /&gt;
 MegaCli -LDGetProp -Cache    -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the controller cache settings&lt;br /&gt;
 MegaCli -LDGetProp -DskCache -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the disk cache settings (for all phys. disks in logical disk)&lt;br /&gt;
 MegaCli -LDSetProp -EnDskCache|DisDskCache  -LN|-L0,1,2|-LAll  -aN|-a0,1,2|-aALL # set disk cache setting&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039; should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/pipermail/xfs/2009-January/039828.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. This was an issue with the older &amp;quot;inode32&amp;quot; inode allocation mode, where inode allocation is restricted to lower filesysetm blocks.  To fix this, [http://oss.sgi.com/archives/xfs/2009-01/msg01031.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Alternately, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
However, &#039;inode64&#039; has been the default behavior since kernel v3.7...&lt;br /&gt;
&lt;br /&gt;
Unfortunately, v3.7 also added a bug present from kernel v3.7 to v3.17 which caused new allocation groups added by growfs to be unavailable for inode allocation.  This was fixed by commit &amp;lt;tt&amp;gt;[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9de67c3ba9ea961ba420573d56479d09d33a7587 9de67c3b xfs: allow inode allocations in post-growfs disk space.]&amp;lt;/tt&amp;gt; in kernel v3.17.&lt;br /&gt;
Without that commit, the problem can be worked around by doing a &amp;quot;mount -o remount,inode64&amp;quot; after the growfs operation.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Premature optimization is the root of all evil.&#039;&#039; - Donald Knuth&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;br /&gt;
&lt;br /&gt;
As of kernel 3.2.12, the default i/o scheduler, CFQ, will defeat much of the parallelization in XFS.&lt;br /&gt;
&lt;br /&gt;
== Q: Which factors influence the memory usage of xfs_repair? ==&lt;br /&gt;
&lt;br /&gt;
This is best explained with an example. The example filesystem is 16Tb, but basically empty (look at icount).&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -n -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 64, imem = 0, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2096.&lt;br /&gt;
  #&lt;br /&gt;
&lt;br /&gt;
xfs_repair is saying it needs at least 2096MB of RAM to repair the filesystem,&lt;br /&gt;
of which 2,097,152KB is needed for tracking free space. &lt;br /&gt;
(The -m 1 argument was telling xfs_repair to use ony 1 MB of memory.)&lt;br /&gt;
&lt;br /&gt;
Now if we add some inodes (50 million) to the filesystem (look at icount again), and the result is:&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 50401792, imem = 196882, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2289.&lt;br /&gt;
&lt;br /&gt;
That is now needs at least another 200MB of RAM to run.&lt;br /&gt;
&lt;br /&gt;
The numbers reported by xfs_repair are the absolute minimum required and approximate at that;&lt;br /&gt;
more RAM than this may be required to complete successfully.&lt;br /&gt;
Also, if you only give xfs_repair the minimum required RAM, it will be slow;&lt;br /&gt;
for best repair performance, the more RAM you can give it the better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why some files of my filesystem shows as &amp;quot;?????????? ? ?      ?          ?                ? filename&amp;quot; ? ==&lt;br /&gt;
&lt;br /&gt;
If ls -l shows you a listing as&lt;br /&gt;
&lt;br /&gt;
  # ?????????? ? ?      ?          ?                ? file1&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file2&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file3&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file4&lt;br /&gt;
&lt;br /&gt;
and errors like:&lt;br /&gt;
  # ls /pathtodir/&lt;br /&gt;
    ls: cannot access /pathtodir/file1: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file2: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file3: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file4: Invalid argument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or even:&lt;br /&gt;
  # failed to stat /pathtodir/file1&lt;br /&gt;
&lt;br /&gt;
It is very probable your filesystem must be mounted with inode64&lt;br /&gt;
  # mount -oremount,inode64 /dev/diskpart /mnt/xfs&lt;br /&gt;
&lt;br /&gt;
should make it work ok again.&lt;br /&gt;
If it works, add the option to fstab.&lt;br /&gt;
&lt;br /&gt;
== Q: The xfs_db &amp;quot;frag&amp;quot; command says I&#039;m over 50%.  Is that bad? ==&lt;br /&gt;
&lt;br /&gt;
It depends.  It&#039;s important to know how the value is calculated.  xfs_db looks at the extents in all files, and returns:&lt;br /&gt;
&lt;br /&gt;
  (actual extents - ideal extents) / actual extents&lt;br /&gt;
&lt;br /&gt;
This means that if, for example, you have an average of 2 extents per file, you&#039;ll get an answer of 50%.  4 extents per file would give you 75%.  This may or may not be a problem, especially depending on the size of the files in question.  (i.e. 400GB files in four 100GB extents would hardly be considered badly fragmented).  The xfs_bmap command can be useful for displaying the actual fragmentation/layout of individual files.&lt;br /&gt;
&lt;br /&gt;
Note that above a few average extents per file, the fragmentation factor rapidly approaches 100%:&lt;br /&gt;
[[Image:Frag_factor.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Q: I&#039;m getting &amp;quot;Internal error xfs_sb_read_verify&amp;quot; errors when I try to run xfs_growfs under kernels v3.10 through v3.12 ==&lt;br /&gt;
&lt;br /&gt;
This may happen when running xfs_growfs under a v3.10-v3.12 kernel,&lt;br /&gt;
if the filesystem was previously grown under a kernel prior to v3.8.&lt;br /&gt;
&lt;br /&gt;
Old kernel versions prior to v3.8 did not zero the empty part of&lt;br /&gt;
new secondary superblocks when growing the filesystem with xfs_growfs.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.10 and later began detecting this non-zero part of the&lt;br /&gt;
superblock as corruption, and emit the &lt;br /&gt;
&lt;br /&gt;
    Internal error xfs_sb_read_verify&lt;br /&gt;
&lt;br /&gt;
error message.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.13 and later are more forgiving about this - if the non-zero &lt;br /&gt;
data is found on a Version 4 superblock, it will not be flagged as&lt;br /&gt;
corruption.&lt;br /&gt;
&lt;br /&gt;
The problematic secondary superblocks may be repaired by using an xfs_repair&lt;br /&gt;
version 3.2.0-alpha1 or above.&lt;br /&gt;
&lt;br /&gt;
The relevant kernelspace commits are as follows:&lt;br /&gt;
&lt;br /&gt;
    v3.8  1375cb6 xfs: growfs: don&#039;t read garbage for new secondary superblocks &amp;lt;- fixed underlying problem &lt;br /&gt;
    v3.10 04a1e6c xfs: add CRC checks to the superblock &amp;lt;- detected old underlying problem&lt;br /&gt;
    v3.13 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields &amp;lt;- is more forgiving of old underlying problem&lt;br /&gt;
&lt;br /&gt;
This commit allows xfs_repair to detect and correct the problem:&lt;br /&gt;
&lt;br /&gt;
    v3.2.0-alpha1 cbd7508 xfs_repair: zero out unused parts of superblocks&lt;br /&gt;
&lt;br /&gt;
== Q: Why do files on XFS use more data blocks than expected? ==&lt;br /&gt;
&lt;br /&gt;
The XFS speculative preallocation algorithm allocates extra blocks beyond end of file (EOF) to minimize file fragmentation during buffered write workloads. Workloads that benefit from this behaviour include slowly growing files, concurrent writers and mixed reader/writer workloads. It also provides fragmentation resistance in situations where memory pressure prevents adequate buffering of dirty data to allow formation of large contiguous regions of data in memory.&lt;br /&gt;
&lt;br /&gt;
This post-EOF block allocation is accounted identically to blocks within EOF. It is visible in &#039;st_blocks&#039; counts via stat() system calls, accounted as globally allocated space and against quotas that apply to the associated file. The space is reported by various userspace utilities (stat, du, df, ls) and thus provides a common source of confusion for administrators. Post-EOF blocks are temporary in most situations and are usually reclaimed via several possible mechanisms in XFS.&lt;br /&gt;
&lt;br /&gt;
See the FAQ entry on speculative preallocation for details.&lt;br /&gt;
&lt;br /&gt;
== Q: What is speculative preallocation? ==&lt;br /&gt;
&lt;br /&gt;
XFS speculatively preallocates post-EOF blocks on file extending writes in anticipation of future extending writes. The size of a preallocation is dynamic and depends on the runtime state of the file and fs. Generally speaking, preallocation is disabled for very small files and preallocation sizes grow as files grow larger.&lt;br /&gt;
&lt;br /&gt;
Preallocations are capped to the maximum extent size supported by the filesystem. Preallocation size is throttled automatically as the filesystem approaches low free space conditions or other allocation limits on a file (such as a quota).&lt;br /&gt;
&lt;br /&gt;
In most cases, speculative preallocation is automatically reclaimed when a file is closed. Applications that repeatedly trigger preallocation and reclaim cycles (e.g., this is common in file server or log file workloads) can cause fragmentation. Therefore, this pattern is detected and causes the preallocation to persist beyond the lifecycle of the file descriptor.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I speed up or avoid delayed removal of speculative preallocation?  ==&lt;br /&gt;
&lt;br /&gt;
Linux 3.8 (and later) includes a scanner to perform background trimming of files with lingering post-EOF preallocations. The scanner bypasses dirty files to avoid interference with ongoing writes. A 5 minute scan interval is used by default and can be adjusted via the following file (value in seconds):&lt;br /&gt;
&lt;br /&gt;
        /proc/sys/fs/xfs/speculative_prealloc_lifetime&lt;br /&gt;
&lt;br /&gt;
== Q: Is speculative preallocation permanent? ==&lt;br /&gt;
&lt;br /&gt;
Preallocated blocks are normally reclaimed on file close, inode reclaim, unmount or in the background once file write activity subsides. They can be explicitly made permanent via fallocate or a similar interface. They can be implicitly made permanent in situations where file size is extended beyond a range of post-EOF blocks (i.e., via an extending truncate) or following a crash. In the event of a crash, the in-memory state used to track and reclaim the speculative preallocation is lost.&lt;br /&gt;
&lt;br /&gt;
== Q: My workload has known characteristics - can I disable speculative preallocation or tune it to an optimal fixed size? ==&lt;br /&gt;
&lt;br /&gt;
Speculative preallocation can not be disabled but XFS can be tuned to a fixed allocation size with the &#039;allocsize=&#039; mount option. Speculative preallocation is not dynamically resized when the allocsize mount option is set and thus the potential for fragmentation is increased. Use &#039;allocsize=64k&#039; to revert to the default XFS behavior prior to support for dynamic speculative preallocation.&lt;br /&gt;
&lt;br /&gt;
== Q: mount (or umount) takes minutes or even hours - what could be the reason ? ==&lt;br /&gt;
&lt;br /&gt;
In some cases xfs log (journal) can become quite big. For example if it accumulates many entries and doesn&#039;t get chance to apply these to disk (due to lockup, crash, hard reset etc). xfs will try to reapply these at mount (in dmesg: &amp;quot;Starting recovery (logdev: internal)&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
That process with big log to be reapplied can take very long time (minutes or even hours). Similar problem can happen with unmount taking hours when there are hundreds of thousands of dirty inode in memory that need to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
(http://oss.sgi.com/pipermail/xfs/2015-October/044457.html)&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2981</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2981"/>
		<updated>2015-10-23T07:33:03Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: long mount/umount&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
What you need to report depend on the problem you are seeing. Firstly, your machine hardware and storage configuration needs to be described. That includes:&lt;br /&gt;
&lt;br /&gt;
* kernel version (uname -a)&lt;br /&gt;
* xfsprogs version (xfs_repair -V)&lt;br /&gt;
* number of CPUs&lt;br /&gt;
* contents of /proc/meminfo&lt;br /&gt;
* contents of /proc/mounts&lt;br /&gt;
* contents of /proc/partitions&lt;br /&gt;
* RAID layout (hardware and/or software)&lt;br /&gt;
* LVM configuration&lt;br /&gt;
* type of disks you are using&lt;br /&gt;
* write cache status of drives&lt;br /&gt;
* size of BBWC and mode it is running in&lt;br /&gt;
* xfs_info output on the filesystem in question&lt;br /&gt;
* dmesg output showing all error messages and stack traces&lt;br /&gt;
 &lt;br /&gt;
Then you need to describe your workload that is causing the problem, and a demonstration of the bad behaviour that is occurring. If it is a performance problem, then 30s - 1 minute samples of:&lt;br /&gt;
&lt;br /&gt;
# iostat -x -d -m 5&lt;br /&gt;
# vmstat 5&lt;br /&gt;
 &lt;br /&gt;
can give us insight into the IO and memory utilisation of your machine at the time of the problem.&lt;br /&gt;
&lt;br /&gt;
If the filesystem is hanging, then capture the output of the dmesg command after running:&lt;br /&gt;
&lt;br /&gt;
 # echo w &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
 # dmesg&lt;br /&gt;
&lt;br /&gt;
will tell us all the hung processes in the machine, often pointing us directly to the cause of the hang.&lt;br /&gt;
&lt;br /&gt;
And for advanced users, capturing an event trace using &#039;&#039;&#039;trace-cmd&#039;&#039;&#039; (git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git) will be very helpful. In many cases the XFS developers will ask for this information anyway, so it&#039;s a good idea to be ready with it in advance. Start the trace with this command, either from a directory not on an XFS filesystem or with an output file destination on a non-XFS filesystem:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd record -e xfs\*&lt;br /&gt;
&lt;br /&gt;
before the problem occurs, and once it has occurred, kill the trace-cmd with ctrl-C, and then run:&lt;br /&gt;
&lt;br /&gt;
 # trace-cmd report &amp;gt; trace_report.txt&lt;br /&gt;
&lt;br /&gt;
Compress the trace_report.txt file and include that with the bug report. The reason for trying to host the output of the record command on a different filesystem is so that the writing of the output file does not pollute the trace of the problem we are trying to diagnose.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039;, make sure that you save the entire output of the problematic run so that the developers can see exactly where it encountered the problem. You might be asked to capture the metadata in the filesystem using &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS.&lt;br /&gt;
&lt;br /&gt;
However, if an inode is unlinked but neither it nor its associated data blocks get immediately re-used and overwritten, there is some small chance to recover the file from the disk.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;photorec&#039;&#039;, &#039;&#039;xfs_irecover&#039;&#039; or &#039;&#039;xfsr&#039;&#039; are some tools which attempt to do this, with varying success.&lt;br /&gt;
&lt;br /&gt;
There are also commercial data recovery services and closed source software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS] which claims to recover data, although this has not been tested by the XFS developers.&lt;br /&gt;
&lt;br /&gt;
As always, the best advice is to keep good backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE) (for SATA this requires at least kernel 2.6.15 because [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b095518ef51c37658c58367bd19240b8a113f25c ATA command passthrough support]):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with &amp;quot;nobarrier&amp;quot;, assuming your RAID controller is infallible and not resetting randomly like some common ones do.  But take care about the hard disk write cache, which should be off.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery or flash backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. This battery backed cache should ensure that if power fails or a PSU dies, the contents of the cache will be written to disk on next boot. However, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents.&lt;br /&gt;
&lt;br /&gt;
If you do not have a battery or flash backed cache you should seriously consider disabling write cache if you value your data.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, this will disable the controller and disk cache (see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf, page 86); &lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
 MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL                          # flushes the controller cache&lt;br /&gt;
 MegaCli -LDGetProp -Cache    -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the controller cache settings&lt;br /&gt;
 MegaCli -LDGetProp -DskCache -LN|-L0,1,2|-LAll -aN|-a0,1,2|-aALL  # shows the disk cache settings (for all phys. disks in logical disk)&lt;br /&gt;
 MegaCli -LDSetProp -EnDskCache|DisDskCache  -LN|-L0,1,2|-LAll  -aN|-a0,1,2|-aALL # set disk cache setting&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039; should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/pipermail/xfs/2009-January/039828.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. This was an issue with the older &amp;quot;inode32&amp;quot; inode allocation mode, where inode allocation is restricted to lower filesysetm blocks.  To fix this, [http://oss.sgi.com/pipermail/xfs/2009-January/039835.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Alternately, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
However, &#039;inode64&#039; has been the default behavior since kernel v3.7...&lt;br /&gt;
&lt;br /&gt;
Unfortunately, v3.7 also added a bug present from kernel v3.7 to v3.17 which caused new allocation groups added by growfs to be unavailable for inode allocation.  This was fixed by commit &amp;lt;tt&amp;gt;[http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9de67c3ba9ea961ba420573d56479d09d33a7587 9de67c3b xfs: allow inode allocations in post-growfs disk space.]&amp;lt;/tt&amp;gt; in kernel v3.17.&lt;br /&gt;
Without that commit, the problem can be worked around by doing a &amp;quot;mount -o remount,inode64&amp;quot; after the growfs operation.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Premature optimization is the root of all evil.&#039;&#039; - Donald Knuth&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;br /&gt;
&lt;br /&gt;
As of kernel 3.2.12, the default i/o scheduler, CFQ, will defeat much of the parallelization in XFS.&lt;br /&gt;
&lt;br /&gt;
== Q: Which factors influence the memory usage of xfs_repair? ==&lt;br /&gt;
&lt;br /&gt;
This is best explained with an example. The example filesystem is 16Tb, but basically empty (look at icount).&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -n -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 64, imem = 0, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2096.&lt;br /&gt;
  #&lt;br /&gt;
&lt;br /&gt;
xfs_repair is saying it needs at least 2096MB of RAM to repair the filesystem,&lt;br /&gt;
of which 2,097,152KB is needed for tracking free space. &lt;br /&gt;
(The -m 1 argument was telling xfs_repair to use ony 1 MB of memory.)&lt;br /&gt;
&lt;br /&gt;
Now if we add some inodes (50 million) to the filesystem (look at icount again), and the result is:&lt;br /&gt;
&lt;br /&gt;
  # xfs_repair -vv -m 1 /dev/vda&lt;br /&gt;
  Phase 1 - find and verify superblock...&lt;br /&gt;
          - max_mem = 1024, icount = 50401792, imem = 196882, dblock = 4294967296, dmem = 2097152&lt;br /&gt;
  Required memory for repair is greater that the maximum specified&lt;br /&gt;
  with the -m option. Please increase it to at least 2289.&lt;br /&gt;
&lt;br /&gt;
That is now needs at least another 200MB of RAM to run.&lt;br /&gt;
&lt;br /&gt;
The numbers reported by xfs_repair are the absolute minimum required and approximate at that;&lt;br /&gt;
more RAM than this may be required to complete successfully.&lt;br /&gt;
Also, if you only give xfs_repair the minimum required RAM, it will be slow;&lt;br /&gt;
for best repair performance, the more RAM you can give it the better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why some files of my filesystem shows as &amp;quot;?????????? ? ?      ?          ?                ? filename&amp;quot; ? ==&lt;br /&gt;
&lt;br /&gt;
If ls -l shows you a listing as&lt;br /&gt;
&lt;br /&gt;
  # ?????????? ? ?      ?          ?                ? file1&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file2&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file3&lt;br /&gt;
    ?????????? ? ?      ?          ?                ? file4&lt;br /&gt;
&lt;br /&gt;
and errors like:&lt;br /&gt;
  # ls /pathtodir/&lt;br /&gt;
    ls: cannot access /pathtodir/file1: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file2: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file3: Invalid argument&lt;br /&gt;
    ls: cannot access /pathtodir/file4: Invalid argument&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
or even:&lt;br /&gt;
  # failed to stat /pathtodir/file1&lt;br /&gt;
&lt;br /&gt;
It is very probable your filesystem must be mounted with inode64&lt;br /&gt;
  # mount -oremount,inode64 /dev/diskpart /mnt/xfs&lt;br /&gt;
&lt;br /&gt;
should make it work ok again.&lt;br /&gt;
If it works, add the option to fstab.&lt;br /&gt;
&lt;br /&gt;
== Q: The xfs_db &amp;quot;frag&amp;quot; command says I&#039;m over 50%.  Is that bad? ==&lt;br /&gt;
&lt;br /&gt;
It depends.  It&#039;s important to know how the value is calculated.  xfs_db looks at the extents in all files, and returns:&lt;br /&gt;
&lt;br /&gt;
  (actual extents - ideal extents) / actual extents&lt;br /&gt;
&lt;br /&gt;
This means that if, for example, you have an average of 2 extents per file, you&#039;ll get an answer of 50%.  4 extents per file would give you 75%.  This may or may not be a problem, especially depending on the size of the files in question.  (i.e. 400GB files in four 100GB extents would hardly be considered badly fragmented).  The xfs_bmap command can be useful for displaying the actual fragmentation/layout of individual files.&lt;br /&gt;
&lt;br /&gt;
Note that above a few average extents per file, the fragmentation factor rapidly approaches 100%:&lt;br /&gt;
[[Image:Frag_factor.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== Q: I&#039;m getting &amp;quot;Internal error xfs_sb_read_verify&amp;quot; errors when I try to run xfs_growfs under kernels v3.10 through v3.12 ==&lt;br /&gt;
&lt;br /&gt;
This may happen when running xfs_growfs under a v3.10-v3.12 kernel,&lt;br /&gt;
if the filesystem was previously grown under a kernel prior to v3.8.&lt;br /&gt;
&lt;br /&gt;
Old kernel versions prior to v3.8 did not zero the empty part of&lt;br /&gt;
new secondary superblocks when growing the filesystem with xfs_growfs.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.10 and later began detecting this non-zero part of the&lt;br /&gt;
superblock as corruption, and emit the &lt;br /&gt;
&lt;br /&gt;
    Internal error xfs_sb_read_verify&lt;br /&gt;
&lt;br /&gt;
error message.&lt;br /&gt;
&lt;br /&gt;
Kernels v3.13 and later are more forgiving about this - if the non-zero &lt;br /&gt;
data is found on a Version 4 superblock, it will not be flagged as&lt;br /&gt;
corruption.&lt;br /&gt;
&lt;br /&gt;
The problematic secondary superblocks may be repaired by using an xfs_repair&lt;br /&gt;
version 3.2.0-alpha1 or above.&lt;br /&gt;
&lt;br /&gt;
The relevant kernelspace commits are as follows:&lt;br /&gt;
&lt;br /&gt;
    v3.8  1375cb6 xfs: growfs: don&#039;t read garbage for new secondary superblocks &amp;lt;- fixed underlying problem &lt;br /&gt;
    v3.10 04a1e6c xfs: add CRC checks to the superblock &amp;lt;- detected old underlying problem&lt;br /&gt;
    v3.13 10e6e65 xfs: be more forgiving of a v4 secondary sb w/ junk in v5 fields &amp;lt;- is more forgiving of old underlying problem&lt;br /&gt;
&lt;br /&gt;
This commit allows xfs_repair to detect and correct the problem:&lt;br /&gt;
&lt;br /&gt;
    v3.2.0-alpha1 cbd7508 xfs_repair: zero out unused parts of superblocks&lt;br /&gt;
&lt;br /&gt;
== Q: Why do files on XFS use more data blocks than expected? ==&lt;br /&gt;
&lt;br /&gt;
The XFS speculative preallocation algorithm allocates extra blocks beyond end of file (EOF) to minimize file fragmentation during buffered write workloads. Workloads that benefit from this behaviour include slowly growing files, concurrent writers and mixed reader/writer workloads. It also provides fragmentation resistance in situations where memory pressure prevents adequate buffering of dirty data to allow formation of large contiguous regions of data in memory.&lt;br /&gt;
&lt;br /&gt;
This post-EOF block allocation is accounted identically to blocks within EOF. It is visible in &#039;st_blocks&#039; counts via stat() system calls, accounted as globally allocated space and against quotas that apply to the associated file. The space is reported by various userspace utilities (stat, du, df, ls) and thus provides a common source of confusion for administrators. Post-EOF blocks are temporary in most situations and are usually reclaimed via several possible mechanisms in XFS.&lt;br /&gt;
&lt;br /&gt;
See the FAQ entry on speculative preallocation for details.&lt;br /&gt;
&lt;br /&gt;
== Q: What is speculative preallocation? ==&lt;br /&gt;
&lt;br /&gt;
XFS speculatively preallocates post-EOF blocks on file extending writes in anticipation of future extending writes. The size of a preallocation is dynamic and depends on the runtime state of the file and fs. Generally speaking, preallocation is disabled for very small files and preallocation sizes grow as files grow larger.&lt;br /&gt;
&lt;br /&gt;
Preallocations are capped to the maximum extent size supported by the filesystem. Preallocation size is throttled automatically as the filesystem approaches low free space conditions or other allocation limits on a file (such as a quota).&lt;br /&gt;
&lt;br /&gt;
In most cases, speculative preallocation is automatically reclaimed when a file is closed. Applications that repeatedly trigger preallocation and reclaim cycles (e.g., this is common in file server or log file workloads) can cause fragmentation. Therefore, this pattern is detected and causes the preallocation to persist beyond the lifecycle of the file descriptor.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I speed up or avoid delayed removal of speculative preallocation?  ==&lt;br /&gt;
&lt;br /&gt;
Linux 3.8 (and later) includes a scanner to perform background trimming of files with lingering post-EOF preallocations. The scanner bypasses dirty files to avoid interference with ongoing writes. A 5 minute scan interval is used by default and can be adjusted via the following file (value in seconds):&lt;br /&gt;
&lt;br /&gt;
        /proc/sys/fs/xfs/speculative_prealloc_lifetime&lt;br /&gt;
&lt;br /&gt;
== Q: Is speculative preallocation permanent? ==&lt;br /&gt;
&lt;br /&gt;
Preallocated blocks are normally reclaimed on file close, inode reclaim, unmount or in the background once file write activity subsides. They can be explicitly made permanent via fallocate or a similar interface. They can be implicitly made permanent in situations where file size is extended beyond a range of post-EOF blocks (i.e., via an extending truncate) or following a crash. In the event of a crash, the in-memory state used to track and reclaim the speculative preallocation is lost.&lt;br /&gt;
&lt;br /&gt;
== Q: My workload has known characteristics - can I disable speculative preallocation or tune it to an optimal fixed size? ==&lt;br /&gt;
&lt;br /&gt;
Speculative preallocation can not be disabled but XFS can be tuned to a fixed allocation size with the &#039;allocsize=&#039; mount option. Speculative preallocation is not dynamically resized when the allocsize mount option is set and thus the potential for fragmentation is increased. Use &#039;allocsize=64k&#039; to revert to the default XFS behavior prior to support for dynamic speculative preallocation.&lt;br /&gt;
&lt;br /&gt;
== Q: mount (or umount) takes minutes or even hours - what could be the reason ? ==&lt;br /&gt;
&lt;br /&gt;
In some cases xfs log (journal) can become quite big. For example if it accumulates many entries and doesn&#039;t get chance to apply these to disk (due to lockup, crash, hard reset etc). xfs will try to reapply these at mount (in dmesg: &amp;quot;Starting recovery (logdev: internal)&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
That process with big log to be reapplied can take very long time (minutes or even hours). Similar problem can happen with unmount taking hours when there are hundreds of thousands of dirty inode in memory that need to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
(http://oss.sgi.com/pipermail/xfs/2015-October/044457.html)&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=2979</id>
		<title>Getting the latest source code</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=2979"/>
		<updated>2015-10-15T09:50:49Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: added xfsprogs-dev repository information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; XFS Released/Stable source &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mainline kernels&#039;&#039;&#039;&lt;br /&gt;
:XFS has been maintained in the official Linux kernel [http://www.kernel.org/ kernel trees] starting with [http://lkml.org/lkml/2003/12/8/35 Linux 2.4] and is frequently updated with the latest stable fixes and features from the XFS development team.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Vendor kernels&#039;&#039;&#039;&lt;br /&gt;
:All modern Linux distributions include support for XFS. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XFS userspace&#039;&#039;&#039;&lt;br /&gt;
:[ftp://oss.sgi.com/projects/xfs source code tarballs] of the xfs userspace tools. These tarballs form the basis of the xfsprogs packages found in Linux distributions.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; Development and bleeding edge Development &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
* [[XFS git howto]]&lt;br /&gt;
&lt;br /&gt;
=== Current XFS kernel source ===&lt;br /&gt;
&lt;br /&gt;
* [https://git.kernel.org/cgit/linux/kernel/git/dgc/linux-xfs.git/ xfs]&lt;br /&gt;
&lt;br /&gt;
 $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git &lt;br /&gt;
&lt;br /&gt;
Note: the old kernel tree on [http://oss.sgi.com/cgi-bin/gitweb.cgi oss.sgi.com] is no longer kept up to date with the master tree on kernel.org.&lt;br /&gt;
&lt;br /&gt;
=== XFS user space tools ===&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=summary xfsprogs]&lt;br /&gt;
&lt;br /&gt;
 git clone git://oss.sgi.com/xfs/cmds/xfsprogs&lt;br /&gt;
&lt;br /&gt;
* [https://git.kernel.org/cgit/fs/xfs/xfsprogs-dev.git/ xfsprogs development version]&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git&lt;br /&gt;
&lt;br /&gt;
A few packages are needed to compile &amp;lt;tt&amp;gt;xfsprogs&amp;lt;/tt&amp;gt;, depending on your package manager:&lt;br /&gt;
&lt;br /&gt;
 apt-get install libtool automake gettext libblkid-dev uuid-dev&lt;br /&gt;
 yum     install libtool automake gettext libblkid-devel libuuid-devel&lt;br /&gt;
&lt;br /&gt;
=== XFS dump ===&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsdump.git;a=summary xfsdump]&lt;br /&gt;
 $ git clone git://oss.sgi.com/xfs/cmds/xfsdump&lt;br /&gt;
&lt;br /&gt;
=== XFS tests ===&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfstests.git;a=summary xfstests]&lt;br /&gt;
 $ git clone git://oss.sgi.com/xfs/cmds/xfstests&lt;br /&gt;
&lt;br /&gt;
=== DMAPI user space tools ===&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/dmapi.git;a=summary dmapi]&lt;br /&gt;
 $ git clone git://oss.sgi.com/xfs/cmds/dmapi&lt;br /&gt;
&lt;br /&gt;
=== git-cvsimport generated trees ===&lt;br /&gt;
&lt;br /&gt;
The Git trees are automated mirrored copies of the CVS trees using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
Since git-cvsimport utilized the tool [http://www.cobite.com/cvsps/ cvsps] to recreate the atomic commits of ptools or &amp;quot;mod&amp;quot; it is easier to see the entire change that was committed using git.&lt;br /&gt;
&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=archive/xfs-import.git;a=summary linux-2.6-xfs-from-cvs]&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=archive/xfs-cmds.git;a=summary xfs-cmds]&lt;br /&gt;
&lt;br /&gt;
Before building in the &amp;lt;tt&amp;gt;xfsdump&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;dmapi&amp;lt;/tt&amp;gt; directories (after building &amp;lt;tt&amp;gt;xfsprogs&amp;lt;/tt&amp;gt;), you will need to run:&lt;br /&gt;
  # cd xfsprogs&lt;br /&gt;
  # make install-dev&lt;br /&gt;
to create &amp;lt;tt&amp;gt;/usr/include/xfs&amp;lt;/tt&amp;gt; and install appropriate files there.&lt;br /&gt;
&lt;br /&gt;
Before building in the xfstests directory, you will need to run:&lt;br /&gt;
  # cd xfsprogs&lt;br /&gt;
  # make install-qa&lt;br /&gt;
to install a somewhat larger set of files in &amp;lt;tt&amp;gt;/usr/include/xfs&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt;XFS cvs trees &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The cvs trees were created using a script that converted sgi&#039;s internal&lt;br /&gt;
ptools repository to a cvs repository, so the cvs trees were considered read only.&lt;br /&gt;
&lt;br /&gt;
At this point all new development is being managed by the git trees thus the cvs trees&lt;br /&gt;
are no longer active in terms of current development and should only be used&lt;br /&gt;
for reference.&lt;br /&gt;
&lt;br /&gt;
* [[XFS CVS howto]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Quota_check_parallelization&amp;diff=2978</id>
		<title>Quota check parallelization</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Quota_check_parallelization&amp;diff=2978"/>
		<updated>2015-06-28T00:34:04Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Created page with &amp;quot;Currently quota check done at mount time is not parallelized.  Parallelizing would make time needed for mount to finish much smaller.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Currently quota check done at mount time is not parallelized.&lt;br /&gt;
&lt;br /&gt;
Parallelizing would make time needed for mount to finish much smaller.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Ideas_for_XFS&amp;diff=2977</id>
		<title>Ideas for XFS</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Ideas_for_XFS&amp;diff=2977"/>
		<updated>2015-06-28T00:05:29Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* Future Directions for XFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Future Directions for XFS =&lt;br /&gt;
&lt;br /&gt;
Dave Chinner&#039;s ideas from 2008:&lt;br /&gt;
&lt;br /&gt;
* [[Improving inode Caching]]&lt;br /&gt;
&lt;br /&gt;
* [[Improving Metadata Performance By Reducing Journal Overhead]]&lt;br /&gt;
&lt;br /&gt;
* [[Reliable Detection and Repair of Metadata Corruption]]&lt;br /&gt;
&lt;br /&gt;
Other ideas:&lt;br /&gt;
&lt;br /&gt;
* [[Splitting project quota support from group quota support]]&lt;br /&gt;
&lt;br /&gt;
* [[Assigning project quota to a linux container]]&lt;br /&gt;
&lt;br /&gt;
* [[Quota check parallelization]]&lt;br /&gt;
&lt;br /&gt;
* [[Support discarding of unused sectors]] (status: completed)&lt;br /&gt;
&lt;br /&gt;
* Superblock flag for when 64-bit inodes are present (see [http://oss.sgi.com/pipermail/xfs/2009-May/041379.html xfs: regarding the inode64 mount option])&lt;br /&gt;
&lt;br /&gt;
* Wishlist: Please integrate &#039;&#039;xfs_irecover&#039;&#039; or provide [http://www.who.is.free.fr/wiki/doku.php?id=recover inode recovery feature]&lt;br /&gt;
&lt;br /&gt;
* [[Host Aware SMR architecture]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=User_talk:Cattelan&amp;diff=2825</id>
		<title>User talk:Cattelan</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=User_talk:Cattelan&amp;diff=2825"/>
		<updated>2012-10-19T14:34:54Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* XFS File Inode number is changing using the utilities  */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== XFS_IOCORE_R ==&lt;br /&gt;
&lt;br /&gt;
To Developers , &lt;br /&gt;
I have read about the new member named as xfs_extdelta that is passed in different xfs internal routines i.e xfs_bmapi , In the 2.4 versions instead of using it is just passed as NULL can anyone provide info regarding that where to initialize and if I pass it NULl then is there any adverse effect of it &lt;br /&gt;
&lt;br /&gt;
XFS_IOCORE_RT  not been used in 2.6 version , so if instead of this flag I will pass XFS_IOCORE_EXCL it will be ok or will cause any crash or adverse effects or either there is any alternative present to sought out from these two problems &lt;br /&gt;
&lt;br /&gt;
Regards &lt;br /&gt;
Anshul Kundra &lt;br /&gt;
HCL TECHNOLOGIES &lt;br /&gt;
ERS&lt;br /&gt;
: Has been answered on the [http://www.spinics.net/lists/xfs/msg09007.html mailinglist] -- [[User:Ckujau|Ckujau]] 23:39, 16 February 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
== XFS File Inode number is changing using the utilities  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To Developers,&lt;br /&gt;
&lt;br /&gt;
I have seen a different behaviour in XFS  &lt;br /&gt;
&lt;br /&gt;
Suppose I have a file with inode number &amp;quot;131&amp;quot;, I have noticed that the inode number of file got changed without deleting the file. When we change the data of the file everytime it changes the inode number. The complete description over the test is as follows &lt;br /&gt;
&lt;br /&gt;
Steps are as follows:&lt;br /&gt;
&lt;br /&gt;
1) I have created a file using &amp;quot;dd&amp;quot; of size 100MB:&lt;br /&gt;
&lt;br /&gt;
#dd if=/dev/zero of=xfs.img bs=1M count=100&lt;br /&gt;
&lt;br /&gt;
2) Created a loopback device over the image:&lt;br /&gt;
#losetup /dev/loop1 xfs.img&lt;br /&gt;
&lt;br /&gt;
3) Created file system:&lt;br /&gt;
#mkfs.xfs /dev/loop1 &lt;br /&gt;
&lt;br /&gt;
4) Mounted:&lt;br /&gt;
#mount /dev/loop1 /mnt/xfs_mnt &lt;br /&gt;
&lt;br /&gt;
5) Please check the mount output:&lt;br /&gt;
# mount&lt;br /&gt;
&lt;br /&gt;
/dev/sdb2 on / type ext3 (rw,acl,user_xattr)&lt;br /&gt;
proc on /proc type proc (rw)&lt;br /&gt;
sysfs on /sys type sysfs (rw)&lt;br /&gt;
debugfs on /sys/kernel/debug type debugfs (rw)&lt;br /&gt;
devtmpfs on /dev type devtmpfs (rw,mode=0755)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw,mode=1777)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)&lt;br /&gt;
fusectl on /sys/fs/fuse/connections type fusectl (rw)&lt;br /&gt;
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
/dev/loop0 on /mnt/mount_test type xfs (rw)&lt;br /&gt;
/dev/loop1 on /mnt/xfs_mnt type xfs (rw)&lt;br /&gt;
&lt;br /&gt;
6) Created a file using &amp;quot;touch&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# touch kundra.txt&lt;br /&gt;
&lt;br /&gt;
7) Checking the file and its inode number:&lt;br /&gt;
&lt;br /&gt;
# ls -li &lt;br /&gt;
total 0&lt;br /&gt;
131 -rw-r--r-- 1 root root 0 2012-10-20 01:41 kundra.txt&lt;br /&gt;
&lt;br /&gt;
8) I have written some data using the vim editor, I can&#039;t provide snapshot of vim on the list:&lt;br /&gt;
&lt;br /&gt;
#vim kundra.txt&lt;br /&gt;
&lt;br /&gt;
9) Now I checked the inode number using the &amp;quot;ls -li&amp;quot;&lt;br /&gt;
# ls -li&lt;br /&gt;
&lt;br /&gt;
total 4&lt;br /&gt;
133 -rw-r--r-- 1 root root 19 2012-10-20 01:43 kundra.txt&lt;br /&gt;
&lt;br /&gt;
Please check that the inode number ( from &amp;quot;131&amp;quot; to &amp;quot;133&amp;quot; )  and total value (from &amp;quot;0&amp;quot; to &amp;quot;4&amp;quot; )in the filesystem got changed, I am assuming that the reasom may be due to filesystem of small size but it is showing unexpected behaviour. &lt;br /&gt;
&lt;br /&gt;
Please provide some description over this issue, I am working on Linux SLES &lt;br /&gt;
&lt;br /&gt;
# cat /etc/issue&lt;br /&gt;
&lt;br /&gt;
Welcome to SUSE Linux Enterprise Server 11 SP1  (x86_64) - Kernel \r (\l).&lt;br /&gt;
&lt;br /&gt;
# uname -a &lt;br /&gt;
Linux linux-sles 2.6.32.19-0.6-default #1 SMP Fri Aug 31 01:37:50 IST 2012 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
&lt;br /&gt;
Thanks &amp;amp; Best Regards  &lt;br /&gt;
Anshul Kundra&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org_talk:Anshul.kundra&amp;diff=2821</id>
		<title>Xfs.org talk:Anshul.kundra</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org_talk:Anshul.kundra&amp;diff=2821"/>
		<updated>2012-10-15T14:50:11Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Anshul.kundra moved page User:Anshul.kundra to XFS.org talk:Anshul.kundra: Query&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To Developers&lt;br /&gt;
I am using xfs utilities xfs_db, Suppose I want to corrupt a particular inode (inode no 131 ) in the file system present then will it be possible as per the manuals blocktrash in xfs_db randomly corrupt the blocks according to the type specified but if I use the xfs_db command like this &lt;br /&gt;
&lt;br /&gt;
xfs_db &amp;quot;blockget -i &amp;lt;inode number (131)&amp;gt; &amp;quot; -c &amp;quot;blocktrash -t inode &amp;quot; device name &lt;br /&gt;
&lt;br /&gt;
Then can it be possibe that the block I am corrupting is for inode with number 131. If it takes random blocks (inode ) then there will be no medium to corrupt the inode of our choice &lt;br /&gt;
&lt;br /&gt;
I have tried but can be able to corrupt specific Inode can anybody correct me if I am using a wrong way for corrupting the inode &lt;br /&gt;
&lt;br /&gt;
Thanks &amp;amp; Regards &lt;br /&gt;
Anshul Kundra&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org_talk:Anshul.kundra&amp;diff=2820</id>
		<title>Xfs.org talk:Anshul.kundra</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org_talk:Anshul.kundra&amp;diff=2820"/>
		<updated>2012-10-15T14:49:32Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: xfs_db corrupting specific inode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To Developers&lt;br /&gt;
I am using xfs utilities xfs_db, Suppose I want to corrupt a particular inode (inode no 131 ) in the file system present then will it be possible as per the manuals blocktrash in xfs_db randomly corrupt the blocks according to the type specified but if I use the xfs_db command like this &lt;br /&gt;
&lt;br /&gt;
xfs_db &amp;quot;blockget -i &amp;lt;inode number (131)&amp;gt; &amp;quot; -c &amp;quot;blocktrash -t inode &amp;quot; device name &lt;br /&gt;
&lt;br /&gt;
Then can it be possibe that the block I am corrupting is for inode with number 131. If it takes random blocks (inode ) then there will be no medium to corrupt the inode of our choice &lt;br /&gt;
&lt;br /&gt;
I have tried but can be able to corrupt specific Inode can anybody correct me if I am using a wrong way for corrupting the inode &lt;br /&gt;
&lt;br /&gt;
Thanks &amp;amp; Regards &lt;br /&gt;
Anshul Kundra&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=User:Spamuser&amp;diff=2809</id>
		<title>User:Spamuser</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=User:Spamuser&amp;diff=2809"/>
		<updated>2012-07-24T22:02:19Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Cattelan moved page User:Arlene0E to User:Spamuser: Automatically moved page while merging the user &amp;quot;Arlene0E&amp;quot; to &amp;quot;Spamuser&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;My name&#039;s Elmo Salazar, I&#039;m super excited about pitching in as a writer for this site! My day job is in publishing, but in my heart I&#039;m just an internet junkie. While my company does a relatively good job keeping me off the internet at work, I&#039;m positive I can help.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Feel free to surf my web-site ... [http://mobisocial.stanford.edu/wiki/index.php?title=User:IvanJwj download firefox free]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=User:WikiSysop&amp;diff=2808</id>
		<title>User:WikiSysop</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=User:WikiSysop&amp;diff=2808"/>
		<updated>2012-07-24T19:17:44Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: Wiki Sysop&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wiki Sysop&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=User_talk:Cattelan&amp;diff=2386</id>
		<title>User talk:Cattelan</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=User_talk:Cattelan&amp;diff=2386"/>
		<updated>2012-01-11T15:44:33Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: XFS information query&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To Developers , &lt;br /&gt;
I have read about the new member named as xfs_extdelta that is passed in different xfs internal routines i.e xfs_bmapi , In the 2.4 versions instead of using it is just passed as NULL can anyone provide info regarding that where to initialize and if I pass it NULl then is there any adverse effect of it &lt;br /&gt;
&lt;br /&gt;
XFS_IOCORE_RT  not been used in 2.6 version , so if instead of this flag I will pass XFS_IOCORE_EXCL it will be ok or will cause any crash or adverse effects or either there is any alternative present to sought out from these two problems &lt;br /&gt;
&lt;br /&gt;
Regards &lt;br /&gt;
Anshul Kundra &lt;br /&gt;
HCL TECHNOLOGIES &lt;br /&gt;
ERS&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org:Community_Portal&amp;diff=2311</id>
		<title>Xfs.org:Community Portal</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org:Community_Portal&amp;diff=2311"/>
		<updated>2011-04-05T23:11:55Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Add some content here&lt;br /&gt;
&lt;br /&gt;
Checking for update info&lt;br /&gt;
&lt;br /&gt;
New email stuff checking&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2288</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2288"/>
		<updated>2011-03-27T12:05:40Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* Q: Why do I receive No space left on device after xfs_growfs? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
Things to include are what version of XFS you are using, if this is a CVS version of what date and version of the kernel. If you have problems with userland packages please report the version of the package you are using.&lt;br /&gt;
&lt;br /&gt;
If the problem relates to a particular filesystem, the output from the &#039;&#039;&#039;xfs_info(8)&#039;&#039;&#039; command and any &#039;&#039;&#039;mount(8)&#039;&#039;&#039; options in use will also be useful to the developers.&lt;br /&gt;
&lt;br /&gt;
If you experience an oops, please run it through &#039;&#039;&#039;ksymoops&#039;&#039;&#039; so that it can be interpreted.&lt;br /&gt;
&lt;br /&gt;
If you have a filesystem that cannot be repaired, make sure you have xfsprogs 2.9.0 or later and run &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; to capture the metadata (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS. However at least some XFS driver implementations does not wipe file information nodes completely so there are chance to recover files with specialized commercial software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS].&lt;br /&gt;
In this kind of XFS driver implementation it does not re-use directory entries immediately so there are chance to get back recently deleted files even with their real names.&lt;br /&gt;
&lt;br /&gt;
This applies to most recent Linux distributions, as well as to most popular NAS boxes that use embedded linux and XFS file system.&lt;br /&gt;
&lt;br /&gt;
Anyway, the best is to always keep backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_check and xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (although for SATA this only works on a recent kernel with ATA command passthrough):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE): (although for SATA this only works on a recent kernel with ATA command passthrough):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with &amp;quot;nobarrier&amp;quot;. But take care about the hard disk write cache, which should be off.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. Even if it&#039;s battery backed, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents in that case.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf , page 86&lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL -EnDskCache|DisDskCache&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;xfs_check&#039;&#039;&#039; tool, or &#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039;, should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/pipermail/xfs/2009-January/039828.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. To fix this, [http://oss.sgi.com/pipermail/xfs/2009-January/039835.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Also, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38 | No space left on device on xfs filesystem with 7.7TB free]&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2287</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2287"/>
		<updated>2011-03-27T12:04:25Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* Q: Why do I receive No space left on device after xfs_growfs? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [http://oss.sgi.com/projects/xfs/training/ SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mounting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes, with one caveat: Linux does not support an external XFS journal for the root filesystem via the &amp;quot;rootflags=&amp;quot; kernel parameter. To use an external journal for the root filesystem in Linux, an init ramdisk must mount the root filesystem with explicit &amp;quot;logdev=&amp;quot; specified. [http://mindplusplus.wordpress.com/2008/07/27/scratching-an-i.html More information here.]&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
Things to include are what version of XFS you are using, if this is a CVS version of what date and version of the kernel. If you have problems with userland packages please report the version of the package you are using.&lt;br /&gt;
&lt;br /&gt;
If the problem relates to a particular filesystem, the output from the &#039;&#039;&#039;xfs_info(8)&#039;&#039;&#039; command and any &#039;&#039;&#039;mount(8)&#039;&#039;&#039; options in use will also be useful to the developers.&lt;br /&gt;
&lt;br /&gt;
If you experience an oops, please run it through &#039;&#039;&#039;ksymoops&#039;&#039;&#039; so that it can be interpreted.&lt;br /&gt;
&lt;br /&gt;
If you have a filesystem that cannot be repaired, make sure you have xfsprogs 2.9.0 or later and run &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; to capture the metadata (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS. However at least some XFS driver implementations does not wipe file information nodes completely so there are chance to recover files with specialized commercial software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS].&lt;br /&gt;
In this kind of XFS driver implementation it does not re-use directory entries immediately so there are chance to get back recently deleted files even with their real names.&lt;br /&gt;
&lt;br /&gt;
This applies to most recent Linux distributions, as well as to most popular NAS boxes that use embedded linux and XFS file system.&lt;br /&gt;
&lt;br /&gt;
Anyway, the best is to always keep backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_check and xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (although for SATA this only works on a recent kernel with ATA command passthrough):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE): (although for SATA this only works on a recent kernel with ATA command passthrough):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with &amp;quot;nobarrier&amp;quot;. But take care about the hard disk write cache, which should be off.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. Even if it&#039;s battery backed, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents in that case.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf , page 86&lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not safe for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is safe so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL -EnDskCache|DisDskCache&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work any more, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is safe on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;xfs_check&#039;&#039;&#039; tool, or &#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039;, should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/pipermail/xfs/2009-January/039828.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. To fix this, [http://oss.sgi.com/pipermail/xfs/2009-January/039835.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Also, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
example:[[https://www.centos.org/modules/newbb/viewtopic.php?topic_id=30703&amp;amp;forum=38|No space left on device on xfs filesystem with 7.7TB free]]&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease)? ==&lt;br /&gt;
&lt;br /&gt;
The default atime behaviour is relatime, which has almost no overhead compared to noatime but still maintains sane atime values. All Linux filesystems use this as the default now (since around 2.6.30), but XFS has used relatime-like behaviour since 2006, so no-one should really need to ever use noatime on XFS for performance reasons. &lt;br /&gt;
&lt;br /&gt;
Also, noatime implies nodiratime, so there is never a need to specify nodiratime when noatime is also specified.&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;br /&gt;
&lt;br /&gt;
== Q: How to calculate the correct sunit,swidth values for optimal performance ==&lt;br /&gt;
&lt;br /&gt;
XFS allows to optimize for a given RAID stripe unit (stripe size) and stripe width (number of data disks) via mount options.&lt;br /&gt;
&lt;br /&gt;
These options can be sometimes autodetected (for example with md raid and recent enough kernel (&amp;gt;= 2.6.32) and xfsprogs (&amp;gt;= 3.1.1) built with libblkid support) but manual calculation is needed for most of hardware raids.&lt;br /&gt;
&lt;br /&gt;
The calculation of these values is quite simple:&lt;br /&gt;
&lt;br /&gt;
  su = &amp;lt;RAID controllers stripe size in BYTES (or KiBytes when used with k)&amp;gt;&lt;br /&gt;
  sw = &amp;lt;# of data disks (don&#039;t count parity disks)&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if your RAID controller has a stripe size of 64KB, and you have a RAID-6 with 8 disks, use&lt;br /&gt;
&lt;br /&gt;
  su = 64k&lt;br /&gt;
  sw = 6 (RAID-6 of 8 disks has 6 data disks)&lt;br /&gt;
&lt;br /&gt;
A RAID stripe size of 256KB with a RAID-10 over 16 disks should use&lt;br /&gt;
&lt;br /&gt;
  su = 256k&lt;br /&gt;
  sw = 8 (RAID-10 of 16 disks has 8 data disks)&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use &amp;quot;sunit&amp;quot; instead of &amp;quot;su&amp;quot; and &amp;quot;swidth&amp;quot; instead of &amp;quot;sw&amp;quot; but then sunit/swidth values need to be specified in &amp;quot;number of 512B sectors&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; interpret sunit and swidth as being specified in units of 512B sectors; that&#039;s unfortunately not the unit they&#039;re reported in, however.&lt;br /&gt;
&amp;lt;tt&amp;gt;xfs_info&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; report them in multiples of your basic block size (bsize) and not in 512B sectors.&lt;br /&gt;
&lt;br /&gt;
Assume for example: swidth 1024 (specified at mkfs.xfs command line; so 1024 of 512B sectors) and block size of 4096 (bsize reported by mkfs.xfs at output). You should see swidth 128 (reported by mkfs.xfs at output). 128 * 4096 == 1024 * 512.&lt;br /&gt;
&lt;br /&gt;
When creating XFS filesystem on top of LVM on top of hardware raid please use sunit/swith values as when creating XFS filesystem directly on top of hardware raid.&lt;br /&gt;
&lt;br /&gt;
== Q: Why doesn&#039;t NFS-exporting subdirectories of inode64-mounted filesystem work? ==&lt;br /&gt;
&lt;br /&gt;
The default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; type encodes only 32-bit of the inode number for subdirectory exports.  However, exporting the root of the filesystem works, or using one of the non-default &amp;lt;tt&amp;gt;fsid&amp;lt;/tt&amp;gt; types (&amp;lt;tt&amp;gt;fsid=uuid&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/etc/exports&amp;lt;/tt&amp;gt; with recent &amp;lt;tt&amp;gt;nfs-utils&amp;lt;/tt&amp;gt;) should work as well. (Thanks, Christoph!)&lt;br /&gt;
&lt;br /&gt;
== Q: What is the inode64 mount option for? ==&lt;br /&gt;
&lt;br /&gt;
By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like &amp;quot;disk full&amp;quot; when you still have plenty space free, but there&#039;s no more place in the first TB to create a new inode. Also, performance sucks.&lt;br /&gt;
&lt;br /&gt;
To come around this, use the inode64 mount options for filesystems &amp;gt;1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.&lt;br /&gt;
&lt;br /&gt;
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.&lt;br /&gt;
&lt;br /&gt;
== Q: Can I just try the inode64 option to see if it helps me? ==&lt;br /&gt;
&lt;br /&gt;
Starting from kernel 2.6.35, you can try and then switch back. Older kernels have a bug leading to strange problems if you mount without inode64 again. For example, you can&#039;t access files &amp;amp; dirs that have been created with an inode &amp;gt;32bit anymore.&lt;br /&gt;
&lt;br /&gt;
== Q: Performance: mkfs.xfs -n size=64k option ==&lt;br /&gt;
&lt;br /&gt;
Asking the implications of that mkfs option on the XFS mailing list, Dave Chinner explained it this way:&lt;br /&gt;
&lt;br /&gt;
Inodes are not stored in the directory structure, only the directory entry name and the inode number. Hence the amount of space used by a&lt;br /&gt;
directory entry is determined by the length of the name.&lt;br /&gt;
&lt;br /&gt;
There is extra overhead to allocate large directory blocks (16 pages instead of one, to begin with, then there&#039;s the vmap overhead, etc), so for small directories smaller block sizes are faster for create and unlink operations.&lt;br /&gt;
&lt;br /&gt;
For empty directories, operations on 4k block sized directories consume roughly 50% less CPU that 64k block size directories. The 4k block size directories consume less CPU out to roughly 1.5 million entries where the two are roughly equal. At directory sizes of 10 million entries, 64k directory block operations are consuming about 15% of the CPU that 4k directory block operations consume.&lt;br /&gt;
&lt;br /&gt;
In terms of lookups, the 64k block directory will take less IO but consume more CPU for a given lookup. Hence it depends on your IO latency and whether directory readahead can hide that latency as to which will be faster. e.g. For SSDs, CPU usage might be the limiting factor, not the IO. Right now I don&#039;t have any numbers on what the difference might be - I&#039;m getting 1 billion inode population issues worked out first before I start on measuring cold cache lookup times on 1 billion files....&lt;br /&gt;
&lt;br /&gt;
== Q: I want to tune my XFS filesystems for &amp;lt;something&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The standard answer you will get to this question is this: use the defaults.&lt;br /&gt;
&lt;br /&gt;
There are few workloads where using non-default mkfs.xfs or mount options make much sense. In general, the default values already used are optimised for best performance in the first place. mkfs.xfs will detect the difference between single disk and MD/DM RAID setups and change the default values it uses to  configure the filesystem appropriately.&lt;br /&gt;
&lt;br /&gt;
There are a lot of &amp;quot;XFS tuning guides&amp;quot; that Google will find for you - most are old, out of date and full of misleading or just plain incorrect information. Don&#039;t expect that tuning your filesystem for optimal bonnie++ numbers will mean your workload will go faster. You should only consider changing the defaults if either: a) you know from experience that your workload causes XFS a specific problem that can be worked around via a configuration change, or b) your workload is demonstrating bad performance when using the default configurations. In this case, you need to understand why your application is causing bad performance before you start tweaking XFS configurations.&lt;br /&gt;
&lt;br /&gt;
In most cases, the only thing you need to to consider for &amp;lt;tt&amp;gt;mkfs.xfs&amp;lt;/tt&amp;gt; is specifying the stripe unit and width for hardware RAID devices. For mount options, the only thing that will change metadata performance considerably are the &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; mount options. Increasing &amp;lt;tt&amp;gt;logbsize&amp;lt;/tt&amp;gt; reduces the number of journal IOs for a given workload, and &amp;lt;tt&amp;gt;delaylog&amp;lt;/tt&amp;gt; will reduce them even further. The trade off for this increase in metadata performance is that more operations may be &amp;quot;missing&amp;quot; after recovery if the system crashes while actively making modifications.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org:Administrators&amp;diff=2159</id>
		<title>Xfs.org:Administrators</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org:Administrators&amp;diff=2159"/>
		<updated>2011-02-16T17:56:27Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;cattelan&lt;br /&gt;
dgc&lt;br /&gt;
hch&lt;br /&gt;
sandeen&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_Papers_and_Documentation&amp;diff=2095</id>
		<title>XFS Papers and Documentation</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_Papers_and_Documentation&amp;diff=2095"/>
		<updated>2010-08-23T14:37:12Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* File System Structure [http://xfs.org/docs/xfsdocs-xml-dev/XFS_Filesystem_Structure//tmp/en-US/html/index.html]&lt;br /&gt;
&lt;br /&gt;
* User Guide [http://xfs.org/docs/xfsdocs-xml-dev/XFS_User_Guide//tmp/en-US/html/index.html]&lt;br /&gt;
&lt;br /&gt;
* XFS Labs [http://xfs.org/docs/xfsdocs-xml-dev/XFS_Labs/tmp/en-US/html/index.html]&lt;br /&gt;
&lt;br /&gt;
* Someone managed to document &amp;lt;tt&amp;gt;/proc/fs/xfs/stat&amp;lt;/tt&amp;gt;: [[Runtime_Stats|Runtime_Stats]]&lt;br /&gt;
&lt;br /&gt;
The XFS team has been working on a training course aimed at developers, support staff and experienced users, that explores the internals and ondisk format of XFS.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS Overview and Internals&#039;&#039; [[http://oss.sgi.com/projects/xfs/training/index.html Index]]&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented most of the XFS ondisk format, including examples on how to traverse the structure and diagnose ondisk problems:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS Filesystem Structure&#039;&#039; [[http://oss.sgi.com/projects/xfs/papers/xfs_filesystem_structure.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
The October 2009 issue of the USENIX ;login: magazine published an article about XFS targeted at system administrators:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS: The big storage file system for Linux&#039;&#039; [[http://oss.sgi.com/projects/xfs/papers/hellwig.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the Ottawa Linux Symposium (July 2006), Dave Chinner presented a paper on filesystem scalability in Linux 2.6 kernels:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;High Bandwidth Filesystems on Large Systems&#039;&#039; (July 2006) [[http://oss.sgi.com/projects/xfs/papers/ols2006/ols-2006-paper.pdf paper]] [[http://oss.sgi.com/projects/xfs/papers/ols2006/ols-2006-presentation.pdf presentation]]&lt;br /&gt;
&lt;br /&gt;
At linux.conf.au 2008 Dave Chinner gave a presentation about xfs_repair that he co-authored with Barry Naujok:&lt;br /&gt;
&lt;br /&gt;
* Fixing XFS Filesystems Faster [[http://mirror.linux.org.au/pub/linux.conf.au/2008/slides/135-fixing_xfs_faster.pdf]]&lt;br /&gt;
&lt;br /&gt;
In July 2006, SGI storage marketing updated the XFS datasheet:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Open Source XFS for Linux&#039;&#039; [[http://oss.sgi.com/projects/xfs/datasheet.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At UKUUG 2003, Christoph Hellwig presented a talk on XFS:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS for Linux&#039;&#039; (July 2003) [[http://oss.sgi.com/projects/xfs/papers/ukuug2003.pdf pdf]] [[http://verein.lst.de/~hch/talks/ukuug2003/ html]]&lt;br /&gt;
&lt;br /&gt;
Originally published in Proceedings of the FREENIX Track: 2002 Usenix Annual Technical Conference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Filesystem Performance and Scalability in Linux 2.4.17&#039;&#039; (June 2002) [[http://oss.sgi.com/projects/xfs/papers/filesystem-perf-tm.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the Ottawa Linux Symposium, an updated presentation on porting XFSÂ to Linux was given:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Porting XFS to Linux&#039;&#039; (July 2000) [[http://oss.sgi.com/projects/xfs/papers/ols2000/ols-xfs.htm html]]&lt;br /&gt;
&lt;br /&gt;
At the Atlanta Linux Showcase, SGI presented the following paper on the port of XFS to Linux:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Porting the SGI XFS File System to Linux&#039;&#039; (October 1999) [[http://oss.sgi.com/projects/xfs/papers/als/als.ps ps]] [[http://oss.sgi.com/projects/xfs/papers/als/als.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
At the 6th Linux Kongress &amp;amp;amp; the Linux Storage Management Workshop (LSMW) in Germany in September, 1999, SGI had a few presentations including the following:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SGI&#039;s port of XFS to Linux&#039;&#039; (September 1999) [[http://oss.sgi.com/projects/xfs/papers/linux_kongress/index.htm html]]&lt;br /&gt;
* &#039;&#039;Overview of DMF&#039;&#039; (September 1999) [[http://oss.sgi.com/projects/xfs/papers/DMF-over/index.htm html]]&lt;br /&gt;
&lt;br /&gt;
At the LinuxWorld Conference &amp;amp;amp; Expo in August 1999, SGI published:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;An Open Source XFS data sheet&#039;&#039; (August 1999) [[http://oss.sgi.com/projects/xfs/papers/xfs_GPL.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
From the 1996 USENIX conference:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;An XFS white paper&#039;&#039; [[http://oss.sgi.com/projects/xfs/papers/xfs_usenix/index.html html]]&lt;br /&gt;
&lt;br /&gt;
=== Other historical articles, press-releases, etc ===&lt;br /&gt;
&lt;br /&gt;
* IBM&#039;s &#039;&#039;Advanced Filesystem Implementor&#039;s Guide&#039;&#039; has a chapter &#039;&#039;Introducing XFS&#039;&#039; [[http://www-106.ibm.com/developerworks/library/l-fs9.html html]]&lt;br /&gt;
&lt;br /&gt;
* An editorial titled &#039;&#039;Tired of fscking? Try a journaling filesystem!&#039;&#039;, Freshmeat (February 2001) [[http://freshmeat.net/articles/view/212/ html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Who give a fsck about filesystems&#039;&#039; provides an overview of the Linux 2.4 filesystems [[http://www.linuxuser.co.uk/articles/issue6/lu6-All_you_need_to_know_about-Filesystems.pdf html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Journal File Systems&#039;&#039; in issue 55 of &#039;&#039;Linux Gazette&#039;&#039; provides a comparison of journaled filesystems.&lt;br /&gt;
&lt;br /&gt;
* The original XFS beta release announcement was published in &#039;&#039;Linux Today&#039;&#039; (September 2000) [[http://linuxtoday.com/news_story.php3?ltsn=2000-09-26-017-04-OS-SW html]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;XFS: It&#039;s worth the wait&#039;&#039; was published on &#039;&#039;EarthWeb&#039;&#039; (July 2000) [[http://networking.earthweb.com/netos/oslin/article/0,,12284_623661,00.html html]]&lt;br /&gt;
&lt;br /&gt;
* An &#039;&#039;IRIX-XFS data sheet&#039;&#039; (July 1999) [[http://oss.sgi.com/projects/xfs/papers/IRIX_xfs_data_sheet.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;Getting Started with XFS&#039;&#039; book (1994) [[http://oss.sgi.com/projects/xfs/papers/getting_started_with_xfs.pdf pdf]]&lt;br /&gt;
&lt;br /&gt;
* Original &#039;&#039;XFS design documents&#039;&#039; (1993) ([http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_ps/ ps], [http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_pdf/ pdf])&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Help:Contents&amp;diff=2080</id>
		<title>Help:Contents</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Help:Contents&amp;diff=2080"/>
		<updated>2010-05-08T20:21:06Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please add&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2054</id>
		<title>XFS FAQ</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_FAQ&amp;diff=2054"/>
		<updated>2009-11-06T22:55:33Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Info from: [http://oss.sgi.com/projects/xfs/faq.html main XFS faq at SGI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to earlier maintainers of this document - Thomas Graichen and Seth Mos.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about XFS? ==&lt;br /&gt;
&lt;br /&gt;
The SGI XFS project page http://oss.sgi.com/projects/xfs/ is the definitive reference. It contains pointers to whitepapers, books, articles, etc.&lt;br /&gt;
&lt;br /&gt;
You could also join the [[XFS_email_list_and_archives|XFS mailing list]] or the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;#xfs&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; IRC channel on &#039;&#039;irc.freenode.net&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find documentation about ACLs? ==&lt;br /&gt;
&lt;br /&gt;
Andreas Gruenbacher maintains the Extended Attribute and POSIX ACL documentation for Linux at http://acl.bestbits.at/&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;acl(5)&#039;&#039;&#039; manual page is also quite extensive.&lt;br /&gt;
&lt;br /&gt;
== Q: Where can I find information about the internals of XFS? ==&lt;br /&gt;
&lt;br /&gt;
An [training/index.html SGI XFS Training course] aimed at developers, triage and support staff, and serious users has been in development. Parts of the course are clearly still incomplete, but there is enough content to be useful to a broad range of users.&lt;br /&gt;
&lt;br /&gt;
Barry Naujok has documented the [papers/xfs_filesystem_structure.doc XFS ondisk format] which is a very useful reference.&lt;br /&gt;
&lt;br /&gt;
== Q: What partition type should I use for XFS on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Linux native filesystem (83).&lt;br /&gt;
&lt;br /&gt;
== Q: What mount options does XFS have? ==&lt;br /&gt;
&lt;br /&gt;
There are a number of mount options influencing XFS filesystems - refer to the &#039;&#039;&#039;mount(8)&#039;&#039;&#039; manual page or the documentation in the kernel source tree itself ([http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD Documentation/filesystems/xfs.txt])&lt;br /&gt;
&lt;br /&gt;
== Q: Is there any relation between the XFS utilities and the kernel version? ==&lt;br /&gt;
&lt;br /&gt;
No, there is no relation. Newer utilities tend to mainly have fixes and checks the previous versions might not have. New features are also added in a backward compatible way - if they are enabled via mkfs, an incapable (old) kernel will recognize that it does not understand the new feature, and refuse to mount the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Does it run on platforms other than i386? ==&lt;br /&gt;
&lt;br /&gt;
XFS runs on all of the platforms that Linux supports. It is more tested on the more common platforms, especially the i386 family. Its also well tested on the IA64 platform since thats the platform SGI Linux products use.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Do quotas work on XFS? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
To use quotas with XFS, you need to enable XFS quota support when you configure your kernel. You also need to specify quota support when mounting. You can get the Linux quota utilities at their sourceforge website [http://sourceforge.net/projects/linuxquota/  http://sourceforge.net/projects/linuxquota/] or use &#039;&#039;&#039;xfs_quota(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: What&#039;s project quota? ==&lt;br /&gt;
&lt;br /&gt;
The  project  quota  is a quota mechanism in XFS can be used to implement a form of directory tree quota, where a specified directory and all of the files and subdirectories below it (i.e. a tree) can be restricted to using a subset of the available space in the filesystem.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Can group quota and project quota be used at the same time? ==&lt;br /&gt;
&lt;br /&gt;
No, project quota cannot be used with group quota at the same time. On the other hand user quota and project quota can be used simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Q: Quota: Is umounting prjquota (project quota) enabled fs and mouting it again with grpquota (group quota) removing prjquota limits previously set from fs (and vice versa) ? ==&lt;br /&gt;
&lt;br /&gt;
To be answered.&lt;br /&gt;
&lt;br /&gt;
== Q: Are there any dump/restore tools for XFS? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and &#039;&#039;&#039;xfsrestore(8)&#039;&#039;&#039; are fully supported. The tape format is the same as on IRIX, so tapes are interchangeable between operating systems.&lt;br /&gt;
&lt;br /&gt;
== Q: Does LILO work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
This depends on where you install LILO.&lt;br /&gt;
&lt;br /&gt;
Yes, for MBR (Master Boot Record) installations.&lt;br /&gt;
&lt;br /&gt;
No, for root partition installations because the XFS superblock is written at block zero, where LILO would be installed. This is to maintain compatibility with the IRIX on-disk format, and will not be changed.&lt;br /&gt;
&lt;br /&gt;
== Q: Does GRUB work with XFS? ==&lt;br /&gt;
&lt;br /&gt;
There is native XFS filesystem support for GRUB starting with version 0.91 and onward. Unfortunately, GRUB used to make incorrect assumptions about being able to read a block device image while a filesystem is mounted and actively being written to, which could cause intermittent problems when using XFS. This has reportedly since been fixed, and the 0.97 version (at least) of GRUB is apparently stable.&lt;br /&gt;
&lt;br /&gt;
== Q: Can XFS be used for a root filesystem? ==&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
== Q: Will I be able to use my IRIX XFS filesystems on Linux? ==&lt;br /&gt;
&lt;br /&gt;
Yes. The on-disk format of XFS is the same on IRIX and Linux. Obviously, you should back-up your data before trying to move it between systems. Filesystems must be &amp;quot;clean&amp;quot; when moved (i.e. unmounted). If you plan to use IRIX filesystems on Linux keep the following points in mind: the kernel needs to have SGI partition support enabled; there is no XLV support in Linux, so you are unable to read IRIX filesystems which use the XLV volume manager; also not all blocksizes available on IRIX are available on Linux (only blocksizes less than or equal to the pagesize of the architecture: 4k for i386, ppc, ... 8k for alpha, sparc, ... is possible for now). Make sure that the directory format is version 2 on the IRIX filesystems (this is the default since IRIX 6.5.5). Linux can only read v2 directories.&lt;br /&gt;
&lt;br /&gt;
== Q: Is there a way to make a XFS filesystem larger or smaller? ==&lt;br /&gt;
&lt;br /&gt;
You can &#039;&#039;NOT&#039;&#039; make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.&lt;br /&gt;
&lt;br /&gt;
An XFS filesystem may be enlarged by using &#039;&#039;&#039;xfs_growfs(8)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using partitions, you need to have free space after this partition to do so. Remove partition, recreate it larger with the &#039;&#039;exact same&#039;&#039; starting point. Run &#039;&#039;&#039;xfs_growfs&#039;&#039;&#039; to make the partition larger. Note - editing partition tables is a dangerous pastime, so back up your filesystem before doing so.&lt;br /&gt;
&lt;br /&gt;
Using XFS filesystems on top of a volume manager makes this a lot easier.&lt;br /&gt;
&lt;br /&gt;
== Q: What information should I include when reporting a problem? ==&lt;br /&gt;
&lt;br /&gt;
Things to include are what version of XFS you are using, if this is a CVS version of what date and version of the kernel. If you have problems with userland packages please report the version of the package you are using.&lt;br /&gt;
&lt;br /&gt;
If the problem relates to a particular filesystem, the output from the &#039;&#039;&#039;xfs_info(8)&#039;&#039;&#039; command and any &#039;&#039;&#039;mount(8)&#039;&#039;&#039; options in use will also be useful to the developers.&lt;br /&gt;
&lt;br /&gt;
If you experience an oops, please run it through &#039;&#039;&#039;ksymoops&#039;&#039;&#039; so that it can be interpreted.&lt;br /&gt;
&lt;br /&gt;
If you have a filesystem that cannot be repaired, make sure you have xfsprogs 2.9.0 or later and run &#039;&#039;&#039;xfs_metadump(8)&#039;&#039;&#039; to capture the metadata (which obfuscates filenames and attributes to protect your privacy) and make the dump available for someone to analyse.&lt;br /&gt;
&lt;br /&gt;
== Q: Mounting an XFS filesystem does not work - what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
If mount prints an error message something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     mount: /dev/hda5 has wrong major or minor number&lt;br /&gt;
&lt;br /&gt;
you either do not have XFS compiled into the kernel (or you forgot to load the modules) or you did not use the &amp;quot;-t xfs&amp;quot; option on mount or the &amp;quot;xfs&amp;quot; option in &amp;lt;tt&amp;gt;/etc/fstab&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mount: wrong fs type, bad option, bad superblock on /dev/sda1,&lt;br /&gt;
        or too many mounted file systems&lt;br /&gt;
&lt;br /&gt;
Refer to your system log file (&amp;lt;tt&amp;gt;/var/log/messages&amp;lt;/tt&amp;gt;) for a detailed diagnostic message from the kernel.&lt;br /&gt;
&lt;br /&gt;
== Q: Does the filesystem have an undelete capability? ==&lt;br /&gt;
&lt;br /&gt;
There is no undelete in XFS. However at least some XFS driver implementations does not wipe file information nodes completely so there are chance to recover files with specialized commercial software like [http://www.ufsexplorer.com/rdr_xfs.php Raise Data Recovery for XFS].&lt;br /&gt;
In this kind of XFS driver implementation it does not re-use directory entries immediately so there are chance to get back recently deleted files even with their real names.&lt;br /&gt;
&lt;br /&gt;
This applies to most recent Linux distributions, as well as to most popular NAS boxes that use embedded linux and XFS file system.&lt;br /&gt;
&lt;br /&gt;
Anyway, the best is to always keep backups.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I backup a XFS filesystem and ACLs? ==&lt;br /&gt;
&lt;br /&gt;
You can backup a XFS filesystem with utilities like &#039;&#039;&#039;xfsdump(8)&#039;&#039;&#039; and standard &#039;&#039;&#039;tar(1)&#039;&#039;&#039; for standard files. If you want to backup ACLs you will need to use &#039;&#039;&#039;xfsdump&#039;&#039;&#039; or [http://www.bacula.org/en/dev-manual/Current_State_Bacula.html Bacula] (&amp;gt; version 3.1.4) or [http://rsync.samba.org/ rsync] (&amp;gt;= version 3.0.0) to backup ACLs and EAs. &#039;&#039;&#039;xfsdump&#039;&#039;&#039; can also be integrated with [http://www.amanda.org/ amanda(8)].&lt;br /&gt;
&lt;br /&gt;
== Q: I see applications returning error 990 or &amp;quot;Structure needs cleaning&amp;quot;, what is wrong? ==&lt;br /&gt;
&lt;br /&gt;
The error 990 stands for [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=blob;f=fs/xfs/linux-2.6/xfs_linux.h#l145 EFSCORRUPTED] which usually means XFS has detected a filesystem metadata problem and has shut the filesystem down to prevent further damage. Also, since about June 2006, we [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=commit;h=da2f4d679c8070ba5b6a920281e495917b293aa0 converted from EFSCORRUPTED/990 over to using EUCLEAN], &amp;quot;Structure needs cleaning.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The cause can be pretty much anything, unfortunately - filesystem, virtual memory manager, volume manager, device driver, or hardware.&lt;br /&gt;
&lt;br /&gt;
There should be a detailed console message when this initially happens. The messages have important information giving hints to developers as to the earliest point that a problem was detected. It is there to protect your data.&lt;br /&gt;
&lt;br /&gt;
You can use xfs_check and xfs_repair to remedy the problem (with the file system unmounted).&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I see binary NULLS in some files after recovery when I unplugged the power? ==&lt;br /&gt;
&lt;br /&gt;
Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1.&lt;br /&gt;
&lt;br /&gt;
XFS journals metadata updates, not data updates. After a crash you are supposed to get a consistent filesystem which looks like the state sometime shortly before the crash, NOT what the in memory image looked like the instant before the crash.&lt;br /&gt;
&lt;br /&gt;
Since XFS does not write data out immediately unless you tell it to with fsync, an O_SYNC or O_DIRECT open (the same is true of other filesystems), you are looking at an inode which was flushed out, but whose data was not. Typically you&#039;ll find that the inode is not taking any space since all it has is a size but no extents allocated (try examining the file with the &#039;&#039;&#039;xfs_bmap(8)&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
== Q: What is the problem with the write cache on journaled filesystems? ==&lt;br /&gt;
&lt;br /&gt;
Many drives use a write back cache in order to speed up the performance of writes.  However, there are conditions such as power failure when the write cache memory is never flushed to the actual disk.  Further, the drive can de-stage data from the write cache to the platters in any order that it chooses.  This causes problems for XFS and journaled filesystems in general because they rely on knowing when a write has completed to the disk. They need to know that the log information has made it to disk before allowing metadata to go to disk.  When the metadata makes it to disk then the transaction can effectively be deleted from the log resulting in movement of the tail of the log and thus freeing up some log space. So if the writes never make it to the physical disk, then the ordering is violated and the log and metadata can be lost, resulting in filesystem corruption.&lt;br /&gt;
&lt;br /&gt;
With hard disk cache sizes of currently (Jan 2009) up to 32MB that can be a lot of valuable information.  In a RAID with 8 such disks these adds to 256MB, and the chance of having filesystem metadata in the cache is so high that you have a very high chance of big data losses on a power outage.&lt;br /&gt;
&lt;br /&gt;
With a single hard disk and barriers turned on (on=default), the drive write cache is flushed before and after a barrier is issued.  A powerfail &amp;quot;only&amp;quot; loses data in the cache but no essential ordering is violated, and corruption will not occur.&lt;br /&gt;
&lt;br /&gt;
With a RAID controller with battery backed controller cache and cache in write back mode, you should turn off barriers - they are unnecessary in this case, and if the controller honors the cache flushes, it will be harmful to performance.  But then you *must* disable the individual hard disk write cache in order to ensure to keep the filesystem intact after a power failure. The method for doing this is different for each RAID controller. See the section about RAID controllers below.&lt;br /&gt;
&lt;br /&gt;
== Q: How can I tell if I have the disk write cache enabled? ==&lt;br /&gt;
&lt;br /&gt;
For SCSI/SATA:&lt;br /&gt;
&lt;br /&gt;
* Look in dmesg(8) output for a driver line, such as:&amp;lt;br /&amp;gt; &amp;quot;SCSI device sda: drive cache: write back&amp;quot;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# sginfo -c /dev/sda | grep -i &#039;write cache&#039; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For PATA/SATA (although for SATA this only works on a recent kernel with ATA command passthrough):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -I /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; and look under &amp;quot;Enabled Supported&amp;quot; for &amp;quot;Write cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
== Q: How can I address the problem with the disk write cache? ==&lt;br /&gt;
&lt;br /&gt;
=== Disabling the disk write back cache. ===&lt;br /&gt;
&lt;br /&gt;
For SATA/PATA(IDE): (although for SATA this only works on a recent kernel with ATA command passthrough):&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# hdparm -W0 /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # hdparm -W0 /dev/hda&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;# blktool /dev/sda wcache off&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; # blktool /dev/hda wcache off&lt;br /&gt;
&lt;br /&gt;
For SCSI:&lt;br /&gt;
&lt;br /&gt;
* Using sginfo(8) which is a little tedious&amp;lt;br /&amp;gt; It takes 3 steps. For example:&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -c /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives a list of attribute names and values&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cX /dev/sda&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; which gives an array of cache values which you must match up with from step 1, e.g.&amp;lt;br /&amp;gt; 0 0 0 1 0 1 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&lt;br /&gt;
*# &amp;lt;nowiki&amp;gt;#sginfo -cXR /dev/sda 0 0 0 1 0 0 0 0 0 0 65535 0 65535 65535 1 0 0 0 3 0 0&amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt; allows you to reset the value of the cache attributes.&lt;br /&gt;
&lt;br /&gt;
For RAID controllers:&lt;br /&gt;
&lt;br /&gt;
* See the section about RAID controllers below&lt;br /&gt;
&lt;br /&gt;
This disabling is kept persistent for a SCSI disk. However, for a SATA/PATA disk this needs to be done after every reset as it will reset back to the default of the write cache enabled. And a reset can happen after reboot or on error recovery of the drive. This makes it rather difficult to guarantee that the write cache is maintained as disabled.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using an external log. ===&lt;br /&gt;
&lt;br /&gt;
Some people have considered the idea of using an external log on a separate drive with the write cache disabled and the rest of the file system on another disk with the write cache enabled. However, that will &#039;&#039;&#039;not&#039;&#039;&#039; solve the problem. For example, the tail of the log is moved when we are notified that a metadata write is completed to disk and we won&#039;t be able to guarantee that if the metadata is on a drive with the write cache enabled.&lt;br /&gt;
&lt;br /&gt;
In fact using an external log will disable XFS&#039; write barrier support.&lt;br /&gt;
&lt;br /&gt;
=== Write barrier support. ===&lt;br /&gt;
&lt;br /&gt;
Write barrier support is enabled by default in XFS since kernel version 2.6.17. It is disabled by mounting the filesystem with &amp;quot;nobarrier&amp;quot;. Barrier support will flush the write back cache at the appropriate times (such as on XFS log writes). This is generally the recommended solution, however, you should check the system logs to ensure it was successful. Barriers will be disabled and reported in the log if any of the 3 scenarios occurs:&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported with external log device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, not supported by the underlying device&amp;quot;&lt;br /&gt;
* &amp;quot;Disabling barriers, trial barrier write failed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the filesystem is mounted with an external log device then we currently don&#039;t support flushing to the data and log devices (this may change in the future). If the driver tells the block layer that the device does not support write cache flushing with the write cache enabled then it will report that the device doesn&#039;t support it. And finally we will actually test out a barrier write on the superblock and test its error state afterwards, reporting if it fails.&lt;br /&gt;
&lt;br /&gt;
== Q. Should barriers be enabled with storage which has a persistent write cache? ==&lt;br /&gt;
&lt;br /&gt;
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with &amp;quot;nobarrier&amp;quot;. But take care about the hard disk write cache, which should be off.&lt;br /&gt;
&lt;br /&gt;
== Q. Which settings does my RAID controller need ? ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s hard to tell because there are so many controllers. Please consult your RAID controller documentation to determine how to change these settings, but we try to give an overview here:&lt;br /&gt;
&lt;br /&gt;
Real RAID controllers (not those found onboard of mainboards) normally have a battery backed cache (or an [http://en.wikipedia.org/wiki/Electric_double-layer_capacitor ultracapacitor] + flash memory &amp;quot;[http://www.tweaktown.com/articles/2800/adaptec_zero_maintenance_cache_protection_explained/ zero maintenance cache]&amp;quot;) which is used for buffering writes to improve speed. Even if it&#039;s battery backed, the individual hard disk write caches need to be turned off, as they are not protected from a powerfail and will just lose all contents in that case.&lt;br /&gt;
&lt;br /&gt;
* onboard RAID controllers: there are so many different types it&#039;s hard to tell. Generally, those controllers have no cache, but let the hard disk write cache on. That can lead to the bad situation that after a powerfail with RAID-1 when only parts of the disk cache have been written, the controller doesn&#039;t even see that the disks are out of sync, as the disks can resort cached blocks and might have saved the superblock info, but then lost different data contents. So, turn off disk write caches before using the RAID function.&lt;br /&gt;
&lt;br /&gt;
* 3ware: /cX/uX set cache=off, see http://www.3ware.com/support/UserDocs/CLIGuide-9.5.1.1.pdf , page 86&lt;br /&gt;
&lt;br /&gt;
* Adaptec: allows setting individual drives cache&lt;br /&gt;
arcconf setcache &amp;lt;disk&amp;gt; wb|wt&lt;br /&gt;
wb=write back, which means write cache on, wt=write through, which means write cache off. So &amp;quot;wt&amp;quot; should be chosen.&lt;br /&gt;
&lt;br /&gt;
* Areca: In archttp under &amp;quot;System Controls&amp;quot; -&amp;gt; &amp;quot;System Configuration&amp;quot; there&#039;s the option &amp;quot;Disk Write Cache Mode&amp;quot; (defaults &amp;quot;Auto&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Off&amp;quot;: disk write cache is turned off&lt;br /&gt;
&lt;br /&gt;
&amp;quot;On&amp;quot;: disk write cache is enabled, this is not save for your data but fast&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Auto&amp;quot;: If you use a BBM (battery backup module, which you really should use if you care about your data), the controller automatically turns disk writes off, to protect your data. In case no BBM is attached, the controller switches to &amp;quot;On&amp;quot;, because neither controller cache nor disk cache is save so you don&#039;t seem to care about your data and just want high speed (which you get then).&lt;br /&gt;
&lt;br /&gt;
That&#039;s a very sensible default so you can let it &amp;quot;Auto&amp;quot; or enforce &amp;quot;Off&amp;quot; to be sure.&lt;br /&gt;
&lt;br /&gt;
* LSI MegaRAID: allows setting individual disks cache:&lt;br /&gt;
MegaCli -AdpCacheFlush -aN|-a0,1,2|-aALL -EnDskCache|DisDskCache&lt;br /&gt;
&lt;br /&gt;
* Xyratex: from the docs: &amp;quot;Write cache includes the disk drive cache and controller cache.&amp;quot;. So that means you can only set the drive caches and the unit caches together. To protect your data, turn it off, but write performance will suffer badly as also the controller write cache is disabled.&lt;br /&gt;
&lt;br /&gt;
== Q: Which settings are best with virtualization like VMware, XEN, qemu? ==&lt;br /&gt;
&lt;br /&gt;
The biggest problem is that those products seem to also virtualize disk &lt;br /&gt;
writes in a way that even barriers don&#039;t work anymore, which means even &lt;br /&gt;
a fsync is not reliable. Tests confirm that unplugging the power from &lt;br /&gt;
such a system even with RAID controller with battery backed cache and &lt;br /&gt;
hard disk cache turned off (which is save on a normal host) you can &lt;br /&gt;
destroy a database within the virtual machine (client, domU whatever you &lt;br /&gt;
call it).&lt;br /&gt;
&lt;br /&gt;
In qemu you can specify cache=off on the line specifying the virtual &lt;br /&gt;
disk. For others information is missing.&lt;br /&gt;
&lt;br /&gt;
== Q: What is the issue with directory corruption in Linux 2.6.17? ==&lt;br /&gt;
&lt;br /&gt;
In the Linux kernel 2.6.17 release a subtle bug was accidentally introduced into the XFS directory code by some &amp;quot;sparse&amp;quot; endian annotations. This bug was sufficiently uncommon (it only affects a certain type of format change, in Node or B-Tree format directories, and only in certain situations) that it was not detected during our regular regression testing, but it has been observed in the wild by a number of people now.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: the fix is included in 2.6.17.7 and later kernels.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To add insult to injury, &#039;&#039;&#039;xfs_repair(8)&#039;&#039;&#039; is currently not correcting these directories on detection of this corrupt state either. This &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; issue is actively being worked on, and a fixed version will be available shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Update: a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; is now available; version 2.8.10 or later of the xfsprogs package contains the fixed version.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
No other kernel versions are affected. However, using a corrupt filesystem on other kernels can still result in the filesystem being shutdown if the problem has not been rectified (on disk), making it seem like other kernels are affected.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;xfs_check&#039;&#039;&#039; tool, or &#039;&#039;&#039;xfs_repair -n&#039;&#039;&#039;, should be able to detect any directory corruption.&lt;br /&gt;
&lt;br /&gt;
Until a fixed &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; binary is available, one can make use of the &#039;&#039;&#039;xfs_db(8)&#039;&#039;&#039; command to mark the problem directory for removal (see the example below). A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; invocation will remove the directory and move all contents into &amp;quot;lost+found&amp;quot;, named by inode number (see second example on how to map inode number to directory entry name, which needs to be done _before_ removing the directory itself). The inode number of the corrupt directory is included in the shutdown report issued by the kernel on detection of directory corruption. Using that inode number, this is how one would ensure it is removed:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 core.mode = 040755&lt;br /&gt;
 core.version = 2&lt;br /&gt;
 core.format = 3 (btree)&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; write core.mode 0&lt;br /&gt;
 xfs_db&amp;amp;gt; quit&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A subsequent &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; will clear the directory, and add new entries (named by inode number) in lost+found.&lt;br /&gt;
&lt;br /&gt;
The easiest way to map inode numbers to full paths is via &#039;&#039;&#039;xfs_ncheck(8)&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_ncheck -i 14101 -i 14102 /dev/sdXXX&lt;br /&gt;
       14101 full/path/mumble_fratz_foo_bar_1495&lt;br /&gt;
       14102 full/path/mumble_fratz_foo_bar_1494&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this not work, we can manually map inode numbers in B-Tree format directory by taking the following steps:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 # xfs_db -x /dev/sdXXX&lt;br /&gt;
 xfs_db&amp;amp;gt; inode NNN&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 core.magic = 0x494e&lt;br /&gt;
 ...&lt;br /&gt;
 next_unlinked = null&lt;br /&gt;
 u.bmbt.level = 1&lt;br /&gt;
 u.bmbt.numrecs = 1&lt;br /&gt;
 u.bmbt.keys[1] = [startoff] 1:[0]&lt;br /&gt;
 u.bmbt.ptrs[1] = 1:3628&lt;br /&gt;
 xfs_db&amp;amp;gt; fsblock 3628&lt;br /&gt;
 xfs_db&amp;amp;gt; type bmapbtd&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 magic = 0x424d4150&lt;br /&gt;
 level = 0&lt;br /&gt;
 numrecs = 19&lt;br /&gt;
 leftsib = null&lt;br /&gt;
 rightsib = null&lt;br /&gt;
 recs[1-19] = [startoff,startblock,blockcount,extentflag]&lt;br /&gt;
        1:[0,3088,4,0] 2:[4,3128,8,0] 3:[12,3308,4,0] 4:[16,3360,4,0]&lt;br /&gt;
        5:[20,3496,8,0] 6:[28,3552,8,0] 7:[36,3624,4,0] 8:[40,3633,4,0]&lt;br /&gt;
        9:[44,3688,8,0] 10:[52,3744,4,0] 11:[56,3784,8,0]&lt;br /&gt;
        12:[64,3840,8,0] 13:[72,3896,4,0] 14:[33554432,3092,4,0]&lt;br /&gt;
        15:[33554436,3488,8,0] 16:[33554444,3629,4,0]&lt;br /&gt;
        17:[33554448,3748,4,0] 18:[33554452,3900,4,0]&lt;br /&gt;
        19:[67108864,3364,4,0]&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we are looking at the extents that hold all of the directory information. There are three types of extent here, we have the data blocks (extents 1 through 13 above), then the leaf blocks (extents 14 through 18), then the freelist blocks (extent 19 above). The jumps in the first field (start offset) indicate our progression through each of the three types. For recovering file names, we are only interested in the data blocks, so we can now feed those offset numbers into the &#039;&#039;&#039;xfs_db&#039;&#039;&#039; dblock command. So, for the fifth extent - 5:[20,3496,8,0] - listed above:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 xfs_db&amp;amp;gt; dblock 20&lt;br /&gt;
 xfs_db&amp;amp;gt; print&lt;br /&gt;
 dhdr.magic = 0x58443244&lt;br /&gt;
 dhdr.bestfree[0].offset = 0&lt;br /&gt;
 dhdr.bestfree[0].length = 0&lt;br /&gt;
 dhdr.bestfree[1].offset = 0&lt;br /&gt;
 dhdr.bestfree[1].length = 0&lt;br /&gt;
 dhdr.bestfree[2].offset = 0&lt;br /&gt;
 dhdr.bestfree[2].length = 0&lt;br /&gt;
 du[0].inumber = 13937&lt;br /&gt;
 du[0].namelen = 25&lt;br /&gt;
 du[0].name = &amp;quot;mumble_fratz_foo_bar_1595&amp;quot;&lt;br /&gt;
 du[0].tag = 0x10&lt;br /&gt;
 du[1].inumber = 13938&lt;br /&gt;
 du[1].namelen = 25&lt;br /&gt;
 du[1].name = &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;&lt;br /&gt;
 du[1].tag = 0x38&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
So, here we can see that inode number 13938 matches up with name &amp;quot;mumble_fratz_foo_bar_1594&amp;quot;. Iterate through all the extents, and extract all the name-to-inode-number mappings you can, as these will be useful when looking at &amp;quot;lost+found&amp;quot; (once &#039;&#039;&#039;xfs_repair&#039;&#039;&#039; has removed the corrupt directory).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q: Why does my &amp;gt; 2TB XFS partition disappear when I reboot ? ==&lt;br /&gt;
&lt;br /&gt;
Strictly speaking this is not an XFS problem.&lt;br /&gt;
&lt;br /&gt;
To support &amp;gt; 2TB partitions you need two things: a kernel that supports large block devices (&amp;lt;tt&amp;gt;CONFIG_LBD=y&amp;lt;/tt&amp;gt;) and a partition table format that can hold large partitions.  The default DOS partition tables don&#039;t.  The best partition format for&lt;br /&gt;
&amp;gt; 2TB partitions is the EFI GPT format (&amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Without CONFIG_LBD=y you can&#039;t even create the filesystem, but without &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt; it works fine until you reboot at which point the partition will disappear.  Note that you need to enable the &amp;lt;tt&amp;gt;CONFIG_PARTITION_ADVANCED&amp;lt;/tt&amp;gt; option before you can set &amp;lt;tt&amp;gt;CONFIG_EFI_PARTITION=y&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Q: Why do I receive &amp;lt;tt&amp;gt;No space left on device&amp;lt;/tt&amp;gt; after &amp;lt;tt&amp;gt;xfs_growfs&amp;lt;/tt&amp;gt;? ==&lt;br /&gt;
&lt;br /&gt;
After [http://oss.sgi.com/pipermail/xfs/2009-January/039828.html growing a XFS filesystem], df(1) would show enough free space but attempts to write to the filesystem result in -ENOSPC. To fix this, [http://oss.sgi.com/pipermail/xfs/2009-January/039835.html Dave Chinner advised]:&lt;br /&gt;
&lt;br /&gt;
  The only way to fix this is to move data around to free up space&lt;br /&gt;
  below 1TB. Find your oldest data (i.e. that was around before even&lt;br /&gt;
  the first grow) and move it off the filesystem (move, not copy).&lt;br /&gt;
  Then if you copy it back on, the data blocks will end up above 1TB&lt;br /&gt;
  and that should leave you with plenty of space for inodes below 1TB.&lt;br /&gt;
  &lt;br /&gt;
  A complete dump and restore will also fix the problem ;)&lt;br /&gt;
&lt;br /&gt;
Also, you can add &#039;inode64&#039; to your mount options to allow inodes to live above 1TB.&lt;br /&gt;
&lt;br /&gt;
== Q: Is using noatime or/and nodiratime at mount time giving any performance benefits in xfs (or not using them performance decrease) ? ==&lt;br /&gt;
See: http://everything2.com/index.pl?node_id=1479435&lt;br /&gt;
&lt;br /&gt;
== Q: How to get around a bad inode repair is unable to clean up ==&lt;br /&gt;
&lt;br /&gt;
The trick is go in with xfs_db and mark the inode as a deleted, which will cause repair to clean it up and finish the remove process.&lt;br /&gt;
&lt;br /&gt;
  xfs_db -x -c &#039;inode XXX&#039; -c &#039;write core.nextents 0&#039; -c &#039;write core.size 0&#039; /dev/hdXX&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Consulting_Resources&amp;diff=2047</id>
		<title>Consulting Resources</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Consulting_Resources&amp;diff=2047"/>
		<updated>2009-09-09T19:24:50Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.digitalelves.com  Digital Elves Inc]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Main_Page&amp;diff=2030</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Main_Page&amp;diff=2030"/>
		<updated>2009-07-06T21:29:15Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- Welcome --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#C5C5FF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
Welcome to XFS.org. This site is set up to help with the XFS file system.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Information --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#E2EAFF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
== Information about XFS ==&lt;br /&gt;
&lt;br /&gt;
* [http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
* [[XFS FAQ]]&lt;br /&gt;
* [[XFS Status Updates]]&lt;br /&gt;
* [[XFS Papers and Documentation]]&lt;br /&gt;
* [[Linux Distributions shipping XFS]]&lt;br /&gt;
* [[XFS Rpm for RedHat]]&lt;br /&gt;
* [[XFS Companies]]&lt;br /&gt;
* [[OLD News]]&lt;br /&gt;
* [http://oss.sgi.com/projects/xfs/training/index.html Link to XFS training material]&lt;br /&gt;
* [http://en.wikipedia.org/wiki/XFS Wikipedia xfs page, good detailed information.]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Consulting --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#fffff0; align:right; &amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Professional XFS Consulting Services == &lt;br /&gt;
&lt;br /&gt;
[[Consulting Resources]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| width=&amp;quot;50%&amp;quot; style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Developers --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border:1px solid #dfdfdf; padding:0 1em 1em 1em; background-color:#F8F8FF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
== XFS Developer Resources ==&lt;br /&gt;
&lt;br /&gt;
* [[XFS email list and archives]]&lt;br /&gt;
* [http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
* [http://oss.sgi.com/bugzilla/ Bugzilla @ oss.sgi.com]&lt;br /&gt;
* [http://bugzilla.kernel.org/ Bugzilla @ kernel.org]&lt;br /&gt;
* [[Getting the latest source code]]&lt;br /&gt;
* [[Unfinished work]]&lt;br /&gt;
* [[Shrinking Support]]&lt;br /&gt;
* [[Ideas for XFS]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#meta: | u+4/+rib+YG96TifD0SN88xS84YSDm2cl61IU7ZIk9g= | verify-v1 }}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=2007</id>
		<title>Getting the latest source code</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=2007"/>
		<updated>2009-05-13T15:50:07Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* XFS cvs trees  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; XFS Released/Stable source &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mainline kernels&#039;&#039;&#039;&amp;lt;br /&amp;gt; XFS has been maintained in the official Linux kernel [http://www.kernel.org/ kernel trees] starting with [http://lkml.org/lkml/2003/12/8/35 Linux 2.4] and is frequently updated with the latest stable fixes and features from the SGI XFS development team.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Vendor kernels&#039;&#039;&#039;&amp;lt;br /&amp;gt; All modern Linux distributions include support for XFS. SGI actively works with [http://www.suse.com/  SUSE] to provide a supported version of XFS in that distribution.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XFS userspace&#039;&#039;&#039;&amp;lt;br /&amp;gt; Sgi also provides [ftp://oss.sgi.com/projects/xfs source code taballs] of the xfs userspace tools. These tarballs form the basis of the xfsprogs packages found in Linux distributions.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; Development and bleeding edge Development &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
[[XFS git howto]]&lt;br /&gt;
&lt;br /&gt;
Development git trees&lt;br /&gt;
&lt;br /&gt;
Current XFS kernel source&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=summary xfs]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/xfs&amp;lt;/pre&amp;gt;&lt;br /&gt;
XFS user space tools&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=summary xfsprogs]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/xfsprogs&amp;lt;/pre&amp;gt;&lt;br /&gt;
XFS dump&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsdump.git;a=summary xfsdump]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/xfsdump&amp;lt;/pre&amp;gt;&lt;br /&gt;
XFS tests&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfstests.git;a=summary xfstests]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/xfstests&amp;lt;/pre&amp;gt;&lt;br /&gt;
DMAPI user space tools&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/dmapi.git;a=summary dmapi]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/dmapi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Git trees are automated mirrored copies of the cvs trees using git-cvsimport.&lt;br /&gt;
Since git-cvsimport utilized the tool cvsps to recreate the atomic commits of ptools&lt;br /&gt;
or &amp;quot;mod&amp;quot; it is easier to see the entire change that was committed using git.&lt;br /&gt;
&lt;br /&gt;
git-cvsimport generated trees.&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=linux-2.6-xfs-from-cvs/.git;a=summary linux-2.6-xfs-from-cvs]&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs-cmds/.git;a=summary xfs-cmds]&lt;br /&gt;
&lt;br /&gt;
Before building in the xfsdump or dmapi directories (after building xfsprogs), you will need to run:&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd xfsprogs&lt;br /&gt;
# make install-dev&amp;lt;/pre&amp;gt;&lt;br /&gt;
to create /usr/include/xfs and install appropriate files there.&lt;br /&gt;
&lt;br /&gt;
Before building in the xfstests directory, you will need to run:&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd xfsprogs&lt;br /&gt;
# make install-qa&amp;lt;/pre&amp;gt;&lt;br /&gt;
to install a somewhat larger set of files in /usr/include/xfs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt;XFS cvs trees &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The cvs trees were created using a script that converted sgi&#039;s internal&lt;br /&gt;
ptools repository to a cvs repository, so the cvs trees were considered read only.&lt;br /&gt;
&lt;br /&gt;
At this point all new development is being managed by the git trees thus the cvs trees&lt;br /&gt;
are not longer active in terms of current development and should only be used&lt;br /&gt;
for reference.&lt;br /&gt;
&lt;br /&gt;
[[XFS CVS howto]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_email_list_and_archives&amp;diff=1944</id>
		<title>XFS email list and archives</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_email_list_and_archives&amp;diff=1944"/>
		<updated>2009-01-09T04:07:42Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== XFS email list ==&lt;br /&gt;
Patches, comments, requests and questions should go to:&lt;br /&gt;
&lt;br /&gt;
[mailto:xfs@oss.sgi.com xfs@oss.sgi.com]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/archives/xfs List archives]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/pipermail/xfs List archives using pipermail]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Subscribing to the list ==&lt;br /&gt;
&lt;br /&gt;
The easiest method is to use the mailman web interface.&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/mailman/listinfo/xfs http://oss.sgi.com/mailman/listinfo/xfs]&lt;br /&gt;
&lt;br /&gt;
The email interface is also available by sending and email with the body:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;subscribe&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
to [mailto:xfs-request@oss.sgi.com xfs-request@oss.sgi.com]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=OLD_News&amp;diff=1943</id>
		<title>OLD News</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=OLD_News&amp;diff=1943"/>
		<updated>2009-01-08T23:42:54Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: {| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;2&amp;quot; | bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; July-2007 &amp;lt;/font&amp;gt; | bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Next r...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; July-2007 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Next round of xfs_repair(8) performance improvements (xfsprogs 2.9.2 onwards). It substantially improves the I/O performance compared to previous versions through the use of batch reads, background metadata prefetching and smart priority based libxfs caching. Lost+found behaviour has also been changed and will not re-orphan existing lost+found files. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; July-2007 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added new data allocator called &amp;quot;filestreams&amp;quot; to 2.6.22 kernels. It allows a directory to reserve an allocation group for exclusive use by files created within that directory. Files being written in other directories will not use the same allocation group and so files within different directories will not interleave extents on disk. The reservation is only active while files are being created and written into the directory. Filestreams can be enabled filesystem wide with a &amp;quot;-o filestreams&amp;quot; mount option, or on a per directory basis with an xfs_io(8) chattr flag. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; June-2007 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added a new tool, xfs_metadump(8), to capture the metadata of a corrupted filesystem for implementing improvements to xfs_repair(8). &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2007 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Released &amp;quot;Lazy Superblock Counters&amp;quot; which significantly improves transaction intensive workloads which operate on the free space and inode usage counters in the superblock. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; March-2007 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Fixed the notorious &amp;quot;NULL files&amp;quot; problem after a crash. The fix improves the syncronisation between updates of the file size and writes that extend a file. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; January-2007 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added [training/index.html XFS Training course] (still under development) and the documentation for the [papers/xfs_filesystem_structure.pdf XFS ondisk format]. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; August-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added the paper &amp;quot;High Bandwidth Filesystems on Large Systems&amp;quot; which was presented at the Ottawa Linux Symposium in July 2006. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; July-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Several bulkstat related performance improvements, mostly improving DMAPI scans for filesystems with many millions of inodes, but also generic readahead improvements that will help other bulkstat users (e.g. xfsdump and quota). &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; July-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; SLES10 is released, with full XFS and DMAPI support. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; June-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; First round of xfs_repair(8) performance improvements, and buffer/inode caching now done in libxfs in preparation for a multi-threaded version of xfs_repair at a later date. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Additional inheritable inode flag (nodefrag) to allow specified inodes to be skipped by xfs_fsr(8). &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Updated the [http://oss.sgi.com/projects/xfs/faq.html#wcache FAQ] to discuss device write barriers. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Mar-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Incore extent management rework, more efficiently using memory when working with files with large numbers of extents. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Feb-2006 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Per-CPU superblock accounting, improving buffered I/O throughput significantly for parallel I/O workloads. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Dec-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Rework the page writeout code paths within XFS to make better use of advances in 2.6 kernels (page clustering and larger block I/O requests). &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Dec-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; SLES9 Service Pack 3 released with next set of XFS updates. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Nov-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Support for block layer write barriers, allowing devices to be used with their write cache enabled (2.6+ kernels). &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Nov-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Preferred extent size allocator hint for the B+ tree allocator. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Sep-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Support for inline extended attribute format 2, which significantly improves performance when using extended attributes. Driven by needs of the Samba folks for Samba version 4, but also helpful to many other people. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added support for project quota, and the ability to inherit project identifiers. Provides the mechanism for implementing a form of directory tree quota. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Merged all XFS fixes since SP1 into SLES9 SP2. Thanks Andreas! &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; [http://people.freebsd.org/~rodrigc/xfs/ XFS for FreeBSD] website announced (an independent porting effort not sponsored by SGI), supported by FreeBSD developers Craig Rodrigues and Alexander Kabaev. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jan-2005 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Support use of 64 bit inode numbers with NFS. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Dec-2004 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added ihashsize mount option and reworked inode hash sizing algorithms for improved scalability. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Oct-2004 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS web pages updated for the first time in several years. (*cough*) &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Oct-2004 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Merged all XFS fixes since 2.6.5 into SLES9 Service Pack 1. Thanks Andreas! &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Feb-2004 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS is merged into Marcelo&#039;s 2.4.25 kernel. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Dec-2003 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; 2.6.0 kernel is released, with full XFS support. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Oct-2003 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added support for allocation groups larger than four gigabytes (up to 1 terabyte per AG supported now). Big scalability improvement for large filesystems. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Sep-2003 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Additional per-inode flags introduced (immutable, append-only, noatime, nodump, sync). &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Aug-2003 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.3 is released. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Apr-2003 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS merged in Alan Cox&#039;s 2.4.21-rc1-ac3 kernel. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Feb-2003 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.2 is released. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Dec-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added support for sector sizes larger than 512 bytes. Particularly useful with MD RAID5 setups, significant performance win when a sector size matching the block size is used. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Sep-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS is merged into Linus&#039; 2.5 development tree. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Added support for version 2 logs, allowing larger incore log buffers and log write alignment. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS quota syscall support and VFS interfaces merged in 2.5. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Apr-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; SuSE 8.0 is available with native XFS support. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Apr-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.1 is released. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Feb-2002 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Extended attribute syscalls and VFS interfaces merged in 2.5. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Nov-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Work starts on the 2.5 kernel tree. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Nov-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.0.2 Release &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Sep-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Mandrake 8.1 is available with native XFS support. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jul-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.0.1 Release &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Debian &amp;quot;Woody&amp;quot; XFS install discs are now available. Thanks Zoltan! &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.0 patches now in the Debian testing (&amp;quot;Woody&amp;quot;) distribution. Thanks again to Ed Boraas. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.0 patches now in the Debian unstable (&amp;quot;Sid&amp;quot;) distribution. Thanks go out to Ed Boraas. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Mandrake packages are now available, thanks to Chmouel Boudjnah. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Debian kernel packages available from Marcos Pinto. Thanks! &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; May-2001 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS 1.0 Release &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Sep-2000 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS Beta Release &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Aug-2000 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Initial FAQ now available, thanks to Thomas Graichen. &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2000 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Usenix 2000: Porting XFS to Linux talk &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Jun-2000 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Usenix 2000 XFS pre-beta ISO image available &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Apr-2000 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Web interface to CVS repository now available &amp;lt;/font&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| bgcolor=&amp;quot;#88ee88&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; Mar-2000 &amp;lt;/font&amp;gt;&lt;br /&gt;
| bgcolor=&amp;quot;#99cccc&amp;quot; valign=&amp;quot;top&amp;quot; | &amp;lt;font face=&amp;quot;Helvetica, Arial&amp;quot;&amp;gt; XFS source code officially available! &amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Main_Page&amp;diff=1942</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Main_Page&amp;diff=1942"/>
		<updated>2009-01-08T23:42:20Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* Information about XFS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to XFS.org ==&lt;br /&gt;
&lt;br /&gt;
This site is set up to help with the XFS file system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information about XFS ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Xfs Wikipedia xfs page, good detailed information.]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[[XFS FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Status Updates]]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs/training/index.html Link to XFS training material]&lt;br /&gt;
&lt;br /&gt;
[[XFS Papers and Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Linux Distributions shipping XFS]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Rpm for RedHat]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Companies]]&lt;br /&gt;
&lt;br /&gt;
[[OLD News]]&lt;br /&gt;
&lt;br /&gt;
{{#widget:Ohloh Project|id=xfs|type=thin_badge}}&lt;br /&gt;
&lt;br /&gt;
== XFS Developer Resources ==&lt;br /&gt;
&lt;br /&gt;
[[ XFS email list and archives ]]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/bugzilla/ Bugzilla @ oss.sgi.com]&lt;br /&gt;
&lt;br /&gt;
[http://bugzilla.kernel.org/ Bugzilla @ kernel.org]&lt;br /&gt;
&lt;br /&gt;
[[Getting the latest source code]]&lt;br /&gt;
&lt;br /&gt;
[[Unfinished work]]&lt;br /&gt;
&lt;br /&gt;
[[Shrinking Support]]&lt;br /&gt;
&lt;br /&gt;
[[Ideas for XFS from Dave Chinner]]&lt;br /&gt;
&lt;br /&gt;
== Professional XFS Consulting Services == &lt;br /&gt;
&lt;br /&gt;
[[ Consulting Resources ]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_email_list_and_archives&amp;diff=1941</id>
		<title>XFS email list and archives</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_email_list_and_archives&amp;diff=1941"/>
		<updated>2009-01-08T23:07:24Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== XFS email list ==&lt;br /&gt;
Patches, comments, requests and questions should go to:&lt;br /&gt;
&lt;br /&gt;
[mailto:xfs@oss.sgi.com xfs@oss.sgi.com]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/archives/xfs List archives]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/pipermail/xfs List archives using pipermail]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Subscribing to the list ==&lt;br /&gt;
&lt;br /&gt;
The easiest method is to use the mailman web interface.&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/mailmain/listinfo/xfs http://oss.sgi.com/mailmain/listinfo/xfs]&lt;br /&gt;
&lt;br /&gt;
The email interface is also available by sending and email with the body:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;subscribe&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
to [mailto:xfs-request@oss.sgi.com xfs-request@oss.sgi.com]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_email_list_and_archives&amp;diff=1940</id>
		<title>XFS email list and archives</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_email_list_and_archives&amp;diff=1940"/>
		<updated>2009-01-08T23:06:10Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: == XFS email list == Patches, comments, requests and questions should go to:  [mailto:xfs@oss.sgi.com xfs@oss.sgi.com]  [http://oss.sgi.com/archives/xfs List archives]   == Subscribing to ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== XFS email list ==&lt;br /&gt;
Patches, comments, requests and questions should go to:&lt;br /&gt;
&lt;br /&gt;
[mailto:xfs@oss.sgi.com xfs@oss.sgi.com]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/archives/xfs List archives]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Subscribing to the list ==&lt;br /&gt;
&lt;br /&gt;
The easiest method is to use the mailman web interface.&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/mailmain/listinfo/xfs http://oss.sgi.com/mailmain/listinfo/xfs]&lt;br /&gt;
&lt;br /&gt;
The email interface is also available by sending and email with the body:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;subscribe&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
to [mailto:xfs-request@oss.sgi.com xfs-request@oss.sgi.com]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Main_Page&amp;diff=1939</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Main_Page&amp;diff=1939"/>
		<updated>2009-01-08T22:26:17Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* XFS Developer Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to XFS.org ==&lt;br /&gt;
&lt;br /&gt;
This site is set up to help with the XFS file system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information about XFS ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Xfs Wikipedia xfs page, good detailed information.]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[[XFS FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Status Updates]]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs/training/index.html Link to XFS training material]&lt;br /&gt;
&lt;br /&gt;
[[XFS Papers and Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Linux Distributions shipping XFS]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Rpm for RedHat]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Companies]]&lt;br /&gt;
&lt;br /&gt;
{{#widget:Ohloh Project|id=xfs|type=thin_badge}}&lt;br /&gt;
&lt;br /&gt;
== XFS Developer Resources ==&lt;br /&gt;
&lt;br /&gt;
[[ XFS email list and archives ]]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/bugzilla/ Bugzilla @ oss.sgi.com]&lt;br /&gt;
&lt;br /&gt;
[http://bugzilla.kernel.org/ Bugzilla @ kernel.org]&lt;br /&gt;
&lt;br /&gt;
[[Getting the latest source code]]&lt;br /&gt;
&lt;br /&gt;
[[Unfinished work]]&lt;br /&gt;
&lt;br /&gt;
[[Shrinking Support]]&lt;br /&gt;
&lt;br /&gt;
[[Ideas for XFS from Dave Chinner]]&lt;br /&gt;
&lt;br /&gt;
== Professional XFS Consulting Services == &lt;br /&gt;
&lt;br /&gt;
[[ Consulting Resources ]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Main_Page&amp;diff=1938</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Main_Page&amp;diff=1938"/>
		<updated>2009-01-08T21:55:04Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* XFS Developer Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to XFS.org ==&lt;br /&gt;
&lt;br /&gt;
This site is set up to help with the XFS file system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information about XFS ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Xfs Wikipedia xfs page, good detailed information.]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[[XFS FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Status Updates]]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs/training/index.html Link to XFS training material]&lt;br /&gt;
&lt;br /&gt;
[[XFS Papers and Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Linux Distributions shipping XFS]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Rpm for RedHat]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Companies]]&lt;br /&gt;
&lt;br /&gt;
{{#widget:Ohloh Project|id=xfs|type=thin_badge}}&lt;br /&gt;
&lt;br /&gt;
== XFS Developer Resources ==&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/archives/xfs xfs@oss.sgi.com mailing list archives]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/bugzilla/ Bugzilla @ oss.sgi.com]&lt;br /&gt;
&lt;br /&gt;
[http://bugzilla.kernel.org/ Bugzilla @ kernel.org]&lt;br /&gt;
&lt;br /&gt;
[[Getting the latest source code]]&lt;br /&gt;
&lt;br /&gt;
[[Unfinished work]]&lt;br /&gt;
&lt;br /&gt;
[[Shrinking Support]]&lt;br /&gt;
&lt;br /&gt;
[[Ideas for XFS from Dave Chinner]]&lt;br /&gt;
&lt;br /&gt;
== Professional XFS Consulting Services == &lt;br /&gt;
&lt;br /&gt;
[[ Consulting Resources ]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Main_Page&amp;diff=1937</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Main_Page&amp;diff=1937"/>
		<updated>2009-01-08T21:54:18Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: /* XFS Developer Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to XFS.org ==&lt;br /&gt;
&lt;br /&gt;
This site is set up to help with the XFS file system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information about XFS ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Xfs Wikipedia xfs page, good detailed information.]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[[XFS FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Status Updates]]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs/training/index.html Link to XFS training material]&lt;br /&gt;
&lt;br /&gt;
[[XFS Papers and Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Linux Distributions shipping XFS]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Rpm for RedHat]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Companies]]&lt;br /&gt;
&lt;br /&gt;
{{#widget:Ohloh Project|id=xfs|type=thin_badge}}&lt;br /&gt;
&lt;br /&gt;
== XFS Developer Resources ==&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/archives/xfs xfs@oss.sgi.com mailing list archives]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/bugzilla/ oss.sgi.com bugzilla]&lt;br /&gt;
&lt;br /&gt;
[http://bugzilla.kernel.org/ kernel.org bugzilla]&lt;br /&gt;
&lt;br /&gt;
[[Getting the latest source code]]&lt;br /&gt;
&lt;br /&gt;
[[Unfinished work]]&lt;br /&gt;
&lt;br /&gt;
[[Shrinking Support]]&lt;br /&gt;
&lt;br /&gt;
[[Ideas for XFS from Dave Chinner]]&lt;br /&gt;
&lt;br /&gt;
== Professional XFS Consulting Services == &lt;br /&gt;
&lt;br /&gt;
[[ Consulting Resources ]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=1936</id>
		<title>Getting the latest source code</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=1936"/>
		<updated>2009-01-08T21:52:13Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; XFS Released/Stable source &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mainline kernels&#039;&#039;&#039;&amp;lt;br /&amp;gt; XFS has been maintained in the official Linux kernel [http://www.kernel.org/ kernel trees] starting with Linux 2.4 and is frequently updated with the latest stable fixes and features from the SGI XFS development team.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Vendor kernels&#039;&#039;&#039;&amp;lt;br /&amp;gt; All modern Linux distributions include support for XFS. SGI actively works with [http://www.suse.com/  SUSE] to provide a supported version of XFS in that distribution.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;XFS userspace&#039;&#039;&#039;&amp;lt;br /&amp;gt; Sgi also provides [ftp://oss.sgi.com/projects/xfs source code taballs] of the xfs userspace tools. These tarballs form the basis of the xfsprogs packages found in Linux distributions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; Development and bleeding edge Development &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
[[XFS git howto]]&lt;br /&gt;
&lt;br /&gt;
Development git trees&lt;br /&gt;
&lt;br /&gt;
Current XFS kernel source&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs.git;a=summary xfs]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/xfs&amp;lt;/pre&amp;gt;&lt;br /&gt;
XFS user space tools&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsprogs.git;a=summary xfsprogs]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/xfsprogs&amp;lt;/pre&amp;gt;&lt;br /&gt;
XFS dump&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfsdump.git;a=summary xfsdump]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/xfsdump&amp;lt;/pre&amp;gt;&lt;br /&gt;
XFS tests&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/xfstests.git;a=summary xfstests]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/xfstests&amp;lt;/pre&amp;gt;&lt;br /&gt;
DMAPI user space tools&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/cmds/dmapi.git;a=summary dmapi]&lt;br /&gt;
&amp;lt;pre&amp;gt;$ git clone git://oss.sgi.com/xfs/cmds/dmapi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Git trees are automated mirrored copied of the cvs trees using git-cvsimport.&lt;br /&gt;
Since git-cvsimport utilized the tool cvsps to recreate the atomic commits of ptools&lt;br /&gt;
or &amp;quot;mod&amp;quot; it is easier to see the entire change that was committed using git.&lt;br /&gt;
&lt;br /&gt;
git-cvsimport generated trees.&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=linux-2.6-xfs-from-cvs/.git;a=summary linux-2.6-xfs-from-cvs]&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs-cmds/.git;a=summary xfs-cmds]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt;XFS cvs trees &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The cvs trees were created using a script that converted sgi&#039;s internal&lt;br /&gt;
ptools repository to a cvs repository, so the cvs trees were considered read only.&lt;br /&gt;
&lt;br /&gt;
At this point a new development is being managed by the git trees so the cvs trees&lt;br /&gt;
are not longer active in terms of current development and should only be used&lt;br /&gt;
for reference.&lt;br /&gt;
&lt;br /&gt;
[[XFS CVS howto]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_CVS_howto&amp;diff=1935</id>
		<title>XFS CVS howto</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_CVS_howto&amp;diff=1935"/>
		<updated>2009-01-08T17:30:28Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: = &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; XFS: Source Code &amp;lt;/font&amp;gt; =  * &amp;#039;&amp;#039;&amp;#039;CVS web&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt; Browse the XFS source trees. ** [http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/ 2.6.x-xfs] **...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; XFS: Source Code &amp;lt;/font&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;CVS web&#039;&#039;&#039;&amp;lt;br /&amp;gt; Browse the XFS source trees.&lt;br /&gt;
** [http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/ 2.6.x-xfs]&lt;br /&gt;
** [http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/ xfs-cmds]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;CVS trees&#039;&#039;&#039;&amp;lt;br /&amp;gt; Direct CVS access to the most recent XFS changes. See below.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; Using CVS trees &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
The cvs trees are automated mirrors of the SGI internal ptools manage source trees.&lt;br /&gt;
&lt;br /&gt;
[http://www.cvshome.org/new_users.html CVS for new users] contains links to general CVS documentation.&lt;br /&gt;
&lt;br /&gt;
Set the CVSROOT environment variable.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
| bgcolor=&amp;quot;#DFDFDF&amp;quot; | &amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;$ export CVSROOT=&#039;:pserver:cvs@oss.sgi.com:/cvs&#039;&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;&#039;&#039;(for sh, bash, ksh, or similar shells)&#039;&#039;&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;$ setenv CVSROOT :pserver:cvs@oss.sgi.com:/cvs&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;&#039;&#039;(for csh or tcsh shells)&#039;&#039;&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Login to the CVS server (this only needs to be done ONCE, not every time you access CVS).&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
| bgcolor=&amp;quot;#DFDFDF&amp;quot; | &amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;$ cvs login&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&#039;&#039;(the password is &amp;quot;&#039;&#039;cvs&#039;&#039;&amp;quot;)&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Now grab the XFS source tree(s) of interest:&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
| bgcolor=&amp;quot;#DFDFDF&amp;quot; | &amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;$ cvs checkout linux-2.6-xfs&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;$ cvs checkout xfs-cmds&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Subsequently, you can checkout new code using:&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;2&amp;quot;&lt;br /&gt;
| bgcolor=&amp;quot;#DFDFDF&amp;quot; | &amp;lt;br /&amp;gt;&amp;lt;tt&amp;gt;$ cvs update -d&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=1934</id>
		<title>Getting the latest source code</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Getting_the_latest_source_code&amp;diff=1934"/>
		<updated>2009-01-08T17:29:01Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt; Using GIT trees &amp;lt;/font&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
[[XFS git howto]]&lt;br /&gt;
&lt;br /&gt;
The Git trees are automated mirrored copied of the cvs trees using git-cvsimport.&lt;br /&gt;
Since git-cvsimport utilized the tool cvsps to recreate the atomic commits of ptools&lt;br /&gt;
or &amp;quot;mod&amp;quot; it is easier to see the entire change that was committed using git.&lt;br /&gt;
&lt;br /&gt;
git-cvsimport generated trees.&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=linux-2.6-xfs-from-cvs/.git;a=summary linux-2.6-xfs-from-cvs]&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs-cmds/.git;a=summary xfs-cmds]&lt;br /&gt;
Changes headed for the main linux 2.6 tree, manual merges.&lt;br /&gt;
* [http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs/xfs-2.6.git;a=summary xfs-2.6]&lt;br /&gt;
&lt;br /&gt;
Cloning the git trees for local use:&lt;br /&gt;
{| width=&amp;quot;100%&amp;quot; cellspacing=&amp;quot;1&amp;quot;&lt;br /&gt;
| bgcolor=&amp;quot;#DFDFDF&amp;quot; | &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;$ git clone git://oss.sgi.com/linux-2.6-xfs-from-cvs&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;$ git clone git://oss.sgi.com/xfs-cmds&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;$ git clone git://oss.sgi.com/xfs/xfs-2.6&amp;lt;/tt&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;font face=&amp;quot;ARIAL NARROW,HELVETICA&amp;quot;&amp;gt;XFS cvs trees &amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cvs trees were created using a script that converted sgi&#039;s internal&lt;br /&gt;
ptools repository to a cvs repository, so the cvs trees were considered read only.&lt;br /&gt;
&lt;br /&gt;
At this point a new development is being managed by the git trees so the cvs trees&lt;br /&gt;
are not longer active in terms of current development and should only be used&lt;br /&gt;
for reference.&lt;br /&gt;
&lt;br /&gt;
[[XFS CVS howto]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Git&amp;diff=1933</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Git&amp;diff=1933"/>
		<updated>2009-01-08T17:06:02Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Git moved to XFS git howto: be a little more descriptive&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[XFS git howto]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=XFS_git_howto&amp;diff=1932</id>
		<title>XFS git howto</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=XFS_git_howto&amp;diff=1932"/>
		<updated>2009-01-08T17:06:02Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: Git moved to XFS git howto: be a little more descriptive&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Where is it? ==&lt;br /&gt;
&lt;br /&gt;
A git server is setup on oss.sgi.com which is serving&lt;br /&gt;
out of /oss/git.  A user, git, has been setup with the home directory&lt;br /&gt;
of /oss/git.  The xfs trees are located under /oss/git/xfs.  The main&lt;br /&gt;
development tree is a bare repository under /oss/git/xfs/xfs.git.  (So it&lt;br /&gt;
has no checked out files just the .git database files at the top&lt;br /&gt;
level) So far, it has a master, a mainline and an xfs-dev branch.&lt;br /&gt;
The master branch is used for the checking in of development, it&lt;br /&gt;
is mainline+latest XFS. xfs-dev will be set up to track ptools,&lt;br /&gt;
checkins are currently closed to that branch.&lt;br /&gt;
&lt;br /&gt;
== Checking out a tree: ==&lt;br /&gt;
    $ git clone git+ssh://oss.sgi.com/oss/git/xfs/xfs/&lt;br /&gt;
( for local trees you can use the path directly, if the machine is&lt;br /&gt;
running a git-daemon you can use git://, but that will not&lt;br /&gt;
auto-setup push syntax )&lt;br /&gt;
&lt;br /&gt;
this will clone the tree (all the commit objects), and checkout&lt;br /&gt;
the HEAD branch (master for our case, other branches can be seen&lt;br /&gt;
with git branch -a, to checkout a branch (local or remote) just&lt;br /&gt;
use:&lt;br /&gt;
    $ git checkout $branch&lt;br /&gt;
&lt;br /&gt;
== Tree Status: ==&lt;br /&gt;
    $ git status # lists modified, unmerged and untracked files.&lt;br /&gt;
    $ git log    # shows all commited modifications&lt;br /&gt;
( you can use git log $remote/branch to see the log of a remote )&lt;br /&gt;
&lt;br /&gt;
== Modifying files before checkins: ==&lt;br /&gt;
no need to mark files for modification, git will find out&lt;br /&gt;
about them automagically, just edit them.&lt;br /&gt;
    $ git add file # add&lt;br /&gt;
    $ git rm file  # remove&lt;br /&gt;
&lt;br /&gt;
    Note: that if one uses &amp;quot;git-commit -a&amp;quot; or &amp;quot;git-finalize -a&amp;quot;&lt;br /&gt;
    then you don&#039;t have to add files which have been modified or&lt;br /&gt;
    deleted as git will detect them, you only have to add new files.&lt;br /&gt;
&lt;br /&gt;
== Commiting/checking in: ==&lt;br /&gt;
    $ git commit&lt;br /&gt;
From man page - useful options:&lt;br /&gt;
--------------------------------&lt;br /&gt;
    -a|--all::&lt;br /&gt;
    Tell the command to automatically stage files that have&lt;br /&gt;
    been modified and deleted, but new files you have not&lt;br /&gt;
    told git about are not affected.&lt;br /&gt;
&lt;br /&gt;
    --amend::&lt;br /&gt;
    Used to amend the tip of the current branch. Prepare the tree&lt;br /&gt;
    object you would want to replace the latest commit as usual&lt;br /&gt;
    (this includes the usual -i/-o and explicit paths), and the&lt;br /&gt;
    commit log editor is seeded with the commit message from the&lt;br /&gt;
    tip of the current branch. The commit you create replaces the&lt;br /&gt;
    current tip -- if it was a merge, it will have the parents of&lt;br /&gt;
    the current tip as parents -- so the current top commit is&lt;br /&gt;
    discarded.&lt;br /&gt;
&lt;br /&gt;
    -s|--signoff::&lt;br /&gt;
    Add Signed-off-by line at the end of the commit message.&lt;br /&gt;
&lt;br /&gt;
I do like to git commit -asm &amp;quot;Commit message&amp;quot;&lt;br /&gt;
--------------------------------&lt;br /&gt;
remember that a git commit, only commits to YOUR local tree, you&lt;br /&gt;
then need to push things over:&lt;br /&gt;
&lt;br /&gt;
General form is:&lt;br /&gt;
    $ git push git://uri/of/the/other/rep +refspec&lt;br /&gt;
    &lt;br /&gt;
    $ git push oss&lt;br /&gt;
&lt;br /&gt;
Where in xfs/.git/config it has the few lines:&lt;br /&gt;
&lt;br /&gt;
    [remote &amp;quot;oss&amp;quot;]&lt;br /&gt;
    url = ssh://oss.sgi.com/oss/git/xfs/xfs.git&lt;br /&gt;
    push = master&lt;br /&gt;
&lt;br /&gt;
(Or modify the config file using &amp;quot;git remote add&amp;quot; mentioned below)&lt;br /&gt;
&lt;br /&gt;
== Going back in history - changing one&#039;s mind ==&lt;br /&gt;
[the STUPID (ptools) way]&lt;br /&gt;
    $ git revert $mod&lt;br /&gt;
will introduce a new commit reverting $mod.&lt;br /&gt;
&lt;br /&gt;
[ the OH GOD WE ARE DISTRIBUTED way (for mods not pushed anyway)]&lt;br /&gt;
&lt;br /&gt;
if the mods to revert are the last n one:&lt;br /&gt;
    $ git reset HEAD^n&lt;br /&gt;
&lt;br /&gt;
if not (dangerous)&lt;br /&gt;
    $ git rebase -i $mod^1 # considered harmfull read documentation !&lt;br /&gt;
&lt;br /&gt;
Other related commands:&lt;br /&gt;
    $ git reset     # see doc for --hard&lt;br /&gt;
&lt;br /&gt;
== Tracking remote trees: ==&lt;br /&gt;
    $ git remote add $name $uri # adds a remote tracking&lt;br /&gt;
    $ git remote update         # updates all remotes&lt;br /&gt;
    $ git branch -a             # shows all accessible branches&lt;br /&gt;
                                  ( including remotes in the&lt;br /&gt;
                                    $remote_name/ namespace )&lt;br /&gt;
&lt;br /&gt;
    $ git checkout -b $local_branch_name --track $remote_name/$remote_branch&lt;br /&gt;
          # creates a tracked local branch, git will warn whenever the&lt;br /&gt;
            remote adds commits.&lt;br /&gt;
&lt;br /&gt;
== Publishing one&#039;s tree: ==&lt;br /&gt;
give shell access to your tree, use git+ssh://machine/path or&lt;br /&gt;
direct path&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    $ sudo git-daemon --export-all --base-path=/srv/git --base-path-relaxed --reuseaddr --user-path=public_git&lt;br /&gt;
           # exports all git trees found under ~/public_git and /srv/git&lt;br /&gt;
&lt;br /&gt;
Or set up indetd etc.&lt;br /&gt;
&lt;br /&gt;
== Reviews and requesting them ==&lt;br /&gt;
=== Developer ===&lt;br /&gt;
==== From a git tree: ====&lt;br /&gt;
* publishes a git tree at git://dev/tree, containing his feature1 branch&lt;br /&gt;
* Requests a pull from the reviewer.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
==== publishes a series of patches: ====&lt;br /&gt;
        $ git format-patch $since_head # create ordered patches since&lt;br /&gt;
                                         head $since_head, i.e. on&lt;br /&gt;
                                         branch linus-create-ea, I&#039;d&lt;br /&gt;
                                         $since_head would be linus/master&lt;br /&gt;
        $ git send-email --compose *.patch&lt;br /&gt;
&lt;br /&gt;
== Importing changes to our development tree ==&lt;br /&gt;
=== Reviewer - typically someone at SGI ===&lt;br /&gt;
==== From a git tree: ====&lt;br /&gt;
* Adds a remote locally called &amp;quot;dev&amp;quot;:&lt;br /&gt;
        $ git remote add dev git://dev/tree&lt;br /&gt;
&lt;br /&gt;
* Looks at the differences between his tree (dev) and feature1:&lt;br /&gt;
        $ git log HEAD...dev/feature1 # differences in both ways,&lt;br /&gt;
	      	  	       	        read man for more detail…&lt;br /&gt;
List patches of commits from HEAD or dev/feature1 but not in both&lt;br /&gt;
(A...B in one branch but not both)&lt;br /&gt;
(A..B in branch B but not in A)&lt;br /&gt;
&lt;br /&gt;
* Reviews the diffs: (-p adds commit change in patch form)&lt;br /&gt;
        $ git log -p dev/feature1..HEAD&lt;br /&gt;
&lt;br /&gt;
* For each commit he accepts, imports it to his tree, adding a&lt;br /&gt;
Signed-off-by: automatically:&lt;br /&gt;
&lt;br /&gt;
Whilst in our own development tree, cherry-pick from the remote&lt;br /&gt;
        $ git cherry-pick -s -e $commit # easily scriptable with git cherry &lt;br /&gt;
&lt;br /&gt;
* The only trick there is putting the description into our preferred format,&lt;br /&gt;
  with summary line with [XFS] prefix, body, and SGI-PV.&lt;br /&gt;
  I guess we&#039;ll need to do that manually.&lt;br /&gt;
&lt;br /&gt;
* Pushes it to tree git+ssh://oss.sgi.com/oss/git/xfs/xfs.git&lt;br /&gt;
        $ git push oss # if you&#039;ve set up tracking remotes correctly&lt;br /&gt;
&lt;br /&gt;
if not&lt;br /&gt;
          $ git push git://chook/xfs/xfs-dev &amp;lt;refspec&amp;gt; # read man…&lt;br /&gt;
&lt;br /&gt;
        of form: git push repository &amp;lt;refspec&amp;gt;&lt;br /&gt;
        where &amp;lt;refspec&amp;gt; of form:&lt;br /&gt;
          The canonical format of a &amp;lt;refspec&amp;gt; parameter is&lt;br /&gt;
          `+?&amp;lt;src&amp;gt;:&amp;lt;dst&amp;gt;`; that is, an optional plus `+`, followed&lt;br /&gt;
          by the source ref, followed by a colon `:`, followed by&lt;br /&gt;
          the destination ref.&lt;br /&gt;
          The local ref that matches &amp;lt;src&amp;gt; is used&lt;br /&gt;
          to fast forward the remote ref that matches &amp;lt;dst&amp;gt;.  If&lt;br /&gt;
          the optional plus `+` is used, the remote ref is updated&lt;br /&gt;
          even if it does not result in a fast forward update.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
==== From emailed patches: ====&lt;br /&gt;
* From a plain patch:&lt;br /&gt;
      $ git apply $patch # evil&lt;br /&gt;
* From a mailbox:&lt;br /&gt;
      $ git am -s $mailbox # the way to go, adds Signed-off-by&lt;br /&gt;
&lt;br /&gt;
In order to modify the commit description, it may work to apply the committed&lt;br /&gt;
patches in another branch and then &amp;quot;cherry-pick -e&amp;quot; them into the development&lt;br /&gt;
branch.&lt;br /&gt;
&lt;br /&gt;
== Lost your quilt ? ==&lt;br /&gt;
Hope you use underwear.&lt;br /&gt;
&lt;br /&gt;
if not, you can look at many projects made of awesome:&lt;br /&gt;
=== guilt (written by Jeffpc, an XFS hacker): ===&lt;br /&gt;
quilt for git; similar to Mercurial queues Guilt (Git Quilt) is a&lt;br /&gt;
series of bash scripts which add a Mercurial queues-like&lt;br /&gt;
functionality and interface to git.  The one distinguishing&lt;br /&gt;
feature from other quilt-like porcelains, is the format of the&lt;br /&gt;
patches directory. _All_ the information is stored as plain text&lt;br /&gt;
- a series file and the patches (one per file). This easily lends&lt;br /&gt;
itself to versioning the patches using any number of of SCMs.&lt;br /&gt;
&lt;br /&gt;
=== stgit: ===&lt;br /&gt;
manage stacks of patches in a git repository stgit provides&lt;br /&gt;
similar functionality to quilt (i.e. pushing/popping patches&lt;br /&gt;
to/from a stack) on top of git.&lt;br /&gt;
&lt;br /&gt;
These operations are performed using git commands and the patches&lt;br /&gt;
are stored as git commit objects, allowing easy merging of the&lt;br /&gt;
stgit patches into other repositories using standard git&lt;br /&gt;
functionality.&lt;br /&gt;
&lt;br /&gt;
Homepage: http://www.procode.org/stgit/&lt;br /&gt;
&lt;br /&gt;
=== topgit ===&lt;br /&gt;
(house favourite, we may want to impose this one, but needs&lt;br /&gt;
a bit of git knowledge to fully understand):&lt;br /&gt;
&lt;br /&gt;
a Git patch queue manager TopGit manages a patch queue using Git&lt;br /&gt;
topic branches, one patch per branch. It allows for patch&lt;br /&gt;
dependencies and can thus manage non-linear patch series.&lt;br /&gt;
&lt;br /&gt;
TopGit is a minimal layer on top of Git, which does not limit use&lt;br /&gt;
of Git&#039;s functionality (such as the index). It rigorously keeps&lt;br /&gt;
history until a patch is accepted upstream. It is also fully&lt;br /&gt;
usable across distributed repositories.&lt;br /&gt;
&lt;br /&gt;
Homepage: http://repo.or.cz/w/topgit.git&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org:Current_events&amp;diff=1931</id>
		<title>Xfs.org:Current events</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org:Current_events&amp;diff=1931"/>
		<updated>2009-01-05T09:05:52Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: Please see main page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please see main page&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Consulting_Resources&amp;diff=1916</id>
		<title>Consulting Resources</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Consulting_Resources&amp;diff=1916"/>
		<updated>2008-12-21T18:33:16Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: [http://www.digitalelves.com Digital Elves Inc]&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.digitalelves.com Digital Elves Inc]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Main_Page&amp;diff=1915</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Main_Page&amp;diff=1915"/>
		<updated>2008-12-21T18:29:19Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome to XFS.org ==&lt;br /&gt;
&lt;br /&gt;
This site is set up to help with the XFS file system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information about XFS ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Xfs Wikipedia xfs page, good detailed information.]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[[XFS FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Status Updates]]&lt;br /&gt;
&lt;br /&gt;
{{#widget:Ohloh Project|id=xfs|type=thin_badge}}&lt;br /&gt;
&lt;br /&gt;
== XFS Developer Resources ==&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs Main sgi xfs website]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/archives/xfs xfs@oss.sgi.com mailing list archives]&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/bugzilla/ oss.sgi.com bugzilla]&lt;br /&gt;
&lt;br /&gt;
[http://bugzilla.kernel.org/ kernel.org bugzilla]&lt;br /&gt;
&lt;br /&gt;
[[Getting the latest source code]]&lt;br /&gt;
&lt;br /&gt;
[[Git]]&lt;br /&gt;
&lt;br /&gt;
[[Shrinking_Support]]&lt;br /&gt;
&lt;br /&gt;
== XFS User Resources ==&lt;br /&gt;
&lt;br /&gt;
[http://oss.sgi.com/projects/xfs/training/index.html Link to XFS training material]&lt;br /&gt;
&lt;br /&gt;
[[XFS Papers and Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Linux Distributions shipping XFS]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Rpm for RedHat]]&lt;br /&gt;
&lt;br /&gt;
[[XFS Companies]]&lt;br /&gt;
&lt;br /&gt;
== XFS Future Development Thoughts ==&lt;br /&gt;
&lt;br /&gt;
[[Ideas for XFS from Dave Chinner]]&lt;br /&gt;
&lt;br /&gt;
== Professional XFS Consulting Services == &lt;br /&gt;
&lt;br /&gt;
[[ Consulting Resources ]]&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=User:Cattelan&amp;diff=1883</id>
		<title>User:Cattelan</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=User:Cattelan&amp;diff=1883"/>
		<updated>2008-10-09T02:23:50Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: Russell Cattelan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Russell Cattelan&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org:Site_support&amp;diff=1880</id>
		<title>Xfs.org:Site support</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org:Site_support&amp;diff=1880"/>
		<updated>2008-10-08T04:08:55Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Donations are welcome&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Xfs.org:Site_support&amp;diff=1879</id>
		<title>Xfs.org:Site support</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Xfs.org:Site_support&amp;diff=1879"/>
		<updated>2008-10-08T03:45:26Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Donations are welcome&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Reliable_Detection_and_Repair_of_Metadata_Corruption&amp;diff=1877</id>
		<title>Reliable Detection and Repair of Metadata Corruption</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Reliable_Detection_and_Repair_of_Metadata_Corruption&amp;diff=1877"/>
		<updated>2008-10-08T03:07:29Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: == Reliable Detection and Repair of Metadata Corruption ==     This can be broken down into specific phases. Firstly, we cannot repair a corruption we have not detected. Hence the first th...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Reliable Detection and Repair of Metadata Corruption ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be broken down into specific phases. Firstly, we cannot repair a&lt;br /&gt;
corruption we have not detected. Hence the first thing we need to do is&lt;br /&gt;
reliable detection of errors and corruption. Once we can reliably detect errors&lt;br /&gt;
in structures and verified that we are propagating all the errors reported from&lt;br /&gt;
lower layers into XFS correctly, we can look at ways of handling them more&lt;br /&gt;
robustly. In many cases, the same type of error needs to be handled differently&lt;br /&gt;
due to the context in which the error occurs.  This introduces extra complexity&lt;br /&gt;
into this problem.&lt;br /&gt;
&lt;br /&gt;
Rather than continually refering to specific types of problems (such as&lt;br /&gt;
corruption or error handling) I&#039;ll refer to them as &#039;exceptions&#039;. This avoids&lt;br /&gt;
thinking about specific error conditions through specific paths and so helps us&lt;br /&gt;
to look at the issues from a more general or abstract point of view.&lt;br /&gt;
&lt;br /&gt;
== Exception Detection ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our current approach to exception detection is entirely reactive and rather&lt;br /&gt;
slapdash - we read a metadata block from disk and check certain aspects of it&lt;br /&gt;
(e.g. the magic number) to determine if it is the block we wanted. We have no&lt;br /&gt;
way of verifying that it is the correct block of metadata of the type&lt;br /&gt;
we were trying to read; just that it is one of that specific type. We&lt;br /&gt;
do bounds checking on critical fields, but this can&#039;t detect bit errors&lt;br /&gt;
in those fields. There&#039;s many fields we don&#039;t even bother to check because&lt;br /&gt;
the range of valid values are not limited.&lt;br /&gt;
&lt;br /&gt;
Effectively, this can be broken down into three separate areas:&lt;br /&gt;
&lt;br /&gt;
	- ensuring what we&#039;ve read is exactly what we wrote&lt;br /&gt;
	- ensuring what we&#039;ve read is the block we were supposed to read&lt;br /&gt;
	- robust contents checking&lt;br /&gt;
&lt;br /&gt;
Firstly, if we introduce a mechanism that we can use to ensure what we read is&lt;br /&gt;
something that the filesystem wrote, we can detect a whole range of exceptions&lt;br /&gt;
that are caused in layers below the filesystem (software and hardware). The&lt;br /&gt;
best method for this is to use a guard value that travels with the metadata it&lt;br /&gt;
is guarding. The guard value needs to be derived from the contents of the&lt;br /&gt;
block being guarded. Any event that changes the guard or the contents it is&lt;br /&gt;
guarding will immediately trigger an exception handling process when the&lt;br /&gt;
metadata is read in. Some examples of what this will detect are:&lt;br /&gt;
&lt;br /&gt;
	- bit errors in media/busses/memory after guard is calculated&lt;br /&gt;
	- uninitialised blocks being returned from lower layers (dmcrypt&lt;br /&gt;
	  had a readahead cancelling bug that could do this)&lt;br /&gt;
	- zeroed sectors as a result of double sector failures&lt;br /&gt;
	  in RAID5 systems&lt;br /&gt;
	- overwrite by data blocks&lt;br /&gt;
	- partial overwrites (e.g. due to power failure)&lt;br /&gt;
&lt;br /&gt;
The simplest method for doing this is introducing a checksum or CRC into each&lt;br /&gt;
block. We can calculate this for each different type of metadata being written&lt;br /&gt;
just before they are written to disk, hence we are able to provide a guard that&lt;br /&gt;
travels all the way to and from disk with the metadata itself. Given that&lt;br /&gt;
metadata blocks can be a maximum of 64k in size, we don&#039;t need a hugely complex&lt;br /&gt;
CRC or number of bits to protect blocks of this size. A 32 bit CRC will allow&lt;br /&gt;
us to reliably detect 15 bit errors on a 64k block, so this would catch almost&lt;br /&gt;
all types of bit error exceptions that occur. It will also detect almost all&lt;br /&gt;
other types of major content change that might occur due to an exception.&lt;br /&gt;
It has been noted that we should select the guard algorithm to be one that&lt;br /&gt;
has (or is targetted for) widespread hardware acceleration support.&lt;br /&gt;
&lt;br /&gt;
The other advantage this provides us with is a very fast method of determining&lt;br /&gt;
if a corrupted btree is a result of a lower layer problem or indeed an XFS&lt;br /&gt;
problem. That is, instead of always getting a WANT_CORRUPTED_GOTO btree&lt;br /&gt;
exception and shutdown, we&#039;ll get a&#039;bad CRC&#039; exception before we even start&lt;br /&gt;
processing the contents. This will save us much time when triaging corrupt&lt;br /&gt;
btrees - we won&#039;t spend time chasing problems that result from (potentially&lt;br /&gt;
silent or unhandled) lower layer exceptions.&lt;br /&gt;
&lt;br /&gt;
While a metadata block guard will protect us against content change, it won&#039;t&lt;br /&gt;
protect us against blocks that are written to the wrong location on disk. This,&lt;br /&gt;
unfortunately, happens more often that anyone would like and can be very&lt;br /&gt;
difficult to track down when it does occur. To protect against this problem,&lt;br /&gt;
metadata needs to be self-describing on disk. That is, if we read a block&lt;br /&gt;
on disk, there needs to be enough information in that block to determine&lt;br /&gt;
that it is the correct block for that location.&lt;br /&gt;
&lt;br /&gt;
Currently we have a very simplistic method of determining that we really have&lt;br /&gt;
read the correct block - the magic numbers in each metadata structure.  This&lt;br /&gt;
only enables us to identify type - we still need location and filesystem to&lt;br /&gt;
really determine if the block we&#039;ve read is the correct one. We need the&lt;br /&gt;
filesystem identifier because misdirected writes can cross filesystem&lt;br /&gt;
boundaries.  This is easily done by including the UUID of the filesystem in&lt;br /&gt;
every individually referencable metadata structure on disk.&lt;br /&gt;
&lt;br /&gt;
For block based metadata structures such as btrees, AG headers, etc, we&lt;br /&gt;
can add the block number directly to the header structures hence enabling&lt;br /&gt;
easy checking. e.g. for btree blocks, we already have sibling pointers in the&lt;br /&gt;
header, so adding a long &#039;self&#039; pointer makes a great deal of sense.&lt;br /&gt;
For inodes, adding the inode number into the inode core will provide exactly&lt;br /&gt;
the same protection - we&#039;ll now know that the inode we are reading is the&lt;br /&gt;
one we are supposed to have read. We can make similar modifications to dquots&lt;br /&gt;
to make them self identifying as well.&lt;br /&gt;
&lt;br /&gt;
So now we are able to verify the metadata we read from disk is what we wrote&lt;br /&gt;
and it&#039;s the correct metadata block, the only thing that remains is more&lt;br /&gt;
robust checking of the content. In many cases we already do this in DEBUG&lt;br /&gt;
code but not in runtime code. For example, when we read an inode cluster&lt;br /&gt;
in we only check the first inode for a matching magic number, whereas in&lt;br /&gt;
debug code we check every inode in the cluster.&lt;br /&gt;
&lt;br /&gt;
In some cases, there is not much point in doing this sort of detailed checking;&lt;br /&gt;
it&#039;s pretty hard to check the validity of the contents of a btree block without&lt;br /&gt;
doing a full walk of the tree and that is prohibitive overhead for production&lt;br /&gt;
systems. The added block guards and self identifiers should be sufficient to&lt;br /&gt;
catch all non-filesystem based exceptions in this case, whilst the existing&lt;br /&gt;
exception detection should catch all others. With the btree factoring that&lt;br /&gt;
is being done on for this work, all of the btrees should end up protected by&lt;br /&gt;
WANT_CORRUPTED_GOTO runtime exception checking.&lt;br /&gt;
&lt;br /&gt;
We also need to verify that metadata is sane before we use it. For example, if&lt;br /&gt;
we pull a block number out of a btree record in a block that has passed all&lt;br /&gt;
other validity it still may be invalid due to corruption prior to writing&lt;br /&gt;
it to disk. In these cases we need to ensure the block number lands&lt;br /&gt;
within the filesystem and/or within the bounds of the specific AG.&lt;br /&gt;
&lt;br /&gt;
Similar checking is needed for pretty much any forward or backwards reference&lt;br /&gt;
we are going to follow or using in an algorithm somewhere. This will help&lt;br /&gt;
prevent kernel panics by out of bound references (e.g. using an unchecked ag&lt;br /&gt;
number to index the per-AG array) by turning them into a handled exception&lt;br /&gt;
(which will initially be a shutdown). That is, we will turn a total system&lt;br /&gt;
failure into a (potentially recoverable) filesystem failure.&lt;br /&gt;
&lt;br /&gt;
Another failures that we often have reported is that XFS has &#039;hung&#039; and&lt;br /&gt;
traige indicates that the filesystem appears to be waiting for a metadata&lt;br /&gt;
I/O completion to occur. We have seen in the past I/O errors not being&lt;br /&gt;
propagated from the lower layers back into the filesystem causing these&lt;br /&gt;
sort of problems. We have also seen cases where there have been silent&lt;br /&gt;
I/O errors and the first thing to go wrong is &#039;XFS has hung&#039;.&lt;br /&gt;
&lt;br /&gt;
To catch situations like this, we need to track all I/O we have in flight and&lt;br /&gt;
have some method of timing them out.  That is, if we haven&#039;t completed the I/O&lt;br /&gt;
in N seconds, issue a warning and enter an exception handling process that&lt;br /&gt;
attempts to deal with the problem.&lt;br /&gt;
&lt;br /&gt;
My initial thoughts on this is that it could be implemented via the MRU cache&lt;br /&gt;
without much extra code being needed.  The complexity with this is that we&lt;br /&gt;
can&#039;t catch data read I/O because we use the generic I/O path for read. We do&lt;br /&gt;
our own data write and metadata read/write, so we can easily add hooks to track&lt;br /&gt;
all these types of I/O. Hence we will initially target just metadata I/O as&lt;br /&gt;
this would only need to hook into the xfs_buf I/O submission layer.&lt;br /&gt;
&lt;br /&gt;
To further improve exception detection, once guards and self-describing&lt;br /&gt;
structures are on disk, we can add filesystem scrubbing daemons that can verify&lt;br /&gt;
the structure of the filesystem pro-actively. That is, we can use background&lt;br /&gt;
processes to discovery degradation in the filesystem before it is found by a&lt;br /&gt;
user intiated operation. This gives us the ability to do exception handling in&lt;br /&gt;
a context that enables further checking and potential repair of the exception.&lt;br /&gt;
This sort of exception handling may not be possible if we are in a&lt;br /&gt;
user-initiated I/O context, and certainly not if we are in a transaction&lt;br /&gt;
context.&lt;br /&gt;
&lt;br /&gt;
This will also allow us to detect errors in rarely referenced parts of&lt;br /&gt;
the filesystem, thereby giving us advance warning of degradation in filesystems&lt;br /&gt;
that we might not otherwise get (e.g. in systems without media scrubbing).&lt;br /&gt;
Ideally, data scrubbing woul dneed to be done as well, but without data guards&lt;br /&gt;
it is rather hard to detect that there&#039;s been a change in the data....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exception Handling ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once we can detect exceptions, we need to handle them in a sane manner.&lt;br /&gt;
The method of exception handling is two-fold:&lt;br /&gt;
&lt;br /&gt;
	- retry (write) or cancel (read) asynchronous I/O&lt;br /&gt;
	- shut down the filesystem (fatal).&lt;br /&gt;
&lt;br /&gt;
Effectively, we either defer non-critical failures to a later point in&lt;br /&gt;
time or we come to a complete halt and prevent the filesystem from being&lt;br /&gt;
accessed further. We have no other methods of handling exceptions.&lt;br /&gt;
&lt;br /&gt;
If we look at the different types of exceptions we can have, they&lt;br /&gt;
broadly fall into:&lt;br /&gt;
&lt;br /&gt;
	- media read errors&lt;br /&gt;
	- media write errors&lt;br /&gt;
	- successful media read, corrupted contents&lt;br /&gt;
&lt;br /&gt;
The context in which the errors occur also influences the exception processing&lt;br /&gt;
that is required. For example, an unrecoverable metadata read error within a&lt;br /&gt;
dirty transaction is a fatal error, whilst the same error during a read-only&lt;br /&gt;
operation will simply log the error to syslog and return an error to userspace.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the storage subsystem plays a part indeciding how to handle&lt;br /&gt;
errors. The reason is that in many storage configurations I/O errors can be&lt;br /&gt;
transient. For example, in a SAN a broken fibre can cause a failover to a&lt;br /&gt;
redundant path, however the inflight I/O on the failed is usually timed out and&lt;br /&gt;
an error returned. We don&#039;t want to shut down the filesystem on such an error -&lt;br /&gt;
we want to wait for failover to a redundant path and then retry the I/O. If the&lt;br /&gt;
failover succeeds, then the I/O will succeed. Hence any robust method of&lt;br /&gt;
exception handling needs to consider that I/O exceptions may be transient.&lt;br /&gt;
&lt;br /&gt;
In the abscence of redundant metadata, there is little we can do right now&lt;br /&gt;
on a permanent media read error. There are a number of approaches we&lt;br /&gt;
can take for handling the exception:&lt;br /&gt;
&lt;br /&gt;
	- try reading the block again. Normally we don&#039;t get an error&lt;br /&gt;
	  returned until the device has given up on trying to recover it.&lt;br /&gt;
	  If it&#039;s a transient failure, then we should eventually get a&lt;br /&gt;
	  good block back. If a retry fails, then:&lt;br /&gt;
&lt;br /&gt;
	- inform the lower layer that it needs to perform recovery on that&lt;br /&gt;
	  block before trying to read it again. For path failover situations,&lt;br /&gt;
	  this should block until a redundant path is brought online. If no&lt;br /&gt;
	  redundant path exists or recovery from parity/error coding blocks&lt;br /&gt;
	  fails, then we cannot recover the block and we have a fatal error&lt;br /&gt;
	  situation.&lt;br /&gt;
&lt;br /&gt;
Ultimately, however, we reach a point where we have to give up - the metadata&lt;br /&gt;
no longer exists on disk and we have to enter a repair process to fix the&lt;br /&gt;
problem. That is, shut down the filesystem and get a human to intervene&lt;br /&gt;
and fix the problem.&lt;br /&gt;
&lt;br /&gt;
At this point, the only way we can prevent a shutdown situation from occurring&lt;br /&gt;
is to have redundant metadata on disk. That is, whenever we get an error&lt;br /&gt;
reported, we can immediately retry by reading from an alternate metadata block.&lt;br /&gt;
If we can read from the alternate block, we can continue onwards without&lt;br /&gt;
the user even knowing there is a block in the filesystem. Of course, we&#039;d&lt;br /&gt;
need to log the event for the administrator to take action on at some point&lt;br /&gt;
in the future.&lt;br /&gt;
&lt;br /&gt;
Even better, we can mostly avoid this intervention if we have alternate&lt;br /&gt;
metadata blocks. That is, we can repair blocks that are returning read errors&lt;br /&gt;
during the exception processing. In the case of media errors, they can&lt;br /&gt;
generally be corrected simply by re-writing the block that was returning the&lt;br /&gt;
error. This will force drives to remap the bad blocks internally so the next&lt;br /&gt;
read from that location will return valid data. This, if my understanding is&lt;br /&gt;
correct, is the same process that ZFS and BTRFS use to recover from and correct&lt;br /&gt;
such errors.&lt;br /&gt;
&lt;br /&gt;
NOTE: Adding redundant metadata can be done in several different ways. I&#039;m not&lt;br /&gt;
going to address that here as it is a topic all to itself. The focus of this&lt;br /&gt;
document is to outline how the redundant metadata could be used to enhance&lt;br /&gt;
exception processing and prevent a large number of cases where we currently&lt;br /&gt;
shut down the filesystem.&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
	Transient write error&lt;br /&gt;
	Permanent write error&lt;br /&gt;
	Corrupted data on read&lt;br /&gt;
	Corrupted data on write (detected during guard calculation)&lt;br /&gt;
	I/O timeouts&lt;br /&gt;
	Memory corruption&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reverse Mapping ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is worth noting that even redundant metadata doesn&#039;t solve all our&lt;br /&gt;
problems. Realistically, all that redundant metadata gives us is the ability&lt;br /&gt;
to recover from top-down traversal exceptions. It does not help exception&lt;br /&gt;
handling of occurences such as double sector failures (i.e. loss of redundancy&lt;br /&gt;
and a metadata block). Double sector failures are the most common cause&lt;br /&gt;
of RAID5 data loss - loss of a disk followed by a sector read error during&lt;br /&gt;
rebuild on one of the remaining disks.&lt;br /&gt;
&lt;br /&gt;
In this case, we&#039;ve got a block on disk that is corrupt. We know what block it&lt;br /&gt;
is, but we have no idea who the owner of the block is. If it is a metadata&lt;br /&gt;
block, then we can recover it if we have redundant metadata.  Even if this is&lt;br /&gt;
user data, we still want to be able to tell them what file got corrupted by the&lt;br /&gt;
failure event.  However, without doing a top-down traverse of the filesystem we&lt;br /&gt;
cannot find the owner of the block that was corrupted.&lt;br /&gt;
&lt;br /&gt;
This is where we need a reverse block map. Every time we do an allocation of&lt;br /&gt;
an extent we know who the owner of the block is. If we record this information&lt;br /&gt;
in a separate tree then we can do a simple lookup to find the owner of any&lt;br /&gt;
block and start an exception handling process to repair the damage. Ideally&lt;br /&gt;
we also need to include information about the type of block as well. For&lt;br /&gt;
example, and inode can own:&lt;br /&gt;
&lt;br /&gt;
	- data blocks&lt;br /&gt;
	- data fork BMBT blocks&lt;br /&gt;
	- attribute blocks&lt;br /&gt;
	- attribute fork BMBT blocks&lt;br /&gt;
&lt;br /&gt;
So keeping track of owner + type would help indicate what sort of exception&lt;br /&gt;
handling needs to take place. For example, a missing data fork BMBT block means there&lt;br /&gt;
will be unreferenced extents across the filesystem. These &#039;lost extents&#039;&lt;br /&gt;
could be recovered by reverse map traversal to find all the BMBT and data&lt;br /&gt;
blocks owned by that inode and finding the ones that are not referenced.&lt;br /&gt;
If the reverse map held suffient extra metadata - such as the offset within the&lt;br /&gt;
file for the extent - the exception handling process could rebuild the BMBT&lt;br /&gt;
tree completely without needing ænd external help.&lt;br /&gt;
&lt;br /&gt;
It would seem to me that the reverse map needs to be a long-pointer format&lt;br /&gt;
btree and held per-AG. it needs long pointers because the owner of an extent&lt;br /&gt;
can be anywhere in the filesystem, and it needs to be per-AG to avoid adverse&lt;br /&gt;
effect on allocation parallelism.&lt;br /&gt;
&lt;br /&gt;
The format of the reverse map record will be dependent on the amount of&lt;br /&gt;
metdata we need to store. We need:&lt;br /&gt;
&lt;br /&gt;
	- owner (64 bit, primary record)&lt;br /&gt;
	- {block, len} extent descriptor&lt;br /&gt;
	- type&lt;br /&gt;
	- per-type specific metadata (e.g. offset for data types).&lt;br /&gt;
&lt;br /&gt;
Looking at worst case here, say we have 32 bytes per record, the worst case&lt;br /&gt;
space usage of the reverse map btree woul dbe roughly 62 records per 4k&lt;br /&gt;
block. With a 1TB allocation group, we have 228 4k blocks in the AG&lt;br /&gt;
that could require unique reverse mappings. That gives us roughly 222&lt;br /&gt;
4k blocks to for the reverse map, or 234 bytes - roughly 16GB per 1TB&lt;br /&gt;
of space.&lt;br /&gt;
&lt;br /&gt;
It may be a good idea to allocate this space at mkfs time (tagged as unwritten&lt;br /&gt;
so it doesn&#039;t need zeroing) to avoid allocation overhead and potential free&lt;br /&gt;
space fragmentation as the reverse map index grows and shrinks. If we do&lt;br /&gt;
this we could even treat this as a array/skip list where a given block in the&lt;br /&gt;
AG has a fixed location in the map. This will require more study to determine&lt;br /&gt;
the advantages and disadvantages of such approaches.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering From Errors During Transactions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the big problems we face with exception recovery is what to do&lt;br /&gt;
when we take an exception inside a dirty transaction. At present, any&lt;br /&gt;
error is treated as a fatal error, the transaction is cancelled and&lt;br /&gt;
the filesystem is shut down. Even though we may have a context which&lt;br /&gt;
can return an error, we are unable to revert the changes we have&lt;br /&gt;
made during the transaction and so cannot back out.&lt;br /&gt;
&lt;br /&gt;
Effectively, a cancelled dirty transaction looks exactly like in-memory&lt;br /&gt;
structure corruption. That is, what is in memory is different to that&lt;br /&gt;
on disk, in the log or in asynchronous transactions yet to be written&lt;br /&gt;
to the log. Hence we cannot simply return an error and continue.&lt;br /&gt;
&lt;br /&gt;
To be able to do this, we need to be able to undo changes made in a given&lt;br /&gt;
transaction. The method XFS uses for journalling - write-ahead logging -&lt;br /&gt;
makes this diffcult to do. A transaction proceeds in the following&lt;br /&gt;
order:&lt;br /&gt;
&lt;br /&gt;
	- allocate transaction&lt;br /&gt;
	- reserve space in the journal for transaction&lt;br /&gt;
	- repeat until change is complete:&lt;br /&gt;
		- lock item&lt;br /&gt;
		- join item to transaction&lt;br /&gt;
		- modify item&lt;br /&gt;
		- record region of change to item&lt;br /&gt;
	- transaction commit&lt;br /&gt;
&lt;br /&gt;
Effectively, we modify structures in memory then record where we&lt;br /&gt;
changed them for the transaction commit to write to disk. Unfortunately,&lt;br /&gt;
this means we overwrite the original state of the items in memory,&lt;br /&gt;
leaving us with no way to back out those changes from memory if&lt;br /&gt;
something goes wrong.&lt;br /&gt;
&lt;br /&gt;
However, based on the observation that we are supposed to join an item to the&lt;br /&gt;
transaction *before* we start modifying it, it is possible to record the state&lt;br /&gt;
of the item before we start changing it. That is, we have a hoook that can&lt;br /&gt;
allow us take a copy of the unmodified item when we join it to the&lt;br /&gt;
transaction.&lt;br /&gt;
&lt;br /&gt;
If we have an unmodified copy of the item in memory, then if the transaction&lt;br /&gt;
is cancelled when dirty, we have the information necessary to undo, or roll&lt;br /&gt;
back, the changes made in the transaction. This would allow us to return&lt;br /&gt;
the in-memory state to that prior to the transaction starting, thereby&lt;br /&gt;
ensuring that the in-memory state matches the rest of the filesystem and&lt;br /&gt;
allowing us to return an error to the calling context.&lt;br /&gt;
&lt;br /&gt;
This is not without overhead. we would have to copy every metadata item&lt;br /&gt;
entirely in every transaction. This will increase the CPU overhead&lt;br /&gt;
of each transaction as well as the memory required. It is the memory&lt;br /&gt;
requirement more than the CPU overhead that concerns me - we may need&lt;br /&gt;
to ensure we have a memory pool associated with transaction reservation&lt;br /&gt;
that guarantees us enough memory is available to complete the transaction.&lt;br /&gt;
However, given that we could roll back transactions, we could now *fail&lt;br /&gt;
transactions* with ENOMEM and not have to shut down the filesystem, so this&lt;br /&gt;
may be an acceptible trade-off.&lt;br /&gt;
&lt;br /&gt;
In terms of implementation, it is worth noting that there is debug code in&lt;br /&gt;
the xfs_buf_log_item for checking that all the modified regions of a buffer&lt;br /&gt;
were logged. Importantly, this is implemented by copying the original buffer&lt;br /&gt;
in the item initialisation when it is first attached to a transaction. In&lt;br /&gt;
other words, this debug code implements the mechanism we need to be able&lt;br /&gt;
to rollback changes made in a transaction. Other item types would require&lt;br /&gt;
similar changes to be made.&lt;br /&gt;
&lt;br /&gt;
Overall, this doesn&#039;t look like a particularly complex change to make; the&lt;br /&gt;
only real question is how much overhead is it going to introduce. With CPUs&lt;br /&gt;
growing more cores all the time, and XFS being aimed at extremely&lt;br /&gt;
multi-threaded workloads, this overhead may not be a concern for long.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Failure Domains ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we plan to have redundant metadata, or even try to provide fault isolation&lt;br /&gt;
between different parts of the filesystem namespace, we need to know about&lt;br /&gt;
independent regions of the filesystem. &#039;Independent Regions&#039; (IR) are ranges&lt;br /&gt;
of the filesystem block address space that don&#039;t share resources with&lt;br /&gt;
any other range.&lt;br /&gt;
&lt;br /&gt;
A classic example of a filesystem made up of multiple IRs is a linear&lt;br /&gt;
concatenation of multiple drives into a larger address space.  The address&lt;br /&gt;
space associated with each drive can operate independently from the other&lt;br /&gt;
drives, and a failure of one drive will not affect the operation of the address&lt;br /&gt;
spaces associated with other drives in the linear concatenation.&lt;br /&gt;
&lt;br /&gt;
A Failure Domain (FD) is made up of one or more IRs. IRs cannot be shared&lt;br /&gt;
between FDs - IRs are not independent if they are shared! Effectively, an&lt;br /&gt;
ID is an encoding of the address space within the filesystem that lower level&lt;br /&gt;
failures (from below the filesystem) will not propagate outside. The geometry&lt;br /&gt;
and redundancy in the underlying storage will determine the nature of the&lt;br /&gt;
IRs available to the filesystem.&lt;br /&gt;
&lt;br /&gt;
To use redundant metadata effectively for recovering from fatal lower layer&lt;br /&gt;
loss or corruption, we really need to be able to place said redundant&lt;br /&gt;
metadata in a different FDs. That way a loss in one domain can be recovered&lt;br /&gt;
from a domain that is still intact. It also means that it is extremely&lt;br /&gt;
difficult to lose or corrupt all copies of a given piece of metadata;&lt;br /&gt;
that would require multiple independent faults to occur in a localised&lt;br /&gt;
temporaral window. Concurrent multiple component failure in multiple&lt;br /&gt;
IRs is considered to be quite unlikely - if such an event were to&lt;br /&gt;
occur, it is likely that there is more to worry about than filesystem&lt;br /&gt;
consistency (like putting out the fire in the data center).&lt;br /&gt;
&lt;br /&gt;
Another use of FDs is to try to minimise the number of domain boundaries&lt;br /&gt;
each object in the filesystem crosses. If an object is wholly contained&lt;br /&gt;
within a FD, and that object is corrupted, then the repair problem is&lt;br /&gt;
isolated to that FD, not the entire filesystem. That is, by making&lt;br /&gt;
allocation strategies and placement decisions aware of failure domain&lt;br /&gt;
boundaries we can constraint the location of related data and metadata.&lt;br /&gt;
Once locality is constrained, the scope of repairing an object if&lt;br /&gt;
it becomes corrupted is reduced to that of ensuring the FD is consistent.&lt;br /&gt;
&lt;br /&gt;
There are many ways of limiting cross-domain dependencies; I will&lt;br /&gt;
not try to detail them here. Likewise, there are many ways of introducing&lt;br /&gt;
such information into XFS - mkfs, dynamically via allocation policies,&lt;br /&gt;
etc - so I won&#039;t try to detail them, either. The main point to be&lt;br /&gt;
made is that to make full use of redundant metadata and to reduce&lt;br /&gt;
the scope of common reapir problems we need to pay attention to &lt;br /&gt;
how the system can fail to ensure that we can recover from failures&lt;br /&gt;
as quickly as possible.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
	<entry>
		<id>https://xfs.org/index.php?title=Improving_Metadata_Performance_By_Reducing_Journal_Overhead&amp;diff=1876</id>
		<title>Improving Metadata Performance By Reducing Journal Overhead</title>
		<link rel="alternate" type="text/html" href="https://xfs.org/index.php?title=Improving_Metadata_Performance_By_Reducing_Journal_Overhead&amp;diff=1876"/>
		<updated>2008-10-08T03:03:55Z</updated>

		<summary type="html">&lt;p&gt;Cattelan: New page: == Improving Metadata Performance By Reducing Journal Overhead ==     XFS currently uses asynchronous write-ahead logging to ensure that changes to the filesystem structure are preserved o...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Improving Metadata Performance By Reducing Journal Overhead ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
XFS currently uses asynchronous write-ahead logging to ensure that changes to&lt;br /&gt;
the filesystem structure are preserved on crash.  It does this by logging&lt;br /&gt;
detailed records ofteh changes being made to each object on disk during a&lt;br /&gt;
transaction. Every byte that is modified needs to be recorded in the journal.&lt;br /&gt;
&lt;br /&gt;
There are two issues with this approach. The first is that transactions can&lt;br /&gt;
modify a *lot* of metadata  to complete a single operation. Worse is the fact&lt;br /&gt;
that the average size of a transactions grows as structures get larger and&lt;br /&gt;
deeper, so performance on larger, fuller filesystem drops off as log bandwidth&lt;br /&gt;
is consumed by fewer, larger transactions.&lt;br /&gt;
&lt;br /&gt;
The second is that we re-log previous changes that are active in the journal&lt;br /&gt;
if the object is modified again. hence if an object is modified repeatedly, the&lt;br /&gt;
dirty parts of the object get rewritten over and over again. in the worst case,&lt;br /&gt;
frequently logged buffers will be entirely dirty and so even if we only change&lt;br /&gt;
a single byte in the buffer we&#039;ll log the entire buffer.&lt;br /&gt;
&lt;br /&gt;
An example of how needless this can be is the operation of a removing all the&lt;br /&gt;
files in a directory result in the directory blocks being logged over and over&lt;br /&gt;
again before finally being freed and made stale in the log. If we are freeing&lt;br /&gt;
the entire contents of the directory, the only transactions we really need in&lt;br /&gt;
the journal w.r.t to directory buffers is the &#039;remove, stale and free&#039;&lt;br /&gt;
transaction; all other changes are irrelevant because we don&#039;t care about&lt;br /&gt;
changes to free space. Depending on the directory block size, we might log each&lt;br /&gt;
directory buffer tens to hundreds of times before making it stale...&lt;br /&gt;
&lt;br /&gt;
Clearly we have two different axis to approach this problem along:&lt;br /&gt;
&lt;br /&gt;
	- reduce the amount we log in a given transaction&lt;br /&gt;
	- reduce the number of times we re-log objects.&lt;br /&gt;
&lt;br /&gt;
Both of these things give the same end result - we require less bandwidth to&lt;br /&gt;
the journal to log changes that are happening in the filesystem. Let&#039;s start&lt;br /&gt;
by looking at how to reduce re-logging of objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Asynchronous Transaction Aggregation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first observation that we need to make is that we are already doing&lt;br /&gt;
asynchronous journalling for everything other than explicitly synchronous&lt;br /&gt;
transactions. This means we are aggregating completed transactions in memory&lt;br /&gt;
before writing them to disk. This reduces the number of disk I/Os needed to&lt;br /&gt;
write the log, but it does nothing to help prevent relogging of items.&lt;br /&gt;
&lt;br /&gt;
The second observation is that we store asynchronous committed transactions&lt;br /&gt;
in two forms while they are being written to disk:&lt;br /&gt;
&lt;br /&gt;
	- the physical form in the log buffer that will be written&lt;br /&gt;
	- the logical form attached to the log buffer so that on I/O completion&lt;br /&gt;
	  of the log buffer the items in the transaction can be unpinned and&lt;br /&gt;
	  moved to or updated in the AIL for later writeback.&lt;br /&gt;
&lt;br /&gt;
The fact that we store the logical form of the transaction until after the&lt;br /&gt;
log buffer is written to the journal is important - it means the transaction&lt;br /&gt;
and all it&#039;s dirty items live longer than process that creates and commits&lt;br /&gt;
the transaction. This allows us to redefine what &#039;transaction commit&#039; actually&lt;br /&gt;
means.&lt;br /&gt;
&lt;br /&gt;
A transaction commit currently takes the following steps:&lt;br /&gt;
&lt;br /&gt;
	- apply superblock and dquot changes to in-core structures&lt;br /&gt;
	- build an vector array to all the dirty regions in all the items in&lt;br /&gt;
	  the transaction.&lt;br /&gt;
	- write the vector array into the log buffer (may trigger log I/O)&lt;br /&gt;
	- release ununsed transaction reservations to in-core structures&lt;br /&gt;
	- attach transaction to log buffer callbacks&lt;br /&gt;
	- write a commit record into the log buffer for the transaction&lt;br /&gt;
	- unlock all the items locked in the transaction&lt;br /&gt;
	- release the log buffer (may trigger log I/O)&lt;br /&gt;
	- if synchronous transaction, issue a synchronous log force to&lt;br /&gt;
	  get the transaction on disk.&lt;br /&gt;
&lt;br /&gt;
Based on the observation that the transaction structure exists until it is&lt;br /&gt;
freed during log buffer I/o completion, we really don&#039;t have to format the&lt;br /&gt;
transaction into a log buffer during the transaction commit - we could&lt;br /&gt;
simply queue it into a list for later processing. Synchronous&lt;br /&gt;
transactions don&#039;t change this - they just queue the transaction then&lt;br /&gt;
do a log force to cause the transaction queue to be flushed to disk.&lt;br /&gt;
&lt;br /&gt;
Now that we have an asynchronous transaction queue in logical format, we can&lt;br /&gt;
take our time deciding when and how best to write it to disk. If we have&lt;br /&gt;
the situation where we are relogging items, we will have a given item&lt;br /&gt;
in multiple transactions. If we write out each transaction as an individual&lt;br /&gt;
commit like we currently do, we&#039;d then have the problem of future changes&lt;br /&gt;
being written in the first transaction that we write. This will cause&lt;br /&gt;
problems for recovery.&lt;br /&gt;
&lt;br /&gt;
Hence what we really want to do is aggregate all those transactions into a&lt;br /&gt;
single large journal commit. This makes the journalling model more of a&lt;br /&gt;
&#039;checkpoint of changes&#039; than a &#039;transactional change&#039; model. By commiting&lt;br /&gt;
a set of transactions rather than just a single transaction per commit&lt;br /&gt;
record, we can avoid needed to commit items several times to the log&lt;br /&gt;
if they are modified in multiple transactions. During recovery, we only&lt;br /&gt;
recover the entire commit so we only need a single version of each item&lt;br /&gt;
that encompasses all the changes in the commit period.&lt;br /&gt;
&lt;br /&gt;
As an aside, if we have large numbers of items per commit record now,&lt;br /&gt;
it makes sense to start optimising the recovery read-ahead by sorting&lt;br /&gt;
all the items in the commit record before issuing readahead on them.&lt;br /&gt;
This will reduce the seeking the readahead triggers somewhat, so should&lt;br /&gt;
lead to faster recovery times.&lt;br /&gt;
&lt;br /&gt;
The down sides to this approach are:&lt;br /&gt;
&lt;br /&gt;
	- holds items pinned in memory for longer, thereby increases&lt;br /&gt;
	  the chances of triggering a log force to unpin them.&lt;br /&gt;
	- partial log forces (i.e. those to a specific LSN) are no longer&lt;br /&gt;
	  really possible as we do not have multiple independent queues&lt;br /&gt;
	  (iclogbufs) holding the transactions.&lt;br /&gt;
	- log forces become more expensive by having to drain the entire&lt;br /&gt;
	  async transaction queue.&lt;br /&gt;
	- synchronous transactions become more expensive by having to&lt;br /&gt;
	  drain the entire async transaction queue.&lt;br /&gt;
	- possible &#039;interesting&#039; interactions with tail-pushing if we&lt;br /&gt;
	  allow too many async transactions to be queued without flushing&lt;br /&gt;
	  them.&lt;br /&gt;
&lt;br /&gt;
The main concern with this approach is ensuring that we don&#039;t adversely affect&lt;br /&gt;
fsync() performance. For example, ext3 uses a checkpoint based journalling&lt;br /&gt;
system that has a very long checkpoint period (5 seconds).  As a result, a&lt;br /&gt;
synchronous operation such as an fsync() can be forced to flush up to 5 seconds&lt;br /&gt;
worth of transactions to disk. In ordered mode, this also involves flushing&lt;br /&gt;
data, so the fsync() latency can be measured in tens of seconds on a busy&lt;br /&gt;
filesystem. This is known as the &#039;sync the world&#039; problem, and currently XFS&lt;br /&gt;
does not suffer from this at all. &lt;br /&gt;
&lt;br /&gt;
[Data point: Recent testing of this phenomenon by Chris Mason showed XFS took&lt;br /&gt;
less than one second to fsync a 4k write in the presence of a background&lt;br /&gt;
streaming write; BTRFS took two seconds and ext3 took five seconds. ]&lt;br /&gt;
&lt;br /&gt;
To avoid this type of latency, we should not be allowing too many transactions&lt;br /&gt;
to accumulate in the async transaction queue. If we look at optimising&lt;br /&gt;
workloads such as sequential creates or deletes in a single directory then, in&lt;br /&gt;
theory, accumulating just 10 async transactions into a single commit record&lt;br /&gt;
should provide close to an order of magnitude reduction in bandwidth to the log&lt;br /&gt;
under these workloads. We also reduce the number of log writes by aggregating&lt;br /&gt;
like this and that will give us even larger gains by avoiding seeks to write&lt;br /&gt;
log buffers out.&lt;br /&gt;
&lt;br /&gt;
Hence I don&#039;t think the async transaction queue needs to be all that deep&lt;br /&gt;
to realise substantial gains, and hence the impact on synchronous transaction&lt;br /&gt;
latency can be kept quite low as a result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Atomic Multi-Transaction Operations ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A feature asynchronous transaction aggregation makes possible is atomic&lt;br /&gt;
multi-transaction operations.  On the first transaction we hold the queue in&lt;br /&gt;
memory, preventing it from being committed. We can then do further transactions&lt;br /&gt;
that will end up in the same commit record, and on the final transaction we&lt;br /&gt;
unlock the async transaction queue. This will allow all those transaction to be&lt;br /&gt;
applied atomically. This is far simpler than any other method I&#039;ve been looking&lt;br /&gt;
at to do this.&lt;br /&gt;
&lt;br /&gt;
After a bit of reflection, I think this feature may be necessary for correct&lt;br /&gt;
implementation of existing logging techniques. The way we currently implement&lt;br /&gt;
rolling transactions (with permanent log reservations and rolling&lt;br /&gt;
dup/commit/re-reserve sequences) would seem to require all the commits in a&lt;br /&gt;
rolling transaction to be including in a single commit record.  If I understand&lt;br /&gt;
history and the original design correctly, these rolling transactions were&lt;br /&gt;
implemented so that large, complex transactions would not pin the tail of the&lt;br /&gt;
log as they progressed.  IOWs, they implicitly use re-logging to keep the tail&lt;br /&gt;
of the log moving forward as they progress and continue to modify items in the&lt;br /&gt;
transaction.&lt;br /&gt;
&lt;br /&gt;
Given we are using asynchronous transaction aggregation as a method of reducing&lt;br /&gt;
re-logging, it would make sense to prevent these sorts of transactions from&lt;br /&gt;
pinning the tail of the log at all. Further, because we are effectively&lt;br /&gt;
disturbing the concept of unique transactions, I don&#039;t think that allowing a&lt;br /&gt;
rolling transaction to span aggregated commits is valid as we are going to be&lt;br /&gt;
ignoring the transaction IDs that are used to identify individual transactions.&lt;br /&gt;
&lt;br /&gt;
Hence I think it is a good idea to simply replace rolling transactions with&lt;br /&gt;
atomic multi-transaction operations. This may also allow us to split some of&lt;br /&gt;
the large compound transactions into smaller, more self contained transactions.&lt;br /&gt;
This would reduce reservation pressure on log space in the common case where&lt;br /&gt;
all the corner cases in the transactions are not taken. In terms of&lt;br /&gt;
implementation, I think we can initially augment the permanent transaction&lt;br /&gt;
reservation/release interface to acheive this. With a working implementation,&lt;br /&gt;
we can then look to changing to a more explicit interface and slowly work to&lt;br /&gt;
remove the &#039;permanent log transaction&#039; concept entirely. This shold simplify&lt;br /&gt;
the log code somewhat....&lt;br /&gt;
&lt;br /&gt;
Note: This asynchronous transaction aggregation is originally based on a&lt;br /&gt;
concept floated by Nathan Scott called &#039;Delayed Logging&#039; after observing how&lt;br /&gt;
ext3 implemented journalling.  This never passed more than a concept&lt;br /&gt;
description phase....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operation Based Logging ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The second approach to reducing log traffic is to change exactly what we&lt;br /&gt;
log in the transactions. At the moment, what we log is the exact change to&lt;br /&gt;
the item that is being made. For things like inodes and dquots, this isn&#039;t&lt;br /&gt;
particularly expensive because it is already a very compact form. The issue&lt;br /&gt;
comes with changes that are logged in buffers.&lt;br /&gt;
&lt;br /&gt;
The prime example of this is a btree modification that involves either removing&lt;br /&gt;
or inserting a record into a buffer. The records are kept in compact form, so an&lt;br /&gt;
insert or remove will also move other records around in the buffer. In the worst&lt;br /&gt;
case, a single insert or remove of a 16 byte record can dirty an entire block&lt;br /&gt;
(4k generally, but could be up to 64k). In this case, if we were to log the&lt;br /&gt;
btree operation (e.g. insert {record, index}) rather than the resultant change&lt;br /&gt;
on the buffer the overhead of a btree operation is fixed. Such logging also&lt;br /&gt;
allows us to avoid needing to log the changes due to splits and merges - we just&lt;br /&gt;
replay the operation and subsequent splits/merges get done as part of replay.&lt;br /&gt;
&lt;br /&gt;
The result of this is that complex transactions no longer need as much log space&lt;br /&gt;
as all possible change they can cause - we only log the basic operations that&lt;br /&gt;
are occurring and their result. Hence transaction end up being much smaller,&lt;br /&gt;
vary less in size between empty and full filesystems, etc. An example set of&lt;br /&gt;
operations describing all the changes made by an extent allocation on an inode&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
	- inode X intent to allocate extent {off, len}&lt;br /&gt;
	- AGCNT btree update record in AG X {old rec} {new rec values}&lt;br /&gt;
	- AGBNO btree delete record in AG X {block, len}&lt;br /&gt;
	- inode X BMBT btree insert record {off, block, len}&lt;br /&gt;
	- inode X delta&lt;br /&gt;
&lt;br /&gt;
This comes down to a relatively small, bound amount of space which is close the&lt;br /&gt;
minimun and existing allocation transaction would consume.  However, with this&lt;br /&gt;
method of logging the transaction size does not increase with the size of&lt;br /&gt;
structures or the amount of updates necessary to complete the operations.&lt;br /&gt;
&lt;br /&gt;
A major difference to the existing transaction system is that re-logging&lt;br /&gt;
of items doesn&#039;t fit very neatly with operation based logging. &lt;br /&gt;
&lt;br /&gt;
There are three main disadvantages to this approach:&lt;br /&gt;
&lt;br /&gt;
	- recovery becomes more complex - it will need to change substantially&lt;br /&gt;
	  to accomodate operation replay rather than just reading from disk&lt;br /&gt;
	  and applying deltas.&lt;br /&gt;
	- we have to create a whole new set of item types and add the necessary&lt;br /&gt;
	  hooks into the code to log all the operations correctly.&lt;br /&gt;
	- re-logging is probably not possible, and that introduces &lt;br /&gt;
	  differences to the way we&#039;ll need to track objects for flushing. It&lt;br /&gt;
	  may, in fact, require transaction IDs in all objects to allow us&lt;br /&gt;
	  to determine what the last transaction that modified the item&lt;br /&gt;
	  on disk was during recovery.&lt;br /&gt;
&lt;br /&gt;
Changing the logging strategy as described is a much more fundamental change to&lt;br /&gt;
XFS than asynchronous transaction aggregation. It will be difficult to change&lt;br /&gt;
to such a model in an evolutionary manner; it is more of a &#039;flag day&#039; style&lt;br /&gt;
change where then entire functionality needs to be added in one hit. Given that&lt;br /&gt;
we will also still have to support the old log format, it doesn&#039;t enable us to&lt;br /&gt;
remove any code, either.&lt;br /&gt;
&lt;br /&gt;
Given that we are likely to see major benefits in the problem workloads as a&lt;br /&gt;
result of asynchronous transaction aggregation, it may not be necessary to&lt;br /&gt;
completely rework the transaction subsystem. Combining aggregation with an&lt;br /&gt;
ongoing process of targeted reduction of transaction size will provide benefits&lt;br /&gt;
out to at least the medium term. It is unclear whether this direction will be&lt;br /&gt;
sufficient in the long run until we can measure the benefit that aggregation&lt;br /&gt;
will provide.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reducing Transaction Overhead ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To switch tracks completely, I have not addressed general issues with overhead&lt;br /&gt;
in the transaction subsystem itself. There are several points where the&lt;br /&gt;
transaction subsystem will single thread because of filesystem scope locks and&lt;br /&gt;
structures.  We have, for example, the log grant lock for protecting&lt;br /&gt;
reservation and used log space, the AIL lock for tracking dirty metadata, the&lt;br /&gt;
log state lock for state transition of log buffers and other associated&lt;br /&gt;
structure modifications.&lt;br /&gt;
&lt;br /&gt;
We have already started down the path of reducing contention in&lt;br /&gt;
various paths. For example:&lt;br /&gt;
&lt;br /&gt;
	- changing iclog reference counts to atomics to avoid needing the log&lt;br /&gt;
	  state lock on every transaction commit&lt;br /&gt;
	- protecting iclog callback lists with a per-iclog lock instead of the log&lt;br /&gt;
	  state lock&lt;br /&gt;
	- removing the AIL lock from the transaction reserve path by isolating&lt;br /&gt;
	  AIL tail pushing to a single thread instead of being done&lt;br /&gt;
	  synchronously.&lt;br /&gt;
&lt;br /&gt;
Asynchronous transaction aggregation is likely to perturb the current known&lt;br /&gt;
behaviour and bottlenecks as a result of moving all of the log interfacing out&lt;br /&gt;
of the direct transaction commit path.  Similar to moving the AIL pushing into&lt;br /&gt;
it&#039;s own thread, this will mean that there will typically only be a single&lt;br /&gt;
thread formatting and writing to iclog buffers. This will remove much of the&lt;br /&gt;
parallelism that puts excessive pressure on many of these locks.&lt;br /&gt;
&lt;br /&gt;
I am certain that asynchronous transaction aggregation will open up new areas&lt;br /&gt;
of optimisation in the log formatting and dispatch code - it will probably&lt;br /&gt;
enable us to remove a lot of the complexity because we will be able to directly&lt;br /&gt;
control the parallelism in the formatting and dispatch of log buffers. This&lt;br /&gt;
implies that we may not need to be limited to a fixed pool of fixed sized log&lt;br /&gt;
buffers for writing transactions to disk.&lt;br /&gt;
&lt;br /&gt;
However, it is probably best to leave consideration of such optimisations until&lt;br /&gt;
after the asynchronous transaction aggregation is implemented and we can&lt;br /&gt;
directly observe the pain points that become apparent as a result of such a&lt;br /&gt;
change.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reducing Recovery Time ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With 2GB logs, recovery can take an awfully long time due to the need&lt;br /&gt;
to read each object synchronously as we process the jounral. An obvious&lt;br /&gt;
way to avoid this is to add another pass to the processing to do asynchronous&lt;br /&gt;
readahead of all the objects in the log before doing the processing passes.&lt;br /&gt;
This will populate the cache as quickly as possible and hide any read latency&lt;br /&gt;
that could occur as we process commit records.&lt;br /&gt;
&lt;br /&gt;
A logical extension to this is to sort the objects in ascending offset order&lt;br /&gt;
before issuing I/O on them. That will further optimise the readahead I/O&lt;br /&gt;
to reduce seeking and hence should speed up the read phase of recovery&lt;br /&gt;
further.&lt;br /&gt;
&lt;br /&gt;
== ToDo ==&lt;br /&gt;
Further investigation of recovery for future optimisation.&lt;/div&gt;</summary>
		<author><name>Cattelan</name></author>
	</entry>
</feed>