tune2fs

From RaySoft

tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2/ext3/ext4 filesystems.[1]

Documentation

Syntax

tune2fs [PARAMETER ...] [DEVICE]

Parameters

-c COUNT
Adjust the number of mounts after which the filesystem will be checked by e2fsck. If COUNT is 0 or -1, the number of times the filesystem is mounted will be disregarded by e2fsck and the kernel.
-C COUNT
Set the number of times the filesystem has been mounted. If set to a greater value than the COUNT parameter set by the -c option, e2fsck will check the filesystem at the next reboot.
-e BEHAIVIOR
Change the behavior of the kernel code when errors are detected. In all cases, a filesystem error will cause e2fsck to check the filesystem on the next boot. error-behavior can be one of the following:
continue
Continue normal execution.
remount-ro
Remount filesystem read-only.
panic
Cause a kernel panic.
-g GROUP
Set the GROUP which can use reserved filesystem blocks. The group 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.
-i TIME[d|m|w]
Adjust the maximal TIME between two filesystem checks. No postfix or d result in days, m in months, and w in weeks. A value of zero will disable the time-dependent checking.
It is strongly recommended that either -c (mount-count-dependent) or -i (time-dependent) checking be enabled to force periodic full e2fsck checking of the filesystem. Failure to do so may lead to filesystem corruption due to bad disks, cables, memory, or kernel bugs to go unnoticed until they cause data loss or corruption.
-j
Add an ext3 journal to the filesystem. If the -J 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:
You must be using a kernel which has ext3 support in order to actually make use of the journal.
-l
List the contents of the filesystem superblock.
-L LABEL
Set the volume LABEL of the filesystem. ext2 filesystem labels can be at most 16 characters long; if LABEL is longer than 16 characters, tune2fs will truncate it and print a warning. The volume label can be used by mount, fsck, and /etc/fstab (and possibly others) by specifying LABEL=name instead of a block special device name like /dev/hda5.
-m PERCENTAGE
Set the PERCENTAGE of reserved filesystem blocks.
-M DIRECTORY
Set the last-mounted DIRECTORY for the filesystem.
-r NUMBER
Set the NUMBER of reserved filesystem blocks.
-T TIME
Set the TIME the filesystem was last checked using e2fsck. 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 TIME is the international date format, with an optional time specifier, i.e. YYYYMMDD[[HHMM]SS]. The keyword now is also accepted, in which case the last checked time will be set to the current time.
-u USER
Set the USER who can use the reserved filesystem blocks. USER 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 filesystem.
-U UUID
Set the universally unique identifier (UUID) of the filesystem to UUID.

References

  1. man 8 'tune2fs'