filesystemszfs

ZFS Zpool import changed disk identifier


I created a new ZPool on my disk with the zpool create command.

Shortly after that, I read that you should specify the pool-disks by /dev/disk/by-id/ and not by the identificator /dev/sda for example. I didn't do this on my pool, and now I have a problem:

Because of a new disk, all identifiers changed for the existing disks.

The pool was on /dev/sdb, now is this disk localized on /dev/sdc.

Zfs doesn't realizes this, and it tries to access the existing pool at /dev/sdb, but it isn't there.

through searching the web, I found a possibility to import unmounted zpools: zpool import.

But if I want to import the existing, unavailable pool with zpool import dte ("dte" was the name of the pool), I get the following error:

ms@linuxServer:/# sudo zpool import dte
cannot import 'dte': pool may be in use from other system
use '-f' to import anyway

If I try with the -f option, I get the following error:

ms@linuxServer:/# sudo zpool import dte -f
cannot import 'dte': one or more devices is currently unavailable

So it really tries to mount /dev/sdb, but this is used.

If I just use zpool import it shows me the following:

ms@linuxServer:/# sudo zpool import
   pool: dte
     id: 12561099924127384920
  state: FAULTED
 status: One or more devices contains corrupted data.
 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-5E
 config:

        dte                     FAULTED  corrupted data
          ata-TOSHIBA_DT01ACA300_X3N87RPGS  UNAVAIL  corrupted data

Does anyone know, how I can tell the zpool-command, that the pool "dte" is located at /dev/sdc and not at /dev/sdb?

I haven't found any possible, usable solution yet. Just this one, which didn't really help:

Google Groups

whirlpool.net


Solution

  • Your zpool import command string should be: sudo zpool import -f dte

    Following that, you should be able to zpool clear.