Advertisement
Guest User

Untitled

a guest
Apr 28th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.56 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # define where to export
  4. restorepath=/home/restore
  5.  
  6. # define path where your problematic osd mounted
  7. osdpath=/var/lib/ceph/osd/ceph-3
  8.  
  9. # getting problem pgs
  10. pgs=$(ceph health detail | grep ^pg | grep down | grep -v stuck | sort)
  11. #echo "$pgs"
  12.  
  13. # cycling thourgh them
  14. echo "$pgs" | while read -r pg; do
  15.   # get pg id
  16.   pgid=$(echo $pg | awk '{print $2}')
  17.   # or simply restore on current machine
  18.   ceph-objectstore-tool --op export --pgid $pgid --data-path $osd --journal-path /var/lib/ceph/osd/ceph-3/journal --file $restorepath/$pgid.export
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement