8.2 partprobe:更新内核的硬盘分区表信息
8.3 tune2fs:调整ext2/ext3/ext4文件系统参数
tune2fs命令的参数选项及说明
查看文件系统挂载信息
[root@cs6 ~]# tune2fs -l /dev/sda1|grep -i Mount Last mounted on: /boot #<==查看sda1设备即/boot分区的挂载次数。 Default mount options: user_xattr acl Last mount time: Sat May 11 07:27:26 2019 #<=示上次挂载时间。 Mount count: 8 #<==挂载的次数。 Maximum mount count: -1 #<==强制自检的挂载次数为-1,关闭自检功能。 [root@cs6 ~]# tune2fs -l /dev/sdb1|grep -i Mount Last mounted on: <not available> Default mount options: (none) Last mount time: Sat May 11 07:55:48 2019 Mount count: 1 Maximum mount count: -1
设置挂载次数
[root@cs6 ~]# tune2fs -C 30 /dev/sdb1 #<==参数 -C 设置文件系统已经被挂载的决数。 tune2fs 1.41.12 (17-May-2010) Setting current mount count to 30 [root@cs6 ~]# tune2fs -l /dev/sdb1 |grep -i Mount Last mounted on: <not available> Default mount options: (none) Last mount time: Sat May 11 07:55:48 2019 Mount count: 30 Maximum mount count: -1
设置强制自检的挂载次数
[root@cs6 ~]# tune2fs -c 40 /dev/sda1 tune2fs 1.41.12 (17-May-2010) Setting maximal mount count to 40 [root@cs6 ~]# tune2fs -l /dev/sda1| grep -i Mount Last mounted on: /boot Default mount options: user_xattr acl Last mount time: Sat May 11 07:27:26 2019 Mount count: 8 Maximum mount count: 40 [root@cs6 ~]# tune2fs -c -1 /dev/sda1 tune2fs 1.41.12 (17-May-2010) Setting maximal mount count to -1 [root@cs6 ~]# tune2fs -l /dev/sda1| grep -i Mount Last mounted on: /boot Default mount options: user_xattr acl Last mount time: Sat May 11 07:27:26 2019 Mount count: 8 Maximum mount count: -1
设置强制自检的时间间隔
[root@cs6 ~]# tune2fs -l /dev/sda1 |grep -i check #<==查看检查周期。 Last checked: Sun May 5 23:10:27 2019 Check interval: 0 (<none>) #<==系统分区默认不检查。 [root@cs6 ~]# tune2fs -i 10 /dev/sda1 #<==参数 -i 设置每10天检查一次。 tune2fs 1.41.12 (17-May-2010) Setting interval between checks to 864000 seconds [root@cs6 ~]# tune2fs -l /dev/sda1|grep -i check Last checked: Sun May 5 23:10:27 2019 Check interval: 864000 (1 week, 3 days) #<==这里变成10天,864000秒。 Next check after: Wed May 15 23:10:27 2019 [root@cs6 ~]# tune2fs -i 0 /dev/sda1 #还原正常状态 tune2fs 1.41.12 (17-May-2010) Setting interval between checks to 0 seconds [root@cs6 ~]# tune2fs -l /dev/sda1|grep -i check Last checked: Sun May 5 23:10:27 2019 Check interval: 0 (<none>)