Created
August 22, 2016 13:19
-
-
Save fiskn/4070302063fe52a5bf1e0cb3cb02e67e to your computer and use it in GitHub Desktop.
Lists osd to disk serial numbers, useful for finding failed disks in 12x3.5" in 1U servers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment