如果设备尚未重新分配,我可以在导出 zpool 后恢复它吗?

如果设备尚未重新分配,我可以在导出 zpool 后恢复它吗?

我有一个 zpool,我们称之为‘testpool’。

testpool 包含 3 个设备,以及一个名为“test”的 zfs。

我需要将“test”移至一个新的、较小的池。我想将新池命名为“testpool”。

基本上做了以下事情。

zfs send testpool@backup > /tmp/test-dump
zpool export -f testpool
zpool create -f testpool newdevice
zfs receive -F testpool < /tmp/test-dump

不幸的是,我发现 testpool@backup 快照是错误的快照。太旧了。我还没有重新分配旧 testpool 中的三个设备。(这 3 个设备都不是“新设备”,它们是独立的 3 个。)

有什么方法可以恢复这些设备中的数据吗?我想既然我将新的、较小的池命名为与旧的 zpool 相同,那么我几乎就没救了。但如果没有,那就最好知道了。

编辑:更多信息

我执行了“zpool import”并得到了这个。

bash-3.00# zpool import
  pool: testpool
    id: 14781458723915654709
 state: ONLINE 
action: The pool can be imported using its name or numeric identifier.
config:

    testpool    ONLINE
      c5t8d0    ONLINE
      c5t9d0    ONLINE
      c5t10d0   ONLINE

所以我猜我只需要使用其数字标识符来导入这个 zpool 的语法,同时给它一个新名字。

年代。

答案1

是的。您可以zpool import不带任何参数运行,它会为您识别可用的池。

假设旧测试池中的设备仍然存在,您将看到“旧”测试池,以及该池的 GUID。

获得该池的 GUID 后,您可以执行zpool import $id oldtestpool。导入池后,您可以更改挂载点,使它们不与新测试池的挂载点重叠。

相关内容