1TUNE2FS(8)                  System Manager's Manual                 TUNE2FS(8)
2
3
4

NAME

6       tune2fs - adjust tunable filesystem parameters on ext2/ext3 filesystems
7

SYNOPSIS

9       tune2fs  [ -l ] [ -c max-mount-counts ] [ -e errors-behavior ] [ -f ] [
10       -i interval-between-checks ] [  -j  ]  [  -J  journal-options  ]  [  -m
11       reserved-blocks-percentage  ]  [  -o  [^]mount-options[,...]   ]  [  -r
12       reserved-blocks-count ] [ -s sparse-super-flag ] [ -u user ] [ -g group
13       ] [ -C mount-count ] [ -L volume-name ] [ -M last-mounted-directory ] [
14       -O [^]feature[,...]  ] [ -T time-last-checked ] [ -U UUID ] device
15

DESCRIPTION

17       tune2fs allows the  system  administrator  to  adjust  various  tunable
18       filesystem parameters on Linux ext2/ext3 filesystems.
19

OPTIONS

21       -c max-mount-counts
22              Adjust  the  number of mounts after which the filesystem will be
23              checked by e2fsck(8).  If max-mount-counts is 0 or -1, the  num‐
24              ber  of  times  the filesystem is mounted will be disregarded by
25              e2fsck(8) and the kernel.
26
27              Staggering the mount-counts at which  filesystems  are  forcibly
28              checked  will  avoid  all  filesystems being checked at one time
29              when using journaled filesystems.
30
31              You should  strongly  consider  the  consequences  of  disabling
32              mount-count-dependent   checking  entirely.   Bad  disk  drives,
33              cables, memory, and kernel bugs could all corrupt  a  filesystem
34              without  marking  the  filesystem dirty or in error.  If you are
35              using journaling on your filesystem, your filesystem will  never
36              be marked dirty, so it will not normally be checked.  A filesys‐
37              tem error detected by the kernel will still force an fsck on the
38              next reboot, but it may already be too late to prevent data loss
39              at that point.
40
41              See also the -i option for time-dependent checking.
42
43       -C mount-count
44              Set the number of times the filesystem has been mounted.  If set
45              to  a  greater  value than the max-mount-counts parameter set by
46              the -c option, e2fsck(8) will check the filesystem at  the  next
47              reboot.
48
49       -e error-behavior
50              Change the behavior of the kernel code when errors are detected.
51              In all cases, a filesystem error will cause e2fsck(8)  to  check
52              the  filesystem  on the next boot.  error-behavior can be one of
53              the following:
54
55                   continue    Continue normal execution.
56
57                   remount-ro  Remount filesystem read-only.
58
59                   panic       Cause a kernel panic.
60
61       -f     Force the tune2fs operation to complete  even  in  the  face  of
62              errors.   This  option  is  useful when removing the has_journal
63              filesystem feature from a filesystem which has an external jour‐
64              nal  (or  is  corrupted such that it appears to have an external
65              journal), but that external journal is not available.
66
67              WARNING: Removing an external journal from  a  filesystem  which
68              was  not  cleanly unmounted without first replaying the external
69              journal can result in severe data loss  and  filesystem  corrup‐
70              tion.
71
72       -g group
73              Set the group which can use the reserved filesystem blocks.  The
74              group parameter can be a numerical gid or a group  name.   If  a
75              group  name  is given, it is converted to a numerical gid before
76              it is stored in the superblock.
77
78       -i  interval-between-checks[d|m|w]
79              Adjust the maximal time between two filesystem checks.  No post‐
80              fix  or  d result in days, m in months, and w in weeks.  A value
81              of zero will disable the time-dependent checking.
82
83              It is strongly recommended that  either  -c  (mount-count-depen‐
84              dent)  or -i (time-dependent) checking be enabled to force peri‐
85              odic full e2fsck(8) checking of the filesystem.  Failure  to  do
86              so  may lead to filesystem corruption (due to bad disks, cables,
87              memory, or kernel bugs) going unnoticed, ultimately resulting in
88              data loss or corruption.
89
90       -j     Add  an ext3 journal to the filesystem.  If the -J option is not
91              specified, the default journal parameters will be used to create
92              an  appropriately  sized journal (given the size of the filesys‐
93              tem) stored within the filesystem.  Note that you must be  using
94              a kernel which has ext3 support in order to actually make use of
95              the journal.
96
97              If this option is used to create a journal on a mounted filesys‐
98              tem,  an  immutable  file, .journal, will be created in the top-
99              level directory of the filesystem, as it is the only safe way to
100              create the journal inode while the filesystem is mounted.  While
101              the ext3 journal is visible, it is not safe  to  delete  it,  or
102              modify  it  while the filesystem is mounted; for this reason the
103              file is marked immutable.  While checking unmounted filesystems,
104              e2fsck(8)  will automatically move .journal files to the invisi‐
105              ble, reserved journal inode.  For all filesystems except for the
106              root filesystem,  this should happen automatically and naturally
107              during the next reboot cycle.   Since  the  root  filesystem  is
108              mounted read-only, e2fsck(8) must be run from a rescue floppy in
109              order to effect this transition.
110
111              On some distributions, such as Debian, if an initial ramdisk  is
112              used, the initrd scripts will automatically convert an ext2 root
113              filesystem to ext3 if the /etc/fstab  file  specifies  the  ext3
114              filesystem  for  the root filesystem in order to avoid requiring
115              the use of a rescue floppy to add an ext3 journal  to  the  root
116              filesystem.
117
118       -J journal-options
119              Override  the  default  ext3 journal parameters. Journal options
120              are comma separated, and may take an argument using  the  equals
121              ('=')  sign.  The following journal options are supported:
122
123                   size=journal-size
124                          Create  a  journal  stored in the filesystem of size
125                          journal-size megabytes.   The size  of  the  journal
126                          must  be  at least 1024 filesystem blocks (i.e., 1MB
127                          if using 1k blocks, 4MB if using  4k  blocks,  etc.)
128                          and  may  be no more than 102,400 filesystem blocks.
129                          There must be enough free space in the filesystem to
130                          create a journal of that size.
131
132                   device=external-journal
133                          Attach  the  filesystem  to the journal block device
134                          located on external-journal.  The  external  journal
135                          must have been already created using the command
136
137                          mke2fs -O journal_dev external-journal
138
139                          Note  that  external-journal  must be formatted with
140                          the same block size as  filesystems  which  will  be
141                          using  it.   In addition, while there is support for
142                          attaching multiple filesystems to a single  external
143                          journal,  the Linux kernel and e2fsck(8) do not cur‐
144                          rently support shared external journals yet.
145
146                          Instead of specifying a device name directly, exter‐
147                          nal-journal   can   also   be  specified  by  either
148                          LABEL=label or  UUID=UUID  to  locate  the  external
149                          journal by either the volume label or UUID stored in
150                          the ext2 superblock at the  start  of  the  journal.
151                          Use dumpe2fs(8) to display a journal device's volume
152                          label  and  UUID.   See  also  the  -L   option   of
153                          tune2fs(8).
154
155              Only  one  of  the  size  or  device  options can be given for a
156              filesystem.
157
158       -l     List the contents of the filesystem superblock.
159
160       -L volume-label
161              Set the volume label of the filesystem.  Ext2 filesystem  labels
162              can  be  at  most  16 characters long; if volume-label is longer
163              than 16 characters, tune2fs will truncate it and print  a  warn‐
164              ing.   The  volume  label  can be used by mount(8), fsck(8), and
165              /etc/fstab(5) (and possibly  others)  by  specifying  LABEL=vol‐
166              ume_label instead of a block special device name like /dev/hda5.
167
168       -m reserved-blocks-percentage
169              Set the percentage of the filesystem which may only be allocated
170              by privileged processes.   Reserving some number  of  filesystem
171              blocks for use by privileged processes is done to avoid filesys‐
172              tem fragmentation, and to allow system  daemons,  such  as  sys‐
173              logd(8),  to continue to function correctly after non-privileged
174              processes are prevented from writing to  the  filesystem.   Nor‐
175              mally, the default percentage of reserved blocks is 5%.
176
177       -M last-mounted-directory
178              Set the last-mounted directory for the filesystem.
179
180       -o [^]mount-option[,...]
181              Set or clear the indicated default mount options in the filesys‐
182              tem.  Default mount options can be overridden by  mount  options
183              specified  either  in /etc/fstab(5) or on the command line argu‐
184              ments to mount(8).  Older kernels may not support this  feature;
185              in  particular,  kernels  which  predate 2.4.20 will almost cer‐
186              tainly ignore the default mount options field in the superblock.
187
188              More than one mount option can be cleared or set  by  separating
189              features with commas.  Mount options prefixed with a caret char‐
190              acter ('^') will be  cleared  in  the  filesystem's  superblock;
191              mount options without a prefix character or prefixed with a plus
192              character ('+') will be added to the filesystem.
193
194              The following mount options can be set or cleared using tune2fs:
195
196                   debug  Enable debugging code for this filesystem.
197
198                   bsdgroups
199                          Emulate BSD behaviour when creating new files:  they
200                          will  take  the  group-id  of the directory in which
201                          they were created.  The standard System V  behaviour
202                          is  the  default,  where newly created files take on
203                          the fsgid of the current process, unless the  direc‐
204                          tory  has the setgid bit set, in which case it takes
205                          the gid from the parent directory, and also gets the
206                          setgid bit set if it is a directory itself.
207
208                   user_xattr
209                          Enable user-specified extended attributes.
210
211                   acl    Enable Posix Access Control Lists.
212
213                   uid16  Disables 32-bit UIDs and GIDs.  This is for interop‐
214                          erability with older kernels which  only  store  and
215                          expect 16-bit values.
216
217                   journal_data
218                          When  the  filesystem  is  mounted  with journalling
219                          enabled, all data (not just metadata)  is  committed
220                          into  the  journal  prior  to being written into the
221                          main filesystem.
222
223                   journal_data_ordered
224                          When the  filesystem  is  mounted  with  journalling
225                          enabled, all data is forced directly out to the main
226                          file system prior to its metadata being committed to
227                          the journal.
228
229                   journal_data_writeback
230                          When  the  filesystem  is  mounted  with journalling
231                          enabled, data may be written into the main  filesys‐
232                          tem  after  its  metadata  has been committed to the
233                          journal.  This may increase throughput, however,  it
234                          may  allow old data to appear in files after a crash
235                          and journal recovery.
236
237       -O [^]feature[,...]
238              Set or clear the indicated filesystem features (options) in  the
239              filesystem.   More than one filesystem feature can be cleared or
240              set by separating features  with  commas.   Filesystem  features
241              prefixed  with  a  caret  character ('^') will be cleared in the
242              filesystem's superblock; filesystem features  without  a  prefix
243              character  or prefixed with a plus character ('+') will be added
244              to the filesystem.
245
246              The following filesystem features can be set  or  cleared  using
247              tune2fs:
248
249                   dir_index
250                          Use  hashed  b-trees  to  speed  up lookups in large
251                          directories.
252
253                   filetype
254                          Store file type information in directory entries.
255
256                   has_journal
257                          Use a journal to ensure filesystem consistency  even
258                          across  unclean  shutdowns.   Setting the filesystem
259                          feature is equivalent to using the -j option.
260
261                   sparse_super
262                          Limit the number of backup superblocks to save space
263                          on large filesystems.
264
265              After  setting  or clearing sparse_super and filetype filesystem
266              features, e2fsck(8) must be run on the filesystem to return  the
267              filesystem  to a consistent state.  Tune2fs will print a message
268              requesting that the system administrator run e2fsck(8) if neces‐
269              sary.  After setting the dir_index feature, e2fsck -D can be run
270              to convert existing directories to the hashed B-tree format.
271
272              Warning: Linux kernels before 2.0.39 and many 2.1 series kernels
273              do  not  support the filesystems that use any of these features.
274              Enabling certain filesystem features may prevent the  filesystem
275              from  being  mounted  by kernels which do not support those fea‐
276              tures.
277
278       -r reserved-blocks-count
279              Set the number of reserved filesystem blocks.
280
281       -s [0|1]
282              Turn the sparse super feature off or on.  Turning  this  feature
283              on  saves  space on really big filesystems.  This is the same as
284              using the -O sparse_super option.
285
286              Warning: Linux kernels before 2.0.39 do not  support  this  fea‐
287              ture.   Neither  do all Linux 2.1 kernels; please don't use this
288              unless you know what you're doing!  You need to run e2fsck(8) on
289              the  filesystem  after  changing this feature in order to have a
290              valid filesystem.
291
292       -T time-last-checked
293              Set the time the filesystem was last checked using e2fsck.  This
294              can  be  useful in scripts which use a Logical Volume Manager to
295              make a consistent snapshot of a filesystem, and then  check  the
296              filesystem  during  off  hours  to make sure it hasn't been cor‐
297              rupted due to hardware problems, etc.   If  the  filesystem  was
298              clean, then this option can be used to set the last checked time
299              on the original filesystem.  The format of time-last-checked  is
300              the  international date format, with an optional time specifier,
301              i.e.  YYYYMMDD[HH[MM[SS]]].   The keyword now is also  accepted,
302              in  which  case the last checked time will be set to the current
303              time.
304
305       -u user
306              Set the user who can use the reserved filesystem  blocks.   user
307              can be a numerical uid or a user name.  If a user name is given,
308              it is converted to a numerical uid before it is  stored  in  the
309              superblock.
310
311       -U UUID
312              Set  the  universally unique identifier (UUID) of the filesystem
313              to UUID.  The format of the UUID is a series of hex digits sepa‐
314              rated          by          hyphens,          like          this:
315              "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  The UUID parameter  may
316              also be one of the following:
317
318                   clear  clear the filesystem UUID
319
320                   random generate a new randomly-generated UUID
321
322                   time   generate a new time-based UUID
323
324              The  UUID  may  be  used by mount(8), fsck(8), and /etc/fstab(5)
325              (and possibly others) by specifying UUID=uuid instead of a block
326              special device name like /dev/hda1.
327
328              See  uuidgen(8)  for  more  information.  If the system does not
329              have a good random  number  generator  such  as  /dev/random  or
330              /dev/urandom,  tune2fs  will automatically use a time-based UUID
331              instead of a randomly-generated UUID.
332

BUGS

334       We haven't found any bugs yet.  That doesn't mean there aren't any...
335

AUTHOR

337       tune2fs was written by Remy Card  <Remy.Card@linux.org>.   It  is  cur‐
338       rently being maintained by Theodore Ts'o <tytso@alum.mit.edu>.  tune2fs
339       uses the ext2fs library written by Theodore Ts'o <tytso@mit.edu>.  This
340       manual  page  was  written  by  Christian Kuhtz <chk@data-hh.Hanse.DE>.
341       Time-dependent checking was added by Uwe Ohse <uwe@tirka.gun.de>.
342

AVAILABILITY

344       tune2fs is  part  of  the  e2fsprogs  package  and  is  available  from
345       http://e2fsprogs.sourceforge.net.
346

SEE ALSO

348       dumpe2fs(8), e2fsck(8), mke2fs(8)
349
350
351
352E2fsprogs version 1.40.2           July 2007                        TUNE2FS(8)
Impressum