当我创buildext4文件系统,有许多“function”,我可以启用和禁用 – 如has_journal,范围,huge_file等。 有什么方法可以知道,创buildext4文件系统时使用了哪些选项(创build之后,我的意思是)?
我已经存在ext4分区(由某人创build),但即使不知道,它使用日记或范围。
我想你可以使用dumpe2fs工具来获得ext2 / etx3 / ext4 filesystme信息的转储。
例如,这样的事情可能会做:
sudo dumpe2fs /dev/sda5 | more
在输出的开头看起来像这样,在我的电脑上:
Last mounted on: / Filesystem UUID: 848446d9-a158-4442-905c-9a9551b0eb1a 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 large_file huge_file uninit_bg dir_nlink extra_isize Filesystem flags: signed_directory_hash Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 732960 Block count: 2929846 Reserved block count: 146492 ...
您可以使用tune2fs列出:
$ su -c "tune2fs -l /dev/sda6" | grep features Password: Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize $
您可以使用在我的系统上输出的file -s $DEVICE :
# /dev/dm-0: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
如果你不知道选项是什么意思,应该在ext4文档中提到,这些文档将包含在内核源代码中。 你可以在这里在线find文档。 这应该适用于所有的文件系统,如果你在服务器上有源代码的话,一个典型的位置就是/usr/src/linux-source-2.6.27/Documentation/filesystems