我们在Linux系统中如何找到文件系统的挂载时间呢,下面实验测试环境为RHEL 6.6,其它Linux版本没有验证测试。这个简单测试了一下常用的ext3/4、xfs、nfs文件系统。
ext文件系统
如果文件系统类型为ext3、ext4(ext2没有测试,这么老的文件系统也没有多少意义了),那么可以使用命令tune2fs查看文件系统最后一次挂载时间。如下所示:
[root@DB-Server ~]# tune2fs -l /dev/sda1
tune2fs 1.39 (29-May-2006)
Filesystem volume name: /boot
Last mounted on: <not available>
Filesystem UUID: 582b189c-396c-4da8-a7a3-1effaa3e4000
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 26104
Block count: 104388
Reserved block count: 5219
Free blocks: 88252
Free inodes: 26070
First block: 1
Block size: 1024
Fragment size: 1024
Reserved GDT blocks: 256
Blocks per group: 8192
Fragments per group: 8192
Inodes per group: 2008
Inode blocks per group: 251
Filesystem created: Thu Aug 11 14:28:18 2016
Last mount time: Tue Feb 12 15:36:22 2019
Last write time: Tue Feb 12 15:36:22 2019
Mount count: 62
Maximum mount count: -1
Last checked: Thu Aug 11 14:28:18 2016
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: b532c8d4-49b6-4d8a-a2e7-96a415daee37
Journal backup: inode blocks