Skip to content

Instantly share code, notes, and snippets.

@wido
Created November 11, 2019 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wido/8c9f9ef141182b5b89a50cbc8dcad71c to your computer and use it in GitHub Desktop.
Save wido/8c9f9ef141182b5b89a50cbc8dcad71c to your computer and use it in GitHub Desktop.
Start all failed Ceph OSDs
#!/bin/sh
#
# Start all OSDs on a host which didnt start for some reason
#
# Author: Wido den Hollander <wido@denhollander.io>
#
df -h|grep ceph|grep osd|awk '{print $6}'|cut -d '-' -f 2|sort -n|xargs -n 1 -I OSD systemctl reset-failed ceph-osd@OSD
df -h|grep ceph|grep osd|awk '{print $6}'|cut -d '-' -f 2|sort -n|xargs -n 1 -I OSD systemctl start ceph-osd@OSD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment