Looking for some help with a ZFS import

Greetings.

I’m looking for a little help with a ZFS pool that I’ve recently migrated from an Ubuntu machine to my new Arch Linux machine.

I imported the pool using the zpool import -f tank and it reported my cache drive as faulted, but my storage drives are working fine. Its a raidz2 with 5 drives. The weird thing is, its reporting the wrong drive as the cache. Its listing sde, when it should be sdg. Notice that sde is also listed as a storage device.

    ❯ zpool status
  pool: tank
 state: ONLINE
status: One or more devices could not be used because the label is missing or
	invalid.  Sufficient replicas exist for the pool to continue
	functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-4J
  scan: scrub canceled on Tue Dec 29 21:16:30 2020
config:
 
	NAME        STATE     READ WRITE CKSUM
	tank        ONLINE       0     0     0
	  raidz2-0  ONLINE       0     0     0
	    sde     ONLINE       0     0     0
	    sdb     ONLINE       0     0     0
	    sda     ONLINE       0     0     0
	    sdd     ONLINE       0     0     0
	    sdf     ONLINE       0     0     0
	cache
	  sde       FAULTED      0     0     0  corrupted data

My actual cache drive is happily waiting to be used: see /dev/sdg:

~
❯ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0   1.8T  0 disk
|-sda1        8:1    0   1.8T  0 part
`-sda9        8:9    0     8M  0 part
sdb           8:16   0   1.8T  0 disk
|-sdb1        8:17   0   1.8T  0 part
`-sdb9        8:25   0     8M  0 part
sdc           8:32   0 447.1G  0 disk
|-sdc1        8:33   0   450M  0 part
|-sdc2        8:34   0   100M  0 part
|-sdc3        8:35   0    16M  0 part
|-sdc4        8:36   0 445.7G  0 part
`-sdc5        8:37   0   875M  0 part
sdd           8:48   0   1.8T  0 disk
|-sdd1        8:49   0   1.8T  0 part
`-sdd9        8:57   0     8M  0 part
sde           8:64   0   1.8T  0 disk
|-sde1        8:65   0   1.8T  0 part
`-sde9        8:73   0     8M  0 part
sdf           8:80   0   1.8T  0 disk
|-sdf1        8:81   0   1.8T  0 part
`-sdf9        8:89   0     8M  0 part
sdg           8:96   0 465.8G  0 disk
|-sdg1        8:97   0 465.8G  0 part
`-sdg9        8:105  0     8M  0 part
sr0          11:0    1  1024M  0 rom
nvme0n1     259:0    0   1.8T  0 disk
|-nvme0n1p1 259:1    0   550M  0 part /boot/EFI
`-nvme0n1p2 259:2    0   1.8T  0 part /

I’m not sure how to replace the cache drive with the correct one. The replace command throws an error:

sudo zpool replace tank sde  
/dev/sde is in use and contains a unknown filesystem.

Stack exchange helped me out. See here if you are looking for a solution to a similar problem:

tl,dr:
re import your pool with /dev/disk/by-id names instead of the standard SCSI sd* names.

1 Like