All rights reserved, please indicate the source when citing
tune2fs - Adjust Ext Filesystem
要 root 身分才可執行 tune2fs ,tune2fs 命令是用於調整和修改 ext2、ext3 / ext4 檔案系統的參數和屬性的工具,和設定多久檢查一次檔案系統等。
基本語法:tune2fs [OPTIONS] DEVICE .
The tune2fs command is used to adjust and modify parameters and attributes of ext2, ext3, and ext4 filesystems. It allows you to configure settings such as how often the filesystem should be checked for errors, set labels for the filesystem, reserve blocks, and more. It's a tool for fine-tuning your ext filesystem.
The basic syntax of tune2fs is:
tune2fs [OPTIONS] DEVICE.
"DEVICE" is the path to the block special device representing the filesystem (e.g., /dev/sda1).
Common options and functionalities of tune2fs include:
- -c: Set the interval for filesystem checks based on the number of mounts. For example, "-c 3" will set a check every 30 mounts.
- -i: Set the interval for filesystem checks based on time in days. For example, "-i 1,80" will set a check every 180 days.
- -L: Set the label for the filesystem. For example, "-L mylabel" can add the label "mylabel" to the filesystem.
- -m: Set the percentage of reserved blocks. Reserved blocks are a portion of disk space that the filesystem reserves to prevent it from filling up completely. For example, "-m 2" will reserve 2% of disk space.
- -r: Set the maximum mount count for the filesystem. This can be used to limit the number of times the filesystem is mounted.
- -j: Enable or disable journaling for the filesystem. Use "-j enable" to enable journaling and "-j disable" to disable it.
- -U: Generate a new UUID (Universally Unique Identifier) and set it for the filesystem.
- -T: Display detailed information about the filesystem, including the contents of superblocks and statistics.
- -h: Display help information, listing available options and syntax.
Examples:
# tune2fs -i 10 /dev/sda1 ←Set a check after 10 days for /dev/sda1
# tune2fs -c 7 /dev/sdb ←Automatically check the filesystem on /dev/sdb after 7 mounts
|
For more usage examples and detailed information on tune2fs, please refer to the provided link.