Zfs

清除健康池中的永久 ZFS 錯誤

  • March 21, 2018

我今天擦洗了我的游泳池,擦洗完成後,我注意到有一個錯誤導致文件損壞。我不在乎這個文件,所以我刪除了它。不幸的是,錯誤仍然存在(現在由十六進制 ID 而不是文件名引用),我不知道如何清除它。

  • 我應該擔心嗎?我還沒有真正擺脫這個錯誤嗎?
  • 我可以清除錯誤嗎?如果文件不見了,我真的不想在將來看到這個錯誤。

作為參考,這裡是我發出的命令和輸出,帶有註釋:

檢查狀態

kevin@atlas:~$ sudo zpool status -v

pool: zstorage
state: ONLINE
status: One or more devices has experienced an error resulting in data
   corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
   entire pool from backup.
see: zfsonlinux.org/msg/ZFS-8000-8A
scan: scrub repaired 1.81M in 7h19m with 1 errors on Wed Feb 19 10:04:44 2014
config:

   NAME                                          STATE     READ WRITE CKSUM
   zstorage                                      ONLINE       0     0     0
   raidz1-0                                    ONLINE       0     0     0
       ata-WDC_WD30EZRX-00DC0B0_WD-WCC1T1735698  ONLINE       0     0     0
       ata-WDC_WD30EZRX-00DC0B0_WD-WMC1T0506289  ONLINE       0     0     0
       ata-WDC_WD30EZRX-00MMMB0_WD-WCAWZ2711600  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

       /zstorage/owncloud/kevin/files/Archives/Music/Kev Rev 7/graveyard/Old/Four Tet/Pause/03 Harmony One.mp3

切換到 root 並刪除文件 - 我不需要它

kevin@atlas:~$ sudo -i

root@atlas:~# cd /zstorage/owncloud/kevin/files/Archives/Music/Kev\ Rev\ 7/graveyard/Old/Four\ Tet/Pause/

root@atlas:/zstorage/owncloud/kevin/files/Archives/Music/Kev Rev 7/graveyard/Old/Four Tet/Pause# rm 03\ Harmony\ One.mp3

再次檢查狀態

root@atlas:/zstorage/owncloud/kevin/files/Archives/Music/Kev Rev 7/graveyard/Old/Four Tet/Pause# zpool status -v

pool: zstorage
state: ONLINE
status: One or more devices has experienced an error resulting in data
   corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
   entire pool from backup.
see: zfsonlinux.org/msg/ZFS-8000-8A
scan: scrub repaired 1.81M in 7h19m with 1 errors on Wed Feb 19 10:04:44 2014
config:

   NAME                                          STATE     READ WRITE CKSUM
   zstorage                                      ONLINE       0     0     1
   raidz1-0                                    ONLINE       0     0     2
       ata-WDC_WD30EZRX-00DC0B0_WD-WCC1T1735698  ONLINE       0     0     0
       ata-WDC_WD30EZRX-00DC0B0_WD-WMC1T0506289  ONLINE       0     0     0
       ata-WDC_WD30EZRX-00MMMB0_WD-WCAWZ2711600  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

       zstorage:<0x9f115>

哦哦。也許我可以清除錯誤?

root@atlas:/zstorage/owncloud/kevin/files/Archives/Music/Kev Rev 7/graveyard/Old/Four Tet/Pause# zpool clear zstorage

root@atlas:/zstorage/owncloud/kevin/files/Archives/Music/Kev Rev 7/graveyard/Old/Four Tet/Pause# zpool status -v

pool: zstorage
state: ONLINE
status: One or more devices has experienced an error resulting in data
   corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
   entire pool from backup.
see: zfsonlinux.org/msg/ZFS-8000-8A
scan: scrub repaired 1.81M in 7h19m with 1 errors on Wed Feb 19 10:04:44 2014
config:

   NAME                                          STATE     READ WRITE CKSUM
   zstorage                                      ONLINE       0     0     0
   raidz1-0                                    ONLINE       0     0     0
       ata-WDC_WD30EZRX-00DC0B0_WD-WCC1T1735698  ONLINE       0     0     0
       ata-WDC_WD30EZRX-00DC0B0_WD-WMC1T0506289  ONLINE       0     0     0
       ata-WDC_WD30EZRX-00MMMB0_WD-WCAWZ2711600  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

       zstorage:<0x9f115>

這看起來不太好!

再次擦洗你的游泳池(如果你還沒有):

zpool 擦洗 zstorage

該錯誤告訴您 inode <0x9f115> 已損壞(刪除文件破壞了文件名->inode 映射,因此它現在只是報告 inode)。要麼文件仍然打開,要麼只需要清理元數據(清理應該這樣做)。

如果不需要清理,要清除錯誤,您需要使用 zdb 來解決問題,這並沒有被 oracle 公開記錄(並且在其他地方也沒有記錄) - 無論如何,這可能表明存在更根本的錯誤。

引用自:https://serverfault.com/questions/576898