I'm running Ubuntu Server 13.04 64-bit using native ZFS. I have a zpool consisting of 4 hard drives of which one died yesterday and now is not being recognized by the OS or the BIOS anymore.
Unfortunately I saw the problem only after the next reboot so now the drive label is missing and I can't replace the disk using the official instructions here and here.
zpool status hermes -x
prints
root@zeus:~# zpool status hermes -x
pool: hermes
state: DEGRADED
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: http://zfsonlinux.org/msg/ZFS-8000-4J
scan: scrub repaired 0 in 2h4m with 0 errors on Sun Jun 9 00:28:24 2013
config:
NAME STATE READ WRITE CKSUM
hermes DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ata-ST3300620A_5QF0MJFP ONLINE 0 0 0
ata-ST3300831A_5NF0552X UNAVAIL 0 0 0
ata-ST3200822A_5LJ1CHMS ONLINE 0 0 0
ata-ST3200822A_3LJ0189C ONLINE 0 0 0
errors: No known data errors
I already replaced the drive with a new one (which got the label /dev/disk/by-id/ata-ST3500320AS_9QM03ATQ)
Any one of the commands
zpool replace hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X /dev/disk/by-id/ata-ST3500320AS_9QM03ATQ
zpool offline hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X
zpool detatch hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X
fails with
root@zeus:~# zpool offline hermes /dev/disk/by-id/ata-ST3300831A_5NF0552X
cannot offline /dev/disk/by-id/ata-ST3300831A_5NF0552X: no such device in pool
because the label of the drive that died does not exist in the system any more.I also tried the commands above omitting path to the drive's label to no avail.
How can I replace the "ghost" disk?
-nswitch, but also the-gswitch will grab the uuid that way as well. – Brian Thomas Oct 26 '16 at 03:16zpool status(names like sdab) were NOT the same as the paths in/dev/disk/by-id(crazy long ID names). Butls -la /dev/disk/by-idreveals that they are all links to/dev/...so I found the one pointing to my UNAVAIL (and subsequently OFFLINE) disk, and I was able to complete these steps successfully. It is now resilvering. Thank you! – Matt Apr 26 '17 at 23:08zpool status -gwhich shows the status using GUIDs for each device. Also, for @Matt,zpool status -Lwill show the status using the basic device names instead of the long/dev/disk/by-idnames. – StarNamer Mar 17 '18 at 15:03