Solved Problem with zfs mirror and disk name

Hi all,

one of the ssds in my zfs mirror died tonight, and the mirror is now degraded, but still working. So far, so good, but somehow the disk names got screwed up, leading to the following:

NAME STATE READ WRITE CKSUM

ada0p3 ONLINE 0 0 0

ada0p3 FAULTED 0 0 0 corrupted data

The faulted ada0p3 should be ada1p3, but somehow got the wrong name assigned during the fault. Once I add a new disk, whats a safe way to tell zfs to replace the right disk? I'm worried that a zfs remove/replace ada0p3 will remove the working disk.

zdb fails with "cannot open /etc/zfs/zpool.cache": No such file or directory.

edit: The system boots from that pool.

Cheers
Sheep2045
 
The faulted ada0p3 should be ada1p3, but somehow got the wrong name assigned during the fault.
If a drive completely fails, the nominations might shift, drives are numbered in the order they're detected.

Once I add a new disk, whats a safe way to tell zfs to replace the right disk?
Make a note of the new drive's serial number before putting it in the system. Then check with smartctl(8) and compare serial numbers.
 
Replying to my own thread for others running into the same problem, here's the solution I got:

"The names didn't get screwed up, the failed disk was previously ada0, but with it now missing the former ada1 has moved up to ada0 and the former ada0 is marked as failed. This is because "ada0p3" is just the device name and got updated when ada1 became ada0, but with the old ada0 missing it didn't get a new name.

zpool status -g poolname

shows the GUID instead of the device name, using this GUID you can safely replace the failed device. Of course you will have to replace "<poolname>" with your the name of your zfs pool."
 
The names didn't get screwed up, the failed disk was previously ada0, but with it now missing the former ada1 has moved up to ada0 and the former ada0 is marked as failed.
Yep, it's really easy to get confused due to this shifting. Luckily ZFS will warn you if you try to "replace" with a disk that was already part of the pool. So take heed of that warning, never try to "force" it.
 
Back
Top