最後更新: 2021-05-13
目錄
tune2fs
Max-mount-counts
-c max-mount-counts
當 over max-mount-counts 時, device 會拒絕被 mount. 0 or -1 就不會拒絕被 mount
i.e.
tune2fs -c 0 /dev/sdb1
tune2fs 1.42.13 (17-May-2015) Setting maximal mount count to -1
Reserved space for root
tune2fs -m 0 /dev/sdb1
Set Label
tune2fs -L usb-bak-dsk /dev/sdb1
List the contents of the file system superblock (-l)
tune2fs -l /dev/sdg1
Filesystem volume name: usb-bak-dsk Last mounted on: /backup/usb-bak-dsk Filesystem UUID: 7a12a169-fe46-44e9-9660-d31cc4535139 ... Filesystem features: has_journal ext_attr resize_inode ... ... Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue ... Inode count: 30523392 Block count: 122088192 Reserved block count: 6104409 Overhead clusters: 2196820 Free blocks: 119891365 Free inodes: 30523381 First block: 0 Block size: 4096 ... Filesystem created: Fri Mar 10 21:51:41 2023 Last mount time: Fri May 12 21:40:05 2023 Last write time: Fri May 12 21:40:05 2023 Mount count: 6 Maximum mount count: -1 Last checked: Fri Mar 10 21:51:41 2023 Check interval: 0 (<none>) Lifetime writes: 4306 MB ...
dumpe2fs
dumpe2fs -h /dev/sda1 | grep -i "default mount options"
-h only display the superblock information and not any of the block group descriptor detail information.
e.g.
dumpe2fs -h /dev/vda1
dumpe2fs 1.41.12 (17-May-2010) Filesystem volume name: <none> Last mounted on: /boot Filesystem UUID: 0d2773f2-df0a-4587-bcf4-bacfa7c2cb5e Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: user_xattr acl Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 51200 Block count: 204800 Reserved block count: 10240 Free blocks: 81090 Free inodes: 51144 First block: 1 Block size: 1024 Fragment size: 1024 Reserved GDT blocks: 256 Blocks per group: 8192 Fragments per group: 8192 Inodes per group: 2048 Inode blocks per group: 256 Flex block group size: 16 Filesystem created: Wed Aug 8 02:11:42 2012 Last mount time: Wed Oct 16 12:24:00 2013 Last write time: Wed Oct 16 12:24:00 2013 Mount count: 26 Maximum mount count: -1 Last checked: Wed Aug 8 02:11:42 2012 Check interval: 0 (<none>) Lifetime writes: 121 MB Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal inode: 8 Default directory hash: half_md4 Directory Hash Seed: b5db19f2-3cf3-462e-9e8a-ef06ab596d89 Journal backup: inode blocks Journal features: (none) Journal size: 4096k Journal length: 4096 Journal sequence: 0x00000059 Journal start: 1