What it does
tune2fs -l DEVICE lists the superblock: label, UUID, features, mount count, reserved blocks and more. Other options change these values, mostly without unmounting. Some changes (like a new UUID or inode size) need the file system to be unmounted.
How to write it
tune2fs [OPTION]... DEVICEOptions 21
Most used
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1Show all settings
tune2fs -l /dev/vdb2 | lessLabel, UUID, features, counts.
2Set a label
tune2fs -L backup /dev/vdb2Then mount with LABEL=backup.
3Less space reserved for root
tune2fs -m 1 /dev/vdb2Frees 4 % of a big data disk.
4Default mount options
tune2fs -o acl,user_xattr /dev/vdb2Used even when fstab says only
defaults.5Turn off forced checks
tune2fs -c -1 -i 0 /dev/vdb2No surprise fsck at boot after N mounts.
6New UUID for a cloned disk
umount /backup; tune2fs -U random /dev/vdb2Two disks with the same UUID confuse fstab and LVM.
7Remount read-only on errors (safer)
tune2fs -e remount-ro /dev/vdb2Stops more damage when the disk has errors.
8Enable quotas
tune2fs -O quota -Q usrquota,grpquota /dev/vdb2Needs the file system unmounted.
9Show the reserved blocks
tune2fs -l /dev/vdb2 | grep -i 'reserved block count'Compare with the block count.
10Check the mount count and last check
tune2fs -l /dev/vdb2 | grep -E 'Mount count|Last checked'Maintenance information.
Nothing matches this filter.
Exit codes
0 | Done. |
1 | Error. |