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