8.2-3 partprobe、tune2fs
生活随笔
收集整理的這篇文章主要介紹了
8.2-3 partprobe、tune2fs
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
8.2 partprobe:更新內(nèi)核的硬盤分區(qū)表信息
partprobe命令用于在硬盤分區(qū)發(fā)生改變時,更新Linux內(nèi)核中的硬盤分區(qū)表數(shù)據(jù)。有時在使用fdisk、part命令對硬盤進(jìn)行分區(qū)后,會發(fā)現(xiàn)找不到新分區(qū),此時需要重啟系統(tǒng)才能使修改生效,但使用partprobe可以不重啟系統(tǒng)就讓修改的分區(qū)表生效。 -d?? ?不更新內(nèi)核 -s?? ?顯示摘要和分區(qū) [root@cs6 ~]# partprobe /dev/sdb?? ?#<==最好加上具體的磁盤,否則可能會報錯,很多人這塊直接執(zhí)行最后導(dǎo)致報錯,只好重啟系統(tǒng)8.3 tune2fs:調(diào)整ext2/ext3/ext4文件系統(tǒng)參數(shù)
tune2fs命令可以調(diào)整或查看ext2/ext3/ext4文件系統(tǒng)的參數(shù),比如可以調(diào)整Linux文件系統(tǒng)開機(jī)自檢的周期,此參數(shù)在工作中極少使用,讀者了解即可。tune2fs命令的參數(shù)選項及說明
-c?? ?設(shè)置強(qiáng)制自檢的掛載次數(shù),每掛載一次計數(shù)就會加1,超過次數(shù)就會強(qiáng)制自檢。設(shè)置為0或-1則此功能關(guān)閉 -C?? ?設(shè)置文件系統(tǒng)已經(jīng)被掛載的次數(shù) -i?? ?設(shè)置強(qiáng)制自檢的時間間隔(天、周、月) -j?? ?將ext2文件系統(tǒng)轉(zhuǎn)換為ext3類型的文件系統(tǒng) -l?? ?查看文件系統(tǒng)信息查看文件系統(tǒng)掛載信息
[root@cs6 ~]# tune2fs -l /dev/sda1|grep -i Mount Last mounted on: /boot #<==查看sda1設(shè)備即/boot分區(qū)的掛載次數(shù)。 Default mount options: user_xattr acl Last mount time: Sat May 11 07:27:26 2019 #<=示上次掛載時間。 Mount count: 8 #<==掛載的次數(shù)。 Maximum mount count: -1 #<==強(qiáng)制自檢的掛載次數(shù)為-1,關(guān)閉自檢功能。 [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設(shè)置掛載次數(shù)
[root@cs6 ~]# tune2fs -C 30 /dev/sdb1 #<==參數(shù) -C 設(shè)置文件系統(tǒng)已經(jīng)被掛載的決數(shù)。 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?設(shè)置強(qiáng)制自檢的掛載次數(shù)
[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設(shè)置強(qiáng)制自檢的時間間隔
[root@cs6 ~]# tune2fs -l /dev/sda1 |grep -i check #<==查看檢查周期。 Last checked: Sun May 5 23:10:27 2019 Check interval: 0 (<none>) #<==系統(tǒng)分區(qū)默認(rèn)不檢查。 [root@cs6 ~]# tune2fs -i 10 /dev/sda1 #<==參數(shù) -i 設(shè)置每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 #還原正常狀態(tài) 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>)總結(jié)
以上是生活随笔為你收集整理的8.2-3 partprobe、tune2fs的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 8.4 parted:磁盘分区工具
- 下一篇: 8.12-14 df 、mkswap、s