]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph.in: Create osd data dir before fs_type check. 4512/head
authorhuangjun <hjwsm1989@gmail.com>
Thu, 30 Apr 2015 03:35:13 +0000 (11:35 +0800)
committerhuangjun <hjwsm1989@gmail.com>
Sat, 16 May 2015 10:47:20 +0000 (18:47 +0800)
  One host in cluster crashed and rebuilded, but failed to start osds
  because the data dir not exist.

Signed-off-by: huangjun <hjwsm1989@gmail.com>
src/init-ceph.in

index 2ff98c7c21af3a6f55b9cb368f4f807362f57c51..71e1b6a687274dd085e52685a33459c124c6ee8b 100644 (file)
@@ -344,6 +344,7 @@ for name in $what; do
                [ -n "$fs_opt" ] && fs_opt="-o $fs_opt"
                [ -n "$pre_mount" ] && do_cmd "$pre_mount"
 
+               do_root_cmd_okfail "mkdir -p $fs_path"
                if [ "$fs_type" = "btrfs" ]; then
                    echo Mounting Btrfs on $host:$fs_path
                    do_root_cmd_okfail "modprobe btrfs ; btrfs device scan || btrfsctl -a ; egrep -q '^[^ ]+ $fs_path ' /proc/mounts || mount -t btrfs $fs_opt $first_dev $fs_path"