I've got a large ZFS disk pool; 3 nested RAIDZ2 vdevs.
I am documenting the process for replacing a failed disk for my colleagues and so simulated a disk failure by removing a disk from the host.
Sure enough, the vdev to which the disk belonged became degraded and the disk unavailable.
I offlined the disk like so...
zpool offline diskpool sdo
A quick 'zpool status' shows the disk as offline... so far so good.
I replaced the disk and confirmed on my SATA controller the new disk was detected, which it was. Then i tried to get linux to rescan the scsi bus to detect the disk. This is where my first problem occurs.
As far as I know, the following command is used to find the correct host bus to rescan...
grep mpt /sys/class/scsi_host/host?/proc_name
However on my Centos 7.2 system, this command has no output. It doesn't error, it just gives me null output and waits for my next command.
I'm using several specialist cards that allow me to connect many sata devices. I would normally rescan the bus with
echo "- - -" > /sys/class/scsi_host/hostX/scan
Where hostX is the correct host bus, but as I cannot find the host bus, I cannot complete this step.
Is there another way to get this info or has the command changed in Centos 7.2 or something?
Furthermore, I opted to reboot the machine to allow me to continue testing. Following a reboot, the ZFS pool was not attached. I had to manually import it with 'zpool import diskpool'. That worked fine, but strangely once its imported, if i do 'zpool status', I no longer see the device IDs like it showed me before...
raidz2-2 ONLINE 0 0 0
/dev/sdd ONLINE 0 0 0
/dev/sde ONLINE 0 0 0
/dev/sdf ONLINE 0 0 0
/dev/sdg ONLINE 0 0 0
Instead, it seems to have the drive serial numbers...
raidz2-2 ONLINE 0 0 0
ata-ST8000AS0002-1NA17Z_Z840DG66 ONLINE 0 0 0
ata-ST8000AS0002-1NA17Z_Z840DVE0 ONLINE 0 0 0
ata-ST8000AS0002-1NA17Z_Z840CQFB ONLINE 0 0 0
ata-ST8000AS0002-1NA17Z_Z840DP2V ONLINE 0 0 0
This will cause a problem in the future as if a further disk fails, I will struggle to identify the correct disk to replace.
Is there a way I can switch this back so I'm shown the device id again?
Thanks in advance!
I was more concerned with how i would know in the future that i would need to offline and replace '/dev/sdf' (for example) when it wasnt giving me the device id's.
The host has been rebooted again since and Its still not giving me names as I expected.
– John Apr 01 '16 at 13:12alias list_disks='find /dev/disk/by-id/ -iname ata-* -o -iname usb-* -o -iname dm-name* | grep -v -- -part | while read disk ; do echo $(basename $(readlink $disk)) $(basename $disk); done | sed -re "s/(usb|ata)-// ; s/(SATA|Generic)_//" | sort'
. See http://unix.stackexchange.com/a/93363/7696 – cas Apr 01 '16 at 23:47uuidgen
). It's a 64-bit identifier that ZFS refers to as a UUID. The pool is then identified by another 64-bit value, for a total of 2^128 theoretically addressable devices in a single ZFS system. You can see its value in the output ofzdb
if you want to. – user Jul 21 '16 at 06:39