ungleich-tools/ceph-osd-activate-all
Nico Schottelius d708970f9c +quotes
2018-02-20 19:13:19 +01:00

24 lines
464 B
Bash
Executable file

#!/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")
# Chown the dev device to be accessible for ceph
chown ceph:ceph "${tmpdir}/block"
umount "$dev"
dir="/var/lib/ceph/osd/ceph-$id"
mkdir -p "$dir"
mount "$dev" "$dir"
/etc/init.d/ceph start "osd.$id"
done