Need to identify disk in zpool ... how?
To get a disk serial requires that it is running and available:
-
camcontrol identify <device> |grep ^serial
(this might be (S)ATA specific) smartcl -i <device> |grep ^Serial
- reading the disk label once removed from the enclosure
In your case, I think the 3rd solution is the only available. So, Assuming you just want first identify the disk:
Try first a glabel status
(as your drive is not shown as DOWN
or REMOVED
):
$ glabel status
gptid/c7868819-ddc1-11e2-8c3e-00138f3fd9c7 N/A da0p1
gptid/c96da0bc-ddc1-11e2-8c3e-00138f3fd9c7 N/A da2p1
-
You can see your partition with
glabel status
Then you can easily identify the disk device name (ex: da0 for the
gptid/c7868819-ddc1-11e2-8c3e-00138f3fd9c7
partition).You can have a look at your system starting log from
/var/log/messages
(aka "dmesg
"):$ dmesg | grep ^da0 da0 at mps0 bus 0 scbus0 target 0 lun 0 da0: <ATA ST3000DM001-1CH1 CC26> Fixed Direct Access SCSI-6 device da0: 600.000MB/s transfers da0: Command Queueing enabled da0: 2861588MB (5860533168 512 byte sectors: 255H 63S/T 364801C)
-
You cannot see your partition with
glabel status
$ camcontrol devlist <ATA ST3000DM001-1CH1 CC26> at scbus0 target 0 lun 0 (pass0,da0) <ATA ST3000DM001-1CH1 CC26> at scbus0 target 4 lun 0 (pass2,da2)
From there, you can easily spot which one is missing (da1 in this case), then have a look at
dmesg
to identify that disk.
So, no real solution here. I just hope that it help you see things a bit more clear.
To know more:
- FreeBSD GEOM
- man glabel
- man camcontrol
- man smartcl
#!/bin/sh
echo
echo $(basename $0) - Mounted Drives on $(hostname)
cat /etc/version
date
echo
diskinfo="$(glabel status | tail -n +2 | awk '{split($3,a,"p"); print a[1],$1}')"
echo "+========+==========================+==================+============================================+"
echo "| Device | DISK DESCRIPTION | SERIAL NUMBER | GPTID |"
echo "+========+==========================+==================+============================================+"
for d in $(echo "$diskinfo" | cut -d" " -f 1)
do
diskinf=$(diskinfo -v $d | grep '# Disk ')
diskdescription=$(echo "$diskinf" | grep '# Disk desc' | cut -d# -f 1 | xargs)
diskserialno=$(echo "$diskinf" | grep '# Disk ident' | cut -d# -f 1 | xargs)
diskgptid=$(echo "$diskinfo" | grep "^$d" | cut -d" " -f 2)
printf "| %-6s | %-24s | %-16s | %-42s |\n" "$d" "$diskdescription" "$diskserialno" "$diskgptid"
echo "+--------+--------------------------+------------------+--------------------------------------------+"
done
source