file system (file, dumpe2fs)

 

 

check fs type:

file -sL /dev/vda1

/dev/vda1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (huge files)

 

     -s, --special-files
             Normally, file only attempts to read and determine the type of
             argument files which stat(2) reports are ordinary files.  This
             prevents problems, because reading special files may have pecua€
             liar consequences.  Specifying the -s option causes file to also
             read argument files which are block or character special files.
             This is useful for determining the filesystem types of the data
             in raw disk partitions, which are block special files.  This
             option also causes file to disregard the file size as reported by
             stat(2) since on some systems it reports a zero size for raw disk
             partitions.

沒有 -s  會

/dev/vda1: block special

     -L, --dereference
             option causes symlinks to be followed, as the like-named option
             in ls(1) (on systems that support symbolic links).  This is the
             default if the environment variable POSIXLY_CORRECT is defined.

沒有 -L 會

vda1: symbolic link to `/dev/vda1'

 


 

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