• 8.2-3 partprobe、tune2fs


    8.2 partprobe:更新内核的硬盘分区表信息

     
        partprobe命令用于在硬盘分区发生改变时,更新Linux内核中的硬盘分区表数据。有时在使用fdisk、part命令对硬盘进行分区后,会发现找不到新分区,此时需要重启系统才能使修改生效,但使用partprobe可以不重启系统就让修改的分区表生效。
     
    -d    不更新内核
    -s    显示摘要和分区
    [root@cs6 ~]# partprobe /dev/sdb    #<==最好加上具体的磁盘,否则可能会报错,很多人这块直接执行最后导致报错,只好重启系统
     

    8.3 tune2fs:调整ext2/ext3/ext4文件系统参数

        tune2fs命令可以调整或查看ext2/ext3/ext4文件系统的参数,比如可以调整Linux文件系统开机自检的周期,此参数在工作中极少使用,读者了解即可。
     

    tune2fs命令的参数选项及说明

     
    -c    设置强制自检的挂载次数,每挂载一次计数就会加1,超过次数就会强制自检。设置为0或-1则此功能关闭
    -C    设置文件系统已经被挂载的次数
    -i    设置强制自检的时间间隔(天、周、月)
    -j    将ext2文件系统转换为ext3类型的文件系统
    -l    查看文件系统信息

    查看文件系统挂载信息

    [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>)
     
     
  • 相关阅读:
    window10-jmeter安装
    软件开发模型
    软件测试的原则和流程
    手机APP测试
    优秀的软件测试工程师
    自动化测试
    测试用例
    软件测试功能分类
    ios-prefix文件最全
    催收策略及催收评分卡搭建
  • 原文地址:https://www.cnblogs.com/wenyule/p/12214050.html
Copyright © 2020-2023  润新知