在 Ubuntu 上,我最近开始在外部 USB 硬盘上试用 ZFS。我现在似乎有一个损坏的 zfs 池,这可能只是因为我关闭了我的计算机(使用poweroff
)。
$ zpool import
pool: zfs
id: 1234512345123451234
state: FAULTED
status: The pool metadata is corrupted.
action: The pool cannot be imported due to damaged devices or data.
The pool may be active on another system, but can be imported using
the '-f' flag.
see: http://zfsonlinux.org/msg/ZFS-8000-72
config:
zfs FAULTED corrupted data
usb-Disk_Name_etc-0:0 ONLINE
尝试导入它时,我收到一条有用的消息,说明我将丢失大约 1 秒的数据(这很好),我可以尝试使用“-F”选项进行恢复:
$ zpool import zfs
cannot import 'zfs': I/O error
Recovery is possible, but will result in some data loss.
Returning the pool to its state as of Thu 12 Mar 2020 00:58:03 GMT
should correct the problem. Approximately 1 seconds of data
must be discarded, irreversibly. Recovery can be attempted
by executing 'zpool import -F zfs'. A scrub of the pool
is strongly recommended after recovery.
使用空运行标志,我确认 -F 应该工作:
$ zpool import -Fn zfs
Would be able to return zfs to its state as of Thu 12 Mar 2020 00:58:03 GMT.
Would discard approximately 1 seconds of transactions.
但是,当我尝试真实的东西时,它似乎完全忽略了“-F”选项并重复了原始消息:
$ zpool import -F zfs
cannot import 'zfs': I/O error
Recovery is possible, but will result in some data loss.
Returning the pool to its state as of Thu 12 Mar 2020 00:58:03 GMT
should correct the problem. Approximately 1 seconds of data
must be discarded, irreversibly. Recovery can be attempted
by executing 'zpool import -F zfs'. A scrub of the pool
is strongly recommended after recovery.
我发现从这个答案中提到了“-X”选项:https ://serverfault.com/a/645866/74394但我继续收到完全相同的消息。我已经尝试了所有这些选项组合,包括池名称 (zfs) 和数字 ID 号(如 1234512345123451234),我总是得到与上面建议使用 -F 选项完全相同的消息。
-F
-FX
-f
-fF
-fFX
我在这里做明显错误的事情吗?如果我因为系统关闭而导致 1 秒的数据丢失而无法挽回地丢失了整个磁盘,那么 ZFS 似乎非常不稳定!我没有池的备份副本,因为我才刚刚开始尝试 ZFS。谢谢你的帮助。