清除健康池中的永久性 ZFS 错误

清除健康池中的永久性 ZFS 错误

我今天清理了我的池,清理完成后,我注意到有一个错误损坏了一个文件。我不关心这个文件,所以我删除了它。不幸的是,错误仍然存​​在(现在由十六进制 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>

这看上去不太好!

答案1

再次擦洗泳池(如果还没有的话):

zpool scrub YourPool

这个错误告诉你文件inode <0x9f115>已损坏(删除文件破坏了文件名->inode 映射,因此现在只报告 inode)。要么文件仍然处于打开状态,要么元数据需要清理(清理应该可以做到)。

要清除错误(如果清理不成功),您需要深入研究zdb,这并未由 Oracle 公开记录(其他地方的记录也很差) - 并且无论如何可能表明存在更根本的错误。

答案2

我知道我来晚了,但我只是想补充一点,如果额外的清理不能解决这样的问题,zdb你可以启动清理,让它运行几分钟,然后用 停止它,而不是查看zpool scrub -s zstorage。当所有读/写/校验和错误都为零时,这对我来说可以清除文件的永久错误。

http://unixetc.co.uk/2012/01/22/zfs-corruption-persists-in-unlinked-files/

编辑:在这样做了几次之后,我还意识到,让 Scrub 运行的时间长短会影响它是否有效(取决于它首先查看哪些块)。因此,如果一开始不起作用,请再尝试几次并调整停止它的时间。

相关内容