解決 "maximal mount count reached" 與硬碟檢測

檢查 mount 次數

當 mount 硬碟時老是出現

"EXT3-fs warning: maximal mount count reached, running e2fsck is recommended"

是提醒你該用 e2fsck 做檔案系統的檢查,請依下列步驟處理:

1. 查看目前的 mount 次數及限制

$ tune2fs -l /dev/sdb1 | grep ^M
Mount count:              26
Maximum mount count:      22

2. 取消最大 mount 次數檢查

$ tune2fs -c0 -i0 /dev/sdb1
tune2fs 1.39 (29-May-2006)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds

3. 查看目前的 mount 次數及限制

$ tune2fs -l /dev/sdb1 | grep ^M
Mount count:              26
Maximum mount count:      -1

檢查檔案系統

1. 取消 mount,並做檔案系統檢查及自動修復處理

$ umount /dev/sdb1
$ e2fsck -p /dev/sdb1

(PS.執行 e2fsck 時請務必先 umount 硬碟,以免發生不可預期的錯誤)

2. 如果 e2fsck 有出現其它錯誤,例如:

/dev/sdb1 contains a file system with errors, check forced.
/dev/sdb1: Inode 81969341 has illegal block(s).
/dev/sdb1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
           (i.e., without -a or -p options)

依指示執行 fsck 修復檔案系統錯誤:

$ fsck /dev/sdb1
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/sdb1 contains a file system with errors, check forced.
...

3. 所有步驟完成,可以 mount 硬碟了

檢查磁碟壞軌

前面的 fsck 指令是針對「檔案系統」做檢查與修復,如要檢查硬碟有沒有壞軌,則使用 badblocks 指令:

$ badblocks -sv /dev/hdb
checking blocks 0 to 1465138584
checking for bad blocks (read-only test):    0/ 1465138584
 ...
done
Pass completed, 10 bad blocks found.
    • pig
    • 05/19. 2017 5:52下午
    Using Opera Opera 9.80 on Windows Windows 8

    Just want to say your article is as surprising. The clarity in your
    post is simply excellent and i can assume you're an expert on this subject.

    Fine with your permission let me to grab
    your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the rewarding
    work.

  1. No trackbacks yet.

return top

%d 位部落客按了讚: