Disk serial number from OSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I just created this little bash script to retrieve the "/dev/disk/by-id"
string for each OSD on a host. Our disks are internally mounted so have no
concept of drive bays, this should make it easier to work out what disk has
failed.

#!/bin/bash

DISKS=`ceph-disk list | grep "ceph data"`
old_IFS=$IFS
IFS=$'\n'
echo $DISKS
for DISK in $DISKS; do
        DEV=`awk '{print $1}' <<< $DISK`
        OSD=`awk '{print $7}' <<< $DISK`
        DEV=`echo $DEV | sed -e 's/\/dev\///g'`
        ID=`ls -l /dev/disk/by-id | grep $DEV | awk '{print $9}' | egrep -v
"wwn"`
        echo $OSD $ID
done
IFS=$old_IFS




_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com




[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux