The ceph-mon --mkfs function no longer wipes out the directory; it is in
fact mostly a no-op that just verifies the dir exists.
So, ensure that the directory is empty at mkfs time. This could
alternatively do an 'rm -r' in that directory (that is in fact what
ceph-mon used to do), but this is safer.
Signed-off-by: Sage Weil <sage@inktank.com>
fi
if [ $type = "mon" ]; then
+ get_conf mon_data "/var/run/ceph/mon/ceph-$id" "mon data"
+ if [ `ls $mon_data | wc -l` -ne 0 ]; then
+ echo "ERROR: $name mon_data directory $mon_data is not empty."
+ echo " Please make sure that it is empty before running mkcephfs."
+ exit 1
+ fi
$BINDIR/ceph-mon -c $conf --mkfs -i $id --monmap $dir/monmap --osdmap $dir/osdmap -k $dir/keyring.mon
fi