mkcephfs creates osd data directory automatically, but it doesn't create a
directory for the osd journal file.
When you have a journal file in a directory that differs from the osd data
directory in your configuration, like:
osd data = /osd/osd$id
osd journal = /journal/osd$id
You will receive a "mount failed to open journal /journal/osd0/journal: No
such file or directory" error when doing mkcephfs
Signed-off-by: CC Lien <cc_lien@tcloudcomputing.com>
if [ "$type" = "osd" ]; then
get_conf osd_data "" "osd data"
+ get_conf osd_journal "" "osd journal"
get_conf keyring "" "keyring"
get_conf btrfs_path "$osd_data" "btrfs path" # mount point defaults so osd data
get_conf btrfs_devs "" "btrfs devs"
[ -n "$btrfs_opt" ] && btrfs_opt="-o $btrfs_opt"
do_cmd "test -d $osd_data || mkdir -p $osd_data"
+ [ -n "$osd_journal" ] && do_cmd "test -d $osd_journal || mkdir -p `dirname $osd_journal`"
if [ $mkbtrfs -eq 1 ]; then
get_conf osd_user "root" "user"