1077 lines
28 KiB
HTML
1077 lines
28 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of TUNE2FS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>TUNE2FS</H1>
|
|
Section: Maintenance Commands (8)<BR>Updated: January 2020<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
tune2fs - adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>tune2fs</B>
|
|
|
|
[
|
|
<B>-l</B>
|
|
|
|
]
|
|
[
|
|
<B>-c</B>
|
|
|
|
<I>max-mount-counts</I>
|
|
|
|
]
|
|
[
|
|
<B>-e</B>
|
|
|
|
<I>errors-behavior</I>
|
|
|
|
]
|
|
[
|
|
<B>-f</B>
|
|
|
|
]
|
|
[
|
|
<B>-i</B>
|
|
|
|
<I>interval-between-checks</I>
|
|
|
|
]
|
|
[
|
|
<B>-I</B>
|
|
|
|
<I>new_inode_size</I>
|
|
|
|
]
|
|
[
|
|
<B>-j</B>
|
|
|
|
]
|
|
[
|
|
<B>-J</B>
|
|
|
|
<I>journal-options</I>
|
|
|
|
]
|
|
[
|
|
<B>-m</B>
|
|
|
|
<I>reserved-blocks-percentage</I>
|
|
|
|
]
|
|
[
|
|
<B>-o</B>
|
|
|
|
[^]mount-options<I>[,...]</I>
|
|
|
|
]
|
|
[
|
|
<B>-r</B>
|
|
|
|
<I>reserved-blocks-count</I>
|
|
|
|
]
|
|
[
|
|
<B>-u</B>
|
|
|
|
<I>user</I>
|
|
|
|
]
|
|
[
|
|
<B>-g</B>
|
|
|
|
<I>group</I>
|
|
|
|
]
|
|
[
|
|
<B>-C</B>
|
|
|
|
<I>mount-count</I>
|
|
|
|
]
|
|
[
|
|
<B>-E</B>
|
|
|
|
<I>extended-options</I>
|
|
|
|
]
|
|
[
|
|
<B>-L</B>
|
|
|
|
<I>volume-label</I>
|
|
|
|
]
|
|
[
|
|
<B>-M</B>
|
|
|
|
<I>last-mounted-directory</I>
|
|
|
|
]
|
|
[
|
|
<B>-O</B>
|
|
|
|
[^]<I>feature</I>[,...]
|
|
|
|
]
|
|
[
|
|
<B>-Q</B>
|
|
|
|
<I>quota-options</I>
|
|
|
|
]
|
|
[
|
|
<B>-T</B>
|
|
|
|
<I>time-last-checked</I>
|
|
|
|
]
|
|
[
|
|
<B>-U</B>
|
|
|
|
<I>UUID</I>
|
|
|
|
]
|
|
[
|
|
<B>-z</B>
|
|
|
|
<I>undo_file</I>
|
|
|
|
]
|
|
device
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>tune2fs</B>
|
|
|
|
allows the system administrator to adjust various tunable filesystem
|
|
parameters on Linux ext2, ext3, or ext4 filesystems. The current values
|
|
of these options can be displayed by using the
|
|
<B>-l</B>
|
|
|
|
option to
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tune2fs">tune2fs</A></B>(8)
|
|
|
|
program, or by using the
|
|
<B><A HREF="/cgi-bin/man/man2html?8+dumpe2fs">dumpe2fs</A></B>(8)
|
|
|
|
program.
|
|
<P>
|
|
|
|
The
|
|
<I>device</I>
|
|
|
|
specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID
|
|
specifier: "<B>LABEL=</B><I>volume-label</I>" or "<B>UUID=</B><I>uuid</I>". (i.e.,
|
|
LABEL=home or UUID=e40486c6-84d5-4f2f-b99c-032281799c9d).
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-c</B><I> max-mount-counts</I>
|
|
|
|
<DD>
|
|
Adjust the number of mounts after which the filesystem will be checked by
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8).
|
|
|
|
If
|
|
<I>max-mount-counts</I>
|
|
|
|
is 0 or -1, the number of times the filesystem is mounted will be disregarded
|
|
by
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
and the kernel.
|
|
<P>
|
|
Staggering the mount-counts at which filesystems are forcibly
|
|
checked will avoid all filesystems being checked at one time
|
|
when using journaled filesystems.
|
|
<P>
|
|
Mount-count-dependent checking is disabled by default to avoid
|
|
unanticipated long reboots while e2fsck does its work. However,
|
|
you may wish to consider the consequences of disabling
|
|
mount-count-dependent checking entirely. Bad disk drives, cables,
|
|
memory, and kernel bugs could all corrupt a filesystem without
|
|
marking the filesystem dirty or in error. If you are using
|
|
journaling on your filesystem, your filesystem will
|
|
<B>never</B>
|
|
|
|
be marked dirty, so it will not normally be checked. A
|
|
filesystem error detected by the kernel will still force
|
|
an fsck on the next reboot, but it may already be too late
|
|
to prevent data loss at that point.
|
|
<P>
|
|
See also the
|
|
<B>-i</B>
|
|
|
|
option for time-dependent checking.
|
|
<DT id="2"><B>-C</B><I> mount-count</I>
|
|
|
|
<DD>
|
|
Set the number of times the filesystem has been mounted.
|
|
If set to a greater value than the max-mount-counts parameter
|
|
set by the
|
|
<B>-c</B>
|
|
|
|
option,
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
will check the filesystem at the next reboot.
|
|
<DT id="3"><B>-e</B><I> error-behavior</I>
|
|
|
|
<DD>
|
|
Change the behavior of the kernel code when errors are detected.
|
|
In all cases, a filesystem error will cause
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
to check the filesystem on the next boot.
|
|
<I>error-behavior</I>
|
|
|
|
can be one of the following:
|
|
<DL COMPACT><DT id="4"><DD>
|
|
<DL COMPACT>
|
|
<DT id="5"><B>continue</B>
|
|
|
|
<DD>
|
|
Continue normal execution.
|
|
<DT id="6"><B>remount-ro</B>
|
|
|
|
<DD>
|
|
Remount filesystem read-only.
|
|
<DT id="7"><B>panic</B>
|
|
|
|
<DD>
|
|
Cause a kernel panic.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="8"><B>-E</B><I> extended-options</I>
|
|
|
|
<DD>
|
|
Set extended options for the filesystem. Extended options are comma
|
|
separated, and may take an argument using the equals ('=') sign.
|
|
The following extended options are supported:
|
|
<DL COMPACT><DT id="9"><DD>
|
|
<DL COMPACT>
|
|
<DT id="10"><B>clear_mmp</B>
|
|
|
|
<DD>
|
|
Reset the MMP block (if any) back to the clean state. Use only if
|
|
absolutely certain the device is not currently mounted or being
|
|
fscked, or major filesystem corruption can result. Needs '-f'.
|
|
<DT id="11"><B>mmp_update_interval=</B><I>interval</I>
|
|
|
|
<DD>
|
|
Adjust the initial MMP update interval to
|
|
<I>interval</I>
|
|
|
|
seconds. Specifying an
|
|
<I>interval</I>
|
|
|
|
of 0 means to use the default interval. The specified interval must
|
|
be less than 300 seconds. Requires that the
|
|
<B>mmp</B>
|
|
|
|
feature be enabled.
|
|
<DT id="12"><B>stride=</B><I>stride-size</I>
|
|
|
|
<DD>
|
|
Configure the filesystem for a RAID array with
|
|
<I>stride-size</I>
|
|
|
|
filesystem blocks. This is the number of blocks read or written to disk
|
|
before moving to next disk. This mostly affects placement of filesystem
|
|
metadata like bitmaps at
|
|
<B><A HREF="/cgi-bin/man/man2html?2+mke2fs">mke2fs</A></B>(2)
|
|
|
|
time to avoid placing them on a single disk, which can hurt the performance.
|
|
It may also be used by block allocator.
|
|
<DT id="13"><B>stripe_width=</B><I>stripe-width</I>
|
|
|
|
<DD>
|
|
Configure the filesystem for a RAID array with
|
|
<I>stripe-width</I>
|
|
|
|
filesystem blocks per stripe. This is typically be stride-size * N, where
|
|
N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2).
|
|
This allows the block allocator to prevent read-modify-write of the
|
|
parity in a RAID stripe if possible when the data is written.
|
|
<DT id="14"><B>hash_alg=</B><I>hash-alg</I>
|
|
|
|
<DD>
|
|
Set the default hash algorithm used for filesystems with hashed b-tree
|
|
directories. Valid algorithms accepted are:
|
|
<I>legacy</I>,
|
|
|
|
<I>half_md4</I>,
|
|
|
|
and
|
|
<I>tea</I>.
|
|
|
|
<DT id="15"><B>mount_opts=</B><I>mount_option_string</I>
|
|
|
|
<DD>
|
|
Set a set of default mount options which will be used when the file
|
|
system is mounted. Unlike the bitmask-based default mount options which
|
|
can be specified with the
|
|
<B>-o</B>
|
|
|
|
option,
|
|
<I>mount_option_string</I>
|
|
|
|
is an arbitrary string with a maximum length of 63 bytes, which is
|
|
stored in the superblock.
|
|
<DT id="16"><DD>
|
|
The ext4 file system driver will first apply
|
|
the bitmask-based default options, and then parse the
|
|
<I>mount_option_string</I>,
|
|
|
|
before parsing the mount options passed from the
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mount">mount</A></B>(8)
|
|
|
|
program.
|
|
<DT id="17"><DD>
|
|
This superblock setting is only honored in 2.6.35+ kernels;
|
|
and not at all by the ext2 and ext3 file system drivers.
|
|
<DT id="18"><B>force_fsck</B>
|
|
|
|
<DD>
|
|
Set a flag in the filesystem superblock indicating that errors have been found.
|
|
This will force fsck to run at the next mount.
|
|
<DT id="19"><B>test_fs</B>
|
|
|
|
<DD>
|
|
Set a flag in the filesystem superblock indicating that it may be
|
|
mounted using experimental kernel code, such as the ext4dev filesystem.
|
|
<DT id="20"><B>^test_fs</B>
|
|
|
|
<DD>
|
|
Clear the test_fs flag, indicating the filesystem should only be mounted
|
|
using production-level filesystem code.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="21"><B>-f</B>
|
|
|
|
<DD>
|
|
Force the tune2fs operation to complete even in the face of errors. This
|
|
option is useful when removing the
|
|
<B>has_journal</B>
|
|
|
|
filesystem feature from a filesystem which has
|
|
an external journal (or is corrupted
|
|
such that it appears to have an external journal), but that
|
|
external journal is not available. If the filesystem appears to require
|
|
journal replay, the
|
|
<B>-f</B>
|
|
|
|
flag must be specified twice to proceed.
|
|
<P>
|
|
<B>WARNING:</B>
|
|
|
|
Removing an external journal from a filesystem which was not cleanly unmounted
|
|
without first replaying the external journal can result in
|
|
severe data loss and filesystem corruption.
|
|
<DT id="22"><B>-g</B><I> group</I>
|
|
|
|
<DD>
|
|
Set the group which can use the reserved filesystem blocks.
|
|
The
|
|
<I>group</I>
|
|
|
|
parameter can be a numerical gid or a group name. If a group name is given,
|
|
it is converted to a numerical gid before it is stored in the superblock.
|
|
<DT id="23"><B>-i </B><I>interval-between-checks</I>[<B>d</B>|<B>m</B>|<B>w</B>]
|
|
|
|
<DD>
|
|
Adjust the maximal time between two filesystem checks.
|
|
No suffix or
|
|
<B>d</B>
|
|
|
|
will interpret the number
|
|
<I>interval-between-checks</I>
|
|
|
|
as days,
|
|
<B>m</B>
|
|
|
|
as months, and
|
|
<B>w</B>
|
|
|
|
as weeks. A value of zero will disable the time-dependent checking.
|
|
<P>
|
|
There are pros and cons to disabling these periodic checks; see the
|
|
discussion under the
|
|
<B>-c</B>
|
|
|
|
(mount-count-dependent check) option for details.
|
|
<DT id="24"><B>-I</B>
|
|
|
|
<DD>
|
|
Change the inode size used by the file system. This requires rewriting
|
|
the inode table, so it requires that the file system is checked for
|
|
consistency first using
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8).
|
|
|
|
This operation can also take a while and the file system can be
|
|
corrupted and data lost if it is interrupted while in the middle of
|
|
converting the file system.
|
|
<DT id="25"><B>-j</B>
|
|
|
|
<DD>
|
|
Add an ext3 journal to the filesystem. If the
|
|
<B>-J</B>
|
|
|
|
option is not specified, the default journal parameters will be used to create
|
|
an appropriately sized journal (given the size of the filesystem)
|
|
stored within the filesystem. Note that you must be using a kernel
|
|
which has ext3 support in order to actually make use of the journal.
|
|
<DT id="26"><DD>
|
|
If this option is used to create a journal on a mounted filesystem, an
|
|
immutable file,
|
|
<B>.journal</B>,
|
|
|
|
will be created in the top-level directory of the filesystem, as it is
|
|
the only safe way to create the journal inode while the filesystem is
|
|
mounted. While the ext3 journal is visible, it is not safe to
|
|
delete it, or modify it while the filesystem is mounted; for this
|
|
reason the file is marked immutable.
|
|
While checking unmounted filesystems,
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
will automatically move
|
|
<B>.journal</B>
|
|
|
|
files to the invisible, reserved journal inode. For all filesystems
|
|
except for the root filesystem, this should happen automatically and
|
|
naturally during the next reboot cycle. Since the root filesystem is
|
|
mounted read-only,
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
must be run from a rescue floppy in order to effect this transition.
|
|
<DT id="27"><DD>
|
|
On some distributions, such as Debian, if an initial ramdisk is used,
|
|
the initrd scripts will automatically convert an ext2 root filesystem
|
|
to ext3 if the
|
|
<B>/etc/fstab</B>
|
|
|
|
file specifies the ext3 filesystem for the root filesystem in order to
|
|
avoid requiring the use of a rescue floppy to add an ext3 journal to
|
|
the root filesystem.
|
|
<DT id="28"><B>-J</B> journal-options
|
|
|
|
<DD>
|
|
Override the default ext3 journal parameters. Journal options are comma
|
|
separated, and may take an argument using the equals ('=') sign.
|
|
The following journal options are supported:
|
|
<DL COMPACT><DT id="29"><DD>
|
|
<DL COMPACT>
|
|
<DT id="30"><B>size=</B><I>journal-size</I>
|
|
|
|
<DD>
|
|
Create a journal stored in the filesystem of size
|
|
<I>journal-size</I>
|
|
|
|
megabytes. The size of the journal must be at least 1024 filesystem blocks
|
|
(i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.)
|
|
and may be no more than 10,240,000 filesystem blocks.
|
|
There must be enough free space in the filesystem to create a journal of
|
|
that size.
|
|
<DT id="31"><B>location</B><I>=journal-location</I>
|
|
|
|
<DD>
|
|
Specify the location of the journal. The argument
|
|
<I>journal-location</I>
|
|
|
|
can either be specified as a block number, or if the number has a units
|
|
suffix (e.g., 'M', 'G', etc.) interpret it as the offset from the
|
|
beginning of the file system.
|
|
<DT id="32"><B>device=</B><I>external-journal</I>
|
|
|
|
<DD>
|
|
Attach the filesystem to the journal block device located on
|
|
<I>external-journal</I>.
|
|
|
|
The external
|
|
journal must have been already created using the command
|
|
<DT id="33"><DD>
|
|
<B>mke2fs -O journal_dev</B>
|
|
|
|
<I>external-journal</I>
|
|
|
|
<DT id="34"><DD>
|
|
Note that
|
|
<I>external-journal</I>
|
|
|
|
must be formatted with the same block
|
|
size as filesystems which will be using it.
|
|
In addition, while there is support for attaching
|
|
multiple filesystems to a single external journal,
|
|
the Linux kernel and
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
do not currently support shared external journals yet.
|
|
<DT id="35"><DD>
|
|
Instead of specifying a device name directly,
|
|
<I>external-journal</I>
|
|
|
|
can also be specified by either
|
|
<B>LABEL=</B><I>label</I>
|
|
|
|
or
|
|
<B>UUID=</B><I>UUID</I>
|
|
|
|
to locate the external journal by either the volume label or UUID
|
|
stored in the ext2 superblock at the start of the journal. Use
|
|
<B><A HREF="/cgi-bin/man/man2html?8+dumpe2fs">dumpe2fs</A></B>(8)
|
|
|
|
to display a journal device's volume label and UUID. See also the
|
|
<B>-L</B>
|
|
|
|
option of
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tune2fs">tune2fs</A></B>(8).
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="36"><DD>
|
|
Only one of the
|
|
<B>size</B> or <B>device</B>
|
|
|
|
options can be given for a filesystem.
|
|
<DT id="37"><B>-l</B>
|
|
|
|
<DD>
|
|
List the contents of the filesystem superblock, including the current
|
|
values of the parameters that can be set via this program.
|
|
<DT id="38"><B>-L</B><I> volume-label</I>
|
|
|
|
<DD>
|
|
Set the volume label of the filesystem.
|
|
Ext2 filesystem labels can be at most 16 characters long; if
|
|
<I>volume-label</I>
|
|
|
|
is longer than 16 characters,
|
|
<B>tune2fs</B>
|
|
|
|
will truncate it and print a warning. The volume label can be used
|
|
by
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mount">mount</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fsck">fsck</A></B>(8),
|
|
|
|
and
|
|
<B>/etc/<A HREF="/cgi-bin/man/man2html?5+fstab">fstab</A></B>(5)
|
|
|
|
(and possibly others) by specifying
|
|
<B>LABEL=</B><I>volume-label</I>
|
|
|
|
instead of a block special device name like
|
|
<B>/dev/hda5</B>.
|
|
|
|
<DT id="39"><B>-m</B><I> reserved-blocks-percentage</I>
|
|
|
|
<DD>
|
|
Set the percentage of the filesystem which may only be allocated
|
|
by privileged processes. Reserving some number of filesystem blocks
|
|
for use by privileged processes is done
|
|
to avoid filesystem fragmentation, and to allow system
|
|
daemons, such as
|
|
<B><A HREF="/cgi-bin/man/man2html?8+syslogd">syslogd</A></B>(8),
|
|
|
|
to continue to function correctly after non-privileged processes are
|
|
prevented from writing to the filesystem. Normally, the default percentage
|
|
of reserved blocks is 5%.
|
|
<DT id="40"><B>-M</B><I> last-mounted-directory</I>
|
|
|
|
<DD>
|
|
Set the last-mounted directory for the filesystem.
|
|
<DT id="41"><B>-o</B> [^]<I>mount-option</I>[,...]
|
|
|
|
<DD>
|
|
Set or clear the indicated default mount options in the filesystem.
|
|
Default mount options can be overridden by mount options specified
|
|
either in
|
|
<B>/etc/<A HREF="/cgi-bin/man/man2html?5+fstab">fstab</A></B>(5)
|
|
|
|
or on the command line arguments to
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mount">mount</A></B>(8).
|
|
|
|
Older kernels may not support this feature; in particular,
|
|
kernels which predate 2.4.20 will almost certainly ignore the
|
|
default mount options field in the superblock.
|
|
<DT id="42"><DD>
|
|
More than one mount option can be cleared or set by separating
|
|
features with commas. Mount options prefixed with a
|
|
caret character ('^') will be cleared in the filesystem's superblock;
|
|
mount options without a prefix character or prefixed with a plus
|
|
character ('+') will be added to the filesystem.
|
|
<DT id="43"><DD>
|
|
The following mount options can be set or cleared using
|
|
<B>tune2fs</B>:
|
|
|
|
<DL COMPACT><DT id="44"><DD>
|
|
<DL COMPACT>
|
|
<DT id="45"><B>debug</B>
|
|
|
|
<DD>
|
|
Enable debugging code for this filesystem.
|
|
<DT id="46"><B>bsdgroups</B>
|
|
|
|
<DD>
|
|
Emulate BSD behavior when creating new files: they will take the group-id
|
|
of the directory in which they were created. The standard System V behavior
|
|
is the default, where newly created files take on the fsgid of the current
|
|
process, unless the directory has the setgid bit set, in which case it takes
|
|
the gid from the parent directory, and also gets the setgid bit set if it is
|
|
a directory itself.
|
|
<DT id="47"><B>user_xattr</B>
|
|
|
|
<DD>
|
|
Enable user-specified extended attributes.
|
|
<DT id="48"><B>acl</B>
|
|
|
|
<DD>
|
|
Enable Posix Access Control Lists.
|
|
<DT id="49"><B>uid16</B>
|
|
|
|
<DD>
|
|
Disables 32-bit UIDs and GIDs. This is for interoperability with
|
|
older kernels which only store and expect 16-bit values.
|
|
<DT id="50"><B>journal_data</B>
|
|
|
|
<DD>
|
|
When the filesystem is mounted with journalling enabled, all data
|
|
(not just metadata) is committed into the journal prior to being written
|
|
into the main filesystem.
|
|
<DT id="51"><B>journal_data_ordered</B>
|
|
|
|
<DD>
|
|
When the filesystem is mounted with journalling enabled, all data is forced
|
|
directly out to the main file system prior to its metadata being committed
|
|
to the journal.
|
|
<DT id="52"><B>journal_data_writeback</B>
|
|
|
|
<DD>
|
|
When the filesystem is mounted with journalling enabled, data may be
|
|
written into the main filesystem after its metadata has been committed
|
|
to the journal. This may increase throughput, however, it may allow old
|
|
data to appear in files after a crash and journal recovery.
|
|
<DT id="53"><B>nobarrier</B>
|
|
|
|
<DD>
|
|
The file system will be mounted with barrier operations in the journal
|
|
disabled. (This option is currently only supported by the ext4 file
|
|
system driver in 2.6.35+ kernels.)
|
|
<DT id="54"><B>block_validity</B>
|
|
|
|
<DD>
|
|
The file system will be mounted with the block_validity option enabled,
|
|
which causes extra checks to be performed after reading or writing from
|
|
the file system. This prevents corrupted metadata blocks from causing
|
|
file system damage by overwriting parts of the inode table or block
|
|
group descriptors. This comes at the cost of increased memory and CPU
|
|
overhead, so it is enabled only for debugging purposes. (This option is
|
|
currently only supported by the ext4 file system driver in 2.6.35+
|
|
kernels.)
|
|
<DT id="55"><B>discard</B>
|
|
|
|
<DD>
|
|
The file system will be mounted with the discard mount option. This will
|
|
cause the file system driver to attempt to use the trim/discard feature
|
|
of some storage devices (such as SSD's and thin-provisioned drives
|
|
available in some enterprise storage arrays) to inform the storage
|
|
device that blocks belonging to deleted files can be reused for other
|
|
purposes. (This option is currently only supported by the ext4 file
|
|
system driver in 2.6.35+ kernels.)
|
|
<DT id="56"><B>nodelalloc</B>
|
|
|
|
<DD>
|
|
The file system will be mounted with the nodelalloc mount option. This
|
|
will disable the delayed allocation feature. (This option is currently
|
|
only supported by the ext4 file system driver in 2.6.35+ kernels.)
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="57"><B>-O</B> [^]<I>feature</I>[,...]
|
|
|
|
<DD>
|
|
Set or clear the indicated filesystem features (options) in the filesystem.
|
|
More than one filesystem feature can be cleared or set by separating
|
|
features with commas. Filesystem features prefixed with a
|
|
caret character ('^') will be cleared in the filesystem's superblock;
|
|
filesystem features without a prefix character or prefixed with a plus
|
|
character ('+') will be added to the filesystem. For a detailed
|
|
description of the file system features, please see the man page
|
|
<B><A HREF="/cgi-bin/man/man2html?5+ext4">ext4</A></B>(5).
|
|
|
|
<DT id="58"><DD>
|
|
The following filesystem features can be set or cleared using
|
|
<B>tune2fs</B>:
|
|
|
|
<DL COMPACT><DT id="59"><DD>
|
|
<DL COMPACT>
|
|
<DT id="60"><B>64bit</B>
|
|
|
|
<DD>
|
|
Enable the file system to be larger than 2^32 blocks.
|
|
<DT id="61"><B>dir_index</B>
|
|
|
|
<DD>
|
|
Use hashed b-trees to speed up lookups for large directories.
|
|
<DT id="62"><B>dir_nlink</B>
|
|
|
|
<DD>
|
|
Allow more than 65000 subdirectories per directory.
|
|
<DT id="63"><B>ea_inode</B>
|
|
|
|
<DD>
|
|
Allow the value of each extended attribute to be placed in the data blocks of a
|
|
separate inode if necessary, increasing the limit on the size and number of
|
|
extended attributes per file.
|
|
<B>Tune2fs</B>
|
|
|
|
currently only supports setting this filesystem feature.
|
|
<DT id="64"><B>encrypt</B>
|
|
|
|
<DD>
|
|
Enable support for file system level encryption.
|
|
<B>Tune2fs</B>
|
|
|
|
currently only supports setting this filesystem feature.
|
|
<DT id="65"><B>extent</B>
|
|
|
|
<DD>
|
|
Enable the use of extent trees to store the location of data blocks in inodes.
|
|
<B>Tune2fs</B>
|
|
|
|
currently only supports setting this filesystem feature.
|
|
<DT id="66"><B>extra_isize</B>
|
|
|
|
<DD>
|
|
Enable the extended inode fields used by ext4.
|
|
<DT id="67"><B>filetype</B>
|
|
|
|
<DD>
|
|
Store file type information in directory entries.
|
|
<DT id="68"><B>flex_bg</B>
|
|
|
|
<DD>
|
|
Allow bitmaps and inode tables for a block group to be placed
|
|
anywhere on the storage media. <B>Tune2fs</B> will not reorganize
|
|
the location of the inode tables and allocation bitmaps, as
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mke2fs">mke2fs</A></B>(8)
|
|
|
|
will do when it creates a freshly formatted file system with
|
|
<B>flex_bg</B>
|
|
|
|
enabled.
|
|
<DT id="69"><B>has_journal</B>
|
|
|
|
<DD>
|
|
Use a journal to ensure filesystem consistency even across unclean shutdowns.
|
|
Setting the filesystem feature is equivalent to using the
|
|
<B>-j</B>
|
|
|
|
option.
|
|
<DT id="70"><B>large_dir</B>
|
|
|
|
<DD>
|
|
Increase the limit on the number of files per directory.
|
|
<B>Tune2fs</B>
|
|
|
|
currently only supports setting this filesystem feature.
|
|
<DT id="71"><B>huge_file</B>
|
|
|
|
<DD>
|
|
Support files larger than 2 terabytes in size.
|
|
<DT id="72"><B>large_file</B>
|
|
|
|
<DD>
|
|
Filesystem can contain files that are greater than 2GB.
|
|
<DT id="73"><B>metadata_csum</B>
|
|
|
|
<DD>
|
|
Store a checksum to protect the contents in each metadata block.
|
|
<DT id="74"><B>metadata_csum_seed</B>
|
|
|
|
<DD>
|
|
Allow the filesystem to store the metadata checksum seed in the
|
|
superblock, enabling the administrator to change the UUID of a filesystem
|
|
using the
|
|
<B>metadata_csum</B>
|
|
|
|
feature while it is mounted.
|
|
<DT id="75"><B>mmp</B>
|
|
|
|
<DD>
|
|
Enable or disable multiple mount protection (MMP) feature.
|
|
<DT id="76"><B>project</B>
|
|
|
|
<DD>
|
|
Enable project ID tracking. This is used for project quota tracking.
|
|
<DT id="77"><B>quota</B>
|
|
|
|
<DD>
|
|
Enable internal file system quota inodes.
|
|
<DT id="78"><B>read-only</B>
|
|
|
|
<DD>
|
|
Force the kernel to mount the file system read-only.
|
|
<DT id="79"><B>resize_inode</B>
|
|
|
|
<DD>
|
|
Reserve space so the block group descriptor table may grow in the
|
|
future.
|
|
<B>Tune2fs</B>
|
|
|
|
only supports clearing this filesystem feature.
|
|
<DT id="80"><B>sparse_super</B>
|
|
|
|
<DD>
|
|
Limit the number of backup superblocks to save space on large filesystems.
|
|
<B>Tune2fs</B>
|
|
|
|
currently only supports setting this filesystem feature.
|
|
<DT id="81"><B>uninit_bg</B>
|
|
|
|
<DD>
|
|
Allow the kernel to initialize bitmaps and inode tables lazily, and to
|
|
keep a high watermark for the unused inodes in a filesystem, to reduce
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
time. The first e2fsck run after enabling this feature will take the
|
|
full time, but subsequent e2fsck runs will take only a fraction of the
|
|
original time, depending on how full the file system is.
|
|
<DT id="82"><B>verity</B>
|
|
|
|
<DD>
|
|
Enable support for verity protected files.
|
|
<B>Tune2fs</B>
|
|
|
|
currently only supports setting this filesystem feature.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="83"><DD>
|
|
After setting or clearing
|
|
<B>sparse_super</B>,
|
|
|
|
<B>uninit_bg</B>,
|
|
|
|
<B>filetype</B>,
|
|
|
|
or
|
|
<B>resize_inode</B>
|
|
|
|
filesystem features,
|
|
the file system may require being checked using
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
to return the filesystem to a consistent state.
|
|
<B>Tune2fs</B>
|
|
|
|
will print a message requesting that the system administrator run
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8)
|
|
|
|
if necessary. After setting the
|
|
<B>dir_index</B>
|
|
|
|
feature,
|
|
<B>e2fsck -D</B>
|
|
|
|
can be run to convert existing directories to the hashed B-tree format.
|
|
Enabling certain filesystem features may prevent the filesystem from being
|
|
mounted by kernels which do not support those features. In particular, the
|
|
<B>uninit_bg</B>
|
|
|
|
and
|
|
<B>flex_bg</B>
|
|
|
|
features are only supported by the ext4 filesystem.
|
|
<DT id="84"><B>-r</B><I> reserved-blocks-count</I>
|
|
|
|
<DD>
|
|
Set the number of reserved filesystem blocks.
|
|
<DT id="85"><B>-Q</B><I> quota-options</I>
|
|
|
|
<DD>
|
|
Sets 'quota' feature on the superblock and works on the quota files for the
|
|
given quota type. Quota options could be one or more of the following:
|
|
<DL COMPACT><DT id="86"><DD>
|
|
<DL COMPACT>
|
|
<DT id="87"><B>[^]usrquota</B>
|
|
|
|
<DD>
|
|
Sets/clears user quota inode in the superblock.
|
|
<DT id="88"><B>[^]grpquota</B>
|
|
|
|
<DD>
|
|
Sets/clears group quota inode in the superblock.
|
|
<DT id="89"><B>[^]prjquota</B>
|
|
|
|
<DD>
|
|
Sets/clears project quota inode in the superblock.
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="90"><B>-T</B><I> time-last-checked</I>
|
|
|
|
<DD>
|
|
Set the time the filesystem was last checked using
|
|
<B>e2fsck</B>.
|
|
|
|
The time is interpreted using the current (local) timezone.
|
|
This can be useful in scripts which use a Logical Volume Manager to make
|
|
a consistent snapshot of a filesystem, and then check the filesystem
|
|
during off hours to make sure it hasn't been corrupted due to
|
|
hardware problems, etc. If the filesystem was clean, then this option can
|
|
be used to set the last checked time on the original filesystem. The format
|
|
of
|
|
<I>time-last-checked</I>
|
|
|
|
is the international date format, with an optional time specifier, i.e.
|
|
YYYYMMDD[HH[MM[SS]]]. The keyword
|
|
<B>now</B>
|
|
|
|
is also accepted, in which case the last checked time will be set to the
|
|
current time.
|
|
<DT id="91"><B>-u</B><I> user</I>
|
|
|
|
<DD>
|
|
Set the user who can use the reserved filesystem blocks.
|
|
<I>user</I>
|
|
|
|
can be a numerical uid or a user name. If a user name is given, it
|
|
is converted to a numerical uid before it is stored in the superblock.
|
|
<DT id="92"><B>-U</B><I> UUID</I>
|
|
|
|
<DD>
|
|
Set the universally unique identifier (UUID) of the filesystem to
|
|
<I>UUID</I>.
|
|
|
|
The format of the UUID is a series of hex digits separated by hyphens,
|
|
like this:
|
|
"c1b9d5a2-f162-11cf-9ece-0020afc76f16".
|
|
The
|
|
<I>UUID</I>
|
|
|
|
parameter may also be one of the following:
|
|
<DL COMPACT><DT id="93"><DD>
|
|
<DL COMPACT>
|
|
<DT id="94"><I>clear</I>
|
|
|
|
<DD>
|
|
clear the filesystem UUID
|
|
<DT id="95"><I>random</I>
|
|
|
|
<DD>
|
|
generate a new randomly-generated UUID
|
|
<DT id="96"><I>time</I>
|
|
|
|
<DD>
|
|
generate a new time-based UUID
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="97"><DD>
|
|
The UUID may be used by
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mount">mount</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fsck">fsck</A></B>(8),
|
|
|
|
and
|
|
<B>/etc/<A HREF="/cgi-bin/man/man2html?5+fstab">fstab</A></B>(5)
|
|
|
|
(and possibly others) by specifying
|
|
<B>UUID=</B><I>uuid</I>
|
|
|
|
instead of a block special device name like
|
|
<B>/dev/hda1</B>.
|
|
|
|
<DT id="98"><DD>
|
|
See
|
|
<B><A HREF="/cgi-bin/man/man2html?8+uuidgen">uuidgen</A></B>(8)
|
|
|
|
for more information.
|
|
If the system does not have a good random number generator such as
|
|
<I>/dev/random</I>
|
|
|
|
or
|
|
<I>/dev/urandom</I>,
|
|
|
|
<B>tune2fs</B>
|
|
|
|
will automatically use a time-based UUID instead of a randomly-generated UUID.
|
|
<DT id="99"><B>-z</B><I> undo_file</I>
|
|
|
|
<DD>
|
|
Before overwriting a file system block, write the old contents of the block to
|
|
an undo file. This undo file can be used with <A HREF="/cgi-bin/man/man2html?8+e2undo">e2undo</A>(8) to restore the old
|
|
contents of the file system should something go wrong. If the empty string is
|
|
passed as the undo_file argument, the undo file will be written to a file named
|
|
tune2fs-<I>device</I>.e2undo in the directory specified via the
|
|
<I>E2FSPROGS_UNDO_DIR</I> environment variable.
|
|
<P>
|
|
WARNING: The undo file cannot be used to recover from a power or system crash.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
We haven't found any bugs yet. That doesn't mean there aren't any...
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
<B>tune2fs</B>
|
|
|
|
was written by Remy Card <<A HREF="mailto:Remy.Card@linux.org">Remy.Card@linux.org</A>>. It is currently being
|
|
maintained by Theodore Ts'o <<A HREF="mailto:tytso@alum.mit.edu">tytso@alum.mit.edu</A>>.
|
|
<B>tune2fs</B>
|
|
|
|
uses the ext2fs library written by Theodore Ts'o <<A HREF="mailto:tytso@mit.edu">tytso@mit.edu</A>>.
|
|
This manual page was written by Christian Kuhtz <<A HREF="mailto:chk@data-hh.Hanse.DE">chk@data-hh.Hanse.DE</A>>.
|
|
Time-dependent checking was added by Uwe Ohse <<A HREF="mailto:uwe@tirka.gun.de">uwe@tirka.gun.de</A>>.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>AVAILABILITY</H2>
|
|
|
|
<B>tune2fs</B>
|
|
|
|
is part of the e2fsprogs package and is available from
|
|
<A HREF="http://e2fsprogs.sourceforge.net.">http://e2fsprogs.sourceforge.net.</A>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+debugfs">debugfs</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+dumpe2fs">dumpe2fs</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+e2fsck">e2fsck</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mke2fs">mke2fs</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+ext4">ext4</A></B>(5)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="100"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="101"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="102"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="103"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="104"><A HREF="#lbAF">BUGS</A><DD>
|
|
<DT id="105"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="106"><A HREF="#lbAH">AVAILABILITY</A><DD>
|
|
<DT id="107"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:18 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|