Disk identification when changing from USB to SATA connection

I am trying to change one of my two USB attached drives to be connected via SATA instead.

$ zpool import 
   pool: data
     id: 175166809295226233
  state: DEGRADED
status: One or more devices contains corrupted data.
 action: The pool can be imported despite missing or damaged devices.  The
	fault tolerance of the pool may be compromised if imported.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-4J
 config:

	data                                          DEGRADED
	  mirror-0                                    DEGRADED
	    wwn-0x50014ee20cf48516                    UNAVAIL
	    ata-WDC_WD30EZRZ-00GXCB0_WD-WCC7K0ZVE9LN  ONLINE

Where I get stuck is that the wwn of the unavailable drive seems to be the same after connecting it via SATA and the pool is using that id to identify it.

$ lsblk -o NAME,SERIAL,WWN
NAME        SERIAL          WWN
sda         WD-WCC4E4KY20DR 0x50014ee20cf48516
sdb         WD-WCC7K0ZVE9LN 0x50014ee20fea1ecc
├─sdb1                      0x50014ee20fea1ecc
└─sdb9                      0x50014ee20fea1ecc

What am I missing?

Just guessing, but try adding -d /dev/sdb to the import command

1 Like

Interesting, it does not find any pool at /dev/sdb

$ zpool import -d /dev/sdb
no pools available to import

But it finds one at /dev/sdb1

$ zpool import -d /dev/sdb1
   pool: data
     id: 175166809295226233
  state: DEGRADED
status: One or more devices contains corrupted data.
 action: The pool can be imported despite missing or damaged devices.  The
	fault tolerance of the pool may be compromised if imported.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-4J
 config:

	data                        DEGRADED
	  mirror-0                  DEGRADED
	    wwn-0x50014ee20cf48516  UNAVAIL
	    sdb                     ONLINE

Nothing at /dev/sda or at the /by-id/ path.

$ zpool import -d /dev/disk/by-id/wwn-0x50014ee20cf48516
no pools available to import

Seems like such a waste to resilver the drive when all the data is already there. But it would probably have been done by now…

Update: Gave up and started a resilvering. So far no errors :crossed_fingers:

Still interested if anyone have an explanation for what is happening.

The errors specifically said CORRUPT data, not missing drives. Looks to me like when you unplugged the USB there was dirty data in flight, leaving you with inconsistent writes on the drive(s) in question.

1 Like

Should have mentioned that I tried going back to the usb adapter, pool imported fine. Then did a zpool export and tried over SATA again. Same problem.

After that I focused on the UNAVAIL part.

Maybe the USB adapter does something funky?

Resilvering succesfully completed!

Seems likely. Those things are the devil.

1 Like