Skip to content

Instantly share code, notes, and snippets.

@shundezhang
Created July 9, 2019 01:57
Show Gist options
  • Save shundezhang/5b7e9bda8f03ae7cf7bdd8785e231254 to your computer and use it in GitHub Desktop.
Save shundezhang/5b7e9bda8f03ae7cf7bdd8785e231254 to your computer and use it in GitHub Desktop.
ceph disk list for ceph nautilus
#!/bin/bash
# run "ceph-volume simple scan" to generate OSD json files, these files will be placed in /etc/ceph/osd/
JSON_PATH="/etc/ceph/osd/"
for i in `ls $JSON_PATH`; do
OSD_ID=`cat $JSON_PATH$i | jq '.whoami'`
DATA_PATH=`cat $JSON_PATH$i | jq -r '.data.path'`
DB_PATH=`cat $JSON_PATH$i | jq -r '."block.db".path'`
WAL_PATH=`cat $JSON_PATH$i | jq -r '."block.wal".path'`
echo "OSD.$OSD_ID: $DATA_PATH"
#echo $DB_PATH
DB_REAL=`readlink -f $DB_PATH`
WAL_REAL=`readlink -f $WAL_PATH`
echo " db: $DB_REAL"
echo " wal: $WAL_REAL"
echo "============================="
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment