Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 下修復 EXT3 Superblock 的正確步驟

編輯:Linux 教學

問題現象

檔系統掛載失敗,提示 bad superblock on /dev/hda4。直接執行 fsck 可能導致資料遺失,需謹慎操作。

修復流程

  1. 取得區塊大小: 執行 tune2fs -l /dev/hda4,大多數情況為 1KB。
  2. 備份磁碟: 若有閒置裝置,用 dd 完整備份該分割區,降低風險。
  3. 尋找備份 Superblock 位置:
    • 1KB 區塊:8193、24577、40961…(規律:8192×N+1,N 為奇數)
    • 2KB 區塊:16384
    • 4KB 區塊:32768

    亦可用 mke2fs -n /dev/hda4 列出所有備份位置。

  4. 嘗試修復:
    fsck.ext3 -b 8193 /dev/hda4

    若 8193 損壞,依序嘗試 24577、40961 等備份位置。

關鍵提醒

  • 切勿直接對掛載中的分割區執行 fsck。
  • 修復前務必備份重要資料。
  • 超過 500MB 的檔案系統備份 superblock 遵循 8192×N+1 規律;小於 500MB 請參考 mke2fs -n 輸出。
Copyright © Windows教程網 All Rights Reserved