ZFS 按 ID 导入池,因为名称已存在

ZFS 按 ID 导入池,因为名称已存在

我的原始系统无法启动。有很多错误我无法解决。我在新设备上安装了 ubuntu,可以从旧磁盘看到旧池。

我无法导入这些池,因为它们有相同的名称。我该如何导入 rpool?

~$ zpool status
  pool: bpool
 state: ONLINE
config:

        NAME                                    STATE     READ WRITE CKSUM
        bpool                                   ONLINE       0     0     0
          04ef5f14-e5f9-b647-b997-245aa36411f5  ONLINE       0     0     0

errors: No known data errors

  pool: rpool
 state: ONLINE
config:

        NAME                                    STATE     READ WRITE CKSUM
        rpool                                   ONLINE       0     0     0
          93f2c53e-2192-d942-a117-c0109619b3c8  ONLINE       0     0     0


$ sudo zpool import
   pool: bpool
     id: 13370236194316687362
  state: ONLINE
status: Some supported features are not enabled on the pool.
        (Note that they may be intentionally disabled if the
        'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        bpool                                   ONLINE
          683100ad-262c-0548-8f70-ea093bdbce23  ONLINE

   pool: rpool
     id: 8969077933931556505
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        rpool                                   ONLINE
          0e34f9cd-4128-6343-b54b-c5f8250b5d19  ONLINE

答案1

您可以通过新名称下的 id 导入池,将其导入到某个备用根目录也是明智之举:

zpool import -o altroot=/oldrpool 8969077933931556505 oldrpool

相关内容