1 # rbdmap - Ceph RBD Mapping
3 # This script does not manage mount and unmount fs which depends on rbd device.
4 # You should use _netdev option in fstab to mount and umount in the correct order.
6 description "ceph rbd mapping"
8 start on (started networking
9 and remote-filesystems)
10 stop on unmounted-remote-filesystems
12 env RBDMAPFILE="/etc/ceph/rbdmap"
15 if [ ! -f "$RBDMAPFILE" ]; then
19 while read DEV PARAMS; do
30 for PARAM in $(echo $PARAMS | tr ',' '\n'); do
31 CMDPARAMS="$CMDPARAMS --$(echo $PARAM | tr '=' ' ')"
33 if [ ! -b /dev/rbd/$DEV ]; then
35 rbd map $DEV $CMDPARAMS
41 if ls /dev/rbd[0-9]* >/dev/null 2>&1; then
42 for DEV in /dev/rbd[0-9]*; do