From 7264905e323edb14cafcfc7b698af5990bcf698a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 20 Feb 2018 19:07:33 +0100 Subject: [PATCH] Script for starting all known OSDs --- ceph-osd-activate-all | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ceph-osd-activate-all diff --git a/ceph-osd-activate-all b/ceph-osd-activate-all new file mode 100644 index 0000000..713a311 --- /dev/null +++ b/ceph-osd-activate-all @@ -0,0 +1,20 @@ +#!/bin/sh +# Nico Schottelius, 2018-02-20 +# Copyright ungleich glarus ag + +set -e +set -x + +tmpdir=$(mktemp -d) + +for dev in $(fdisk -l | awk '$6 ~/Ceph/ { print $1 }'); do + mount "$dev" "$tmpdir" + id=$(cat "${tmpdir}/whoami") + umount "$dev" + + dir="/var/lib/ceph/osd/ceph-$id" + mkdir -p "$dir" + mount "$dev" "$dir" + + /etc/init.d/ceph start "osd.$id" +done