<html>
<head>
<meta name="Content-Style" content="text/css">
</head>
<body>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#FILES">FILES</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<a href="#NOTES">NOTES</a><br>
<!-- Creator : groff version 1.16.1 -->
<!-- CreationDate: Wed Jan 24 01:42:51 2001
-->
<!-- Total number of pages: 2 -->
<!-- Page: 1 -->
<!-- left margin: 220 -->
<!-- right margin: 750 -->
<a name="NAME"></a><h2>NAME</h2><p style="margin-left: 18%"><font size=3>xfs_fsr - filesystem reorganizer for XFS</font></p>
<a name="SYNOPSIS"></a><h2>SYNOPSIS</h2><p style="margin-left: 18%"><font size=3><B>xfs_fsr</B></font> <font size=3>[</font><font size=3><B>-v</B></font><font size=3>] [</font><font size=3><B>-t</B></font> <font size=3>seconds] [</font><font size=3><B>-f</B></font> <font size=3>leftoff] [</font><font size=3><B>-m</B></font> <font size=3>mtab]<br>
<B>xfs_fsr</B></font> <font size=3>[</font><font size=3><B>-v</B></font><font size=3>] [xfsdev | file] ...</font></p>
<a name="DESCRIPTION"></a><h2>DESCRIPTION</h2><p style="margin-left: 18%"><font size=3><I>xfs_fsr</I></font> <font size=3>is applicable only to XFS filesystems.</font></p>
<p style="margin-left: 18%"><font size=3><I>xfs_fsr</I></font> <font size=3>improves the organization of mounted filesystems. The reorganization algorithm operates on one file at a time, compacting or otherwise improving the layout of the file extents (contiguous blocks of file data).</font></p>
<p style="margin-left: 18%"><font size=3>The following options are accepted by</font> <font size=3><I>xfs_fsr</I></font><font size=3>. The</font> <font size=3><B>-m</B></font><font size=3>,</font> <font size=3><B>-t</B></font><font size=3>, and</font> <font size=3><B>-f</B></font> <font size=3>options have no meaning if any filesystems or files are specified on the command line.</font>
<table width="98%" rules="none" frame="none" cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</p>
</td>
<td valign="top" align="left" width="12%">
<p><font size=3><B>-m</B></font> <font size=3><I>mtab</I></font></p>
</td>
<td valign="top" align="left" width="48%">
<p><font size=3>Use this file for the list of filesystems to reorganize.<br>
<I>/etc/mtab</I></font><font size=3>.</font></p>
</td>
<td valign="top" align="left" width="1%">
</td>
<td valign="top" align="left" width="19%">
<p><font size=3>The default is to use</font></p>
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="12%">
<p><font size=3><B>-t</B></font> <font size=3><I>seconds</I></font></p>
</td>
<td valign="top" align="left" width="48%">
<p><font size=3>How long to reorganize. The default is 7200 (2 hours).</font></p>
</td>
<td valign="top" align="left" width="1%">
</td>
<td valign="top" align="left" width="19%">
</td>
</tr>
</table>
<table width="99%" rules="none" frame="none" cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</p>
</td>
<td valign="top" align="left" width="12%">
<p><font size=3><B>-f</B></font> <font size=3><I>leftoff</I></font></p>
</td>
<td valign="top" align="left" width="69%">
<p><font size=3>Use this file instead of</font> <font size=3><I>/var/tmp/.fsrlast</I></font> <font size=3>to read the state of where to start and as the file to store the state of where reorganization left off.</font></p>
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="12%">
<p><font size=3><B>-v</B></font></p>
<p><font size=3>The intended</font></p>
</td>
<td valign="top" align="left" width="69%">
<p><font size=3>Verbose. Print cryptic information about each file being reorganized.</font></p>
<p><font size=3>usage is to regularly run the</font> <font size=3><I>fsr</I></font> <font size=3>command which in turn invokes</font> <font size=3><I>xfs_fsr</I></font> <font size=3>when it</font></p>
</td>
</tr>
</table>
<font size=3>encounters XFS filesystems. By default this is done from</font> <font size=3><I>crontab</I></font> <font size=3>once per week.</font></p>
<p style="margin-left: 18%"><font size=3>When invoked with no arguments</font> <font size=3><I>xfs_fsr</I></font> <font size=3>reorganizes all regular files in all mounted filesystems.</font> <font size=3><I>xfs_fsr</I></font> <font size=3>makes many cycles over</font> <font size=3><I>/etc/mtab</I></font> <font size=3>each time making a single pass over each XFS filesystem. Each pass goes through and selects files that have the largest number of extents. It attempts to defragment the top 10% of these files on each pass.</font></p>
<p style="margin-left: 18%"><font size=3>It runs for up to two hours after which it records the filesystem where it left off, so it can start there the next time. This information is stored in the file</font> <font size=3><I>/var/tmp/.fsrlast_xfs.</I></font> <font size=3>If the information found here is somehow inconsistent or out of date it is ignored and reorganization starts at the beginning of the first filesystem found in</font> <font size=3><I>/etc/mtab</I></font><font size=3>.</font></p>
<p style="margin-left: 18%"><font size=3><I>xfs_fsr</I></font> <font size=3>can be called with one or more arguments naming filesystems (block device name), and files to reorganize. In this mode</font> <font size=3><I>xfs_fsr</I></font> <font size=3>does not read or write</font> <font size=3><I>/var/tmp/.fsrlast_xfs</I></font> <font size=3>nor does it run for a fixed time interval. It makes one pass through each specified regular file and all regular files in each specified filesystem. A command line name referring to a symbolic link (except to a file system device), FIFO, or UNIX domain socket generates a warning message, but is otherwise ignored. While traversing the filesystem these types of files are silently skipped.</font></p>
<a name="FILES"></a><h2>FILES</h2>
<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="81%">
<p><font size=3>/etc/mtab</font></p>
</td>
</tr>
</table>
<br>
<p style="margin-left: 18%"><font size=3>/var/tmp/.fsrlast_xfs records the state where reorganization left off.</font></p>
<a name="SEE ALSO"></a><h2>SEE ALSO</h2><p style="margin-left: 18%"><font size=3>xfs_fsr(8), mkfs.xfs(8), xfs_ncheck(8), xfs(5).</font></p>
<a name="NOTES"></a><h2>NOTES</h2><p style="margin-left: 18%"><font size=3><I>xfs_fsr</I></font> <font size=3>improves the layout of extents for each file by copying the entire file to a temporary location and then interchanging the data extents of the target and temporary files in an atomic manner. This method requires that enough free disk space be available to copy any given file and that the space be less fragmented then the original file. It also requires the owner of the file to have enough remaining filespace quota to do the copy on systems running quotas.</font> <font size=3><I>xfs_fsr</I></font> <font size=3>generates a warning message if space is not sufficient to improve the target file.</font></p>
<p style="margin-left: 18%"><font size=3>A temporary file used in improving a file given on the command line is created in the same parent directory of the target file and is prefixed by the string '</font><font size=3><B>.fsr</B></font><font size=3>'. The temporary files used in improving an entire XFS device are stored in a directory at the root of the target device and use the same naming scheme. The temporary files are unlinked upon creation so data will not be readable by any other process.</font></p>
<p style="margin-left: 18%"><font size=3><I>xfs_fsr</I></font> <font size=3>does not operate on files that are currently mapped in memory. A 'file busy' error can be seen for these files if the verbose flag (</font><font size=3><B>­v</B></font><font size=3>) is set.</font></p>
<p style="margin-left: 18%"><font size=3>An entry in</font> <font size=3><I>/etc/mtab</I></font> <font size=3>or the file specified using the</font> <font size=3><B>-m</B></font> <font size=3>option must have the</font> <font size=3><B>rw</B></font> <font size=3>option</font><br>
</p>
<!-- Page: 2 -->
<!-- left margin: 220 -->
<!-- right margin: 750 -->
<p style="margin-left: 18%"><font size=3>specified for read and write access. If this option is not present, then</font> <font size=3><I>xfs_fsr</I></font> <font size=3>skips the filesystem described by that line. See the</font> <font size=3><I>fstab</I></font><font size=3>(5) reference page for more details.</font><br>
</p>
</body>
</html>