Linux command
tune2fs 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo tune2fs -c 2 /dev/sdXN
Example
sudo tune2fs -L 'MY_LABEL' /dev/sdXN
Example
sudo tune2fs -o discard,user_xattr /dev/sdXN
Example
sudo tune2fs -o has_journal /dev/sdXN
Example
sudo tune2fs -U random /dev/sdXN
Example
sudo tune2fs -m 1 /dev/sdXN
说明
tune2fs adjusts tunable filesystem parameters on ext2, ext3, or ext4 filesystems. Many parameters can be changed on mounted filesystems, but some require the filesystem to be unmounted.
参数
- -c MAX-MOUNT-COUNTS
- Set maximum mount count before fsck
- -C MOUNT-COUNT
- Set current mount count
- -e ERROR-BEHAVIOR
- Set error behavior (continue, remount-ro, panic)
- -E EXTENDED-OPTIONS
- Set extended options
- -f
- Force operation on filesystems with errors
- -i INTERVAL
- Time between filesystem checks (d/w/m for days/weeks/months)
- -j
- Add ext3 journal to ext2 filesystem
- -J JOURNAL-OPTIONS
- Set journal options
- -l
- List filesystem superblock contents
- -L LABEL
- Set filesystem label
- -m RESERVED-BLOCKS-PERCENTAGE
- Set percentage of reserved blocks
- -o OPTIONS
- Set/clear default mount options
- -O FEATURES
- Set/clear filesystem features
- -r RESERVED-BLOCKS-COUNT
- Set number of reserved blocks
- -T TIME
- Set time of last filesystem check
- -u USER
- Set user who can use reserved blocks
- -U UUID
- Set filesystem UUID
FAQ
What is the tune2fs command used for?
tune2fs adjusts tunable filesystem parameters on ext2, ext3, or ext4 filesystems. Many parameters can be changed on mounted filesystems, but some require the filesystem to be unmounted.
How do I run a basic tune2fs example?
Run `sudo tune2fs -c 2 /dev/sdXN` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c MAX-MOUNT-COUNTS do in tune2fs?
Set maximum mount count before fsck