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

NAME

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

SYNOPSIS

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

DESCRIPTION

19       tune2fs allows the  system  administrator  to  adjust  various  tunable
20       filesystem  parameters  on  Linux ext2, ext3, or ext4 filesystems.  The
21       current values of these options can be displayed by using the -l option
22       to tune2fs(8) program, or by using the dumpe2fs(8) program.
23

OPTIONS

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

BUGS

395       We haven't found any bugs yet.  That doesn't mean there aren't any...
396

AUTHOR

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

AVAILABILITY

405       tune2fs is  part  of  the  e2fsprogs  package  and  is  available  from
406       http://e2fsprogs.sourceforge.net.
407

SEE ALSO

409       debugfs(8), dumpe2fs(8), e2fsck(8), mke2fs(8)
410
411
412
413E2fsprogs version 1.41.12          May 2010                         TUNE2FS(8)
Impressum