Synopsis
========
-| **mkcephfs** -c *ceph.conf* [ --mkbtrfs ] [ -a, --all-hosts [ -k
+| **mkcephfs** -c *ceph.conf* [ --mkfs ] [ -a, --all-hosts [ -k
*/path/to/admin.keyring* ] ]
default is ``/etc/ceph/keyring`` (or whatever is specified in the
config file).
-.. option:: --mkbtrfs
+.. option:: --mkfs
- Create and mount the any btrfs file systems specified in the
- ceph.conf for OSD data storage using mkfs.btrfs. The "btrfs devs"
- and (if it differs from "osd data") "btrfs path" options must be
- defined.
+ Create and mount the any file systems specified in the
+ ceph.conf for OSD data storage using mkfs. The "devs" and (if it
+ differs from "osd data") "fs path" options must be defined.
**NOTE** Btrfs is still considered experimental. This option
- can ease some configuration pain, but is the use of btrfs is not
- required when ``osd data`` directories are mounted manually by the
- adminstrator.
-
- **NOTE** This option is deprecated and will be removed in a future
- release.
+ can ease some configuration pain, but is not required when
+ ``osd data`` directories are mounted manually by the adminstrator.
.. option:: --no-copy-conf
.
.SH SYNOPSIS
.nf
-\fBmkcephfs\fP \-c \fIceph.conf\fP [ \-\-mkbtrfs ] [ \-a, \-\-all\-hosts [ \-k
+\fBmkcephfs\fP \-c \fIceph.conf\fP [ \-\-mkfs ] [ \-a, \-\-all\-hosts [ \-k
\fI/path/to/admin.keyring\fP ] ]
.fi
.sp
.UNINDENT
.INDENT 0.0
.TP
-.B \-\-mkbtrfs
-Create and mount the any btrfs file systems specified in the
-ceph.conf for OSD data storage using mkfs.btrfs. The "btrfs devs"
-and (if it differs from "osd data") "btrfs path" options must be
+.B \-\-mkfs
+Create and mount any file systems specified in the
+ceph.conf for OSD data storage using mkfs.*. The "devs"
+and (if it differs from "osd data") "fs path" options must be
defined.
.sp
\fBNOTE\fP Btrfs is still considered experimental. This option
-can ease some configuration pain, but is the use of btrfs is not
+can ease some configuration pain, but the use of this option is not
required when \fBosd data\fP directories are mounted manually by the
adminstrator.
-.sp
-\fBNOTE\fP This option is deprecated and will be removed in a future
-release.
.UNINDENT
.INDENT 0.0
.TP
debug journal = 20
log dir = /data/cosd$id
osd data = /mnt/osd$id
- btrfs options = "flushoncommit,usertrans"
; user = root
; osd journal = /mnt/osd$id/journal
; osd journal size = 1000
osd journal = "/dev/disk/by-path/pci-0000:05:02.0-scsi-6:0:0:0"
+ osd mkfs type = btrfs
+ osd mount options btrfs = "flushoncommit,usertrans"
; filestore max sync interval = 1
- btrfs devs = "/dev/disk/by-path/pci-0000:05:01.0-scsi-2:0:0:0"
-; btrfs devs = "/dev/disk/by-path/pci-0000:05:01.0-scsi-2:0:0:0 \
+ devs = "/dev/disk/by-path/pci-0000:05:01.0-scsi-2:0:0:0"
+; devs = "/dev/disk/by-path/pci-0000:05:01.0-scsi-2:0:0:0 \
; /dev/disk/by-path/pci-0000:05:01.0-scsi-3:0:0:0 \
; /dev/disk/by-path/pci-0000:05:01.0-scsi-4:0:0:0 \
; /dev/disk/by-path/pci-0000:05:01.0-scsi-5:0:0:0 \
allhosts=0
debug=0
monaddr=
-dobtrfs=1
-dobtrfsumount=0
+dofsmount=1
+dofsumount=0
verbose=0
while echo $1 | grep -q '^-'; do # FIXME: why not '^-'?
shift
MON_ADDR=$1
;;
- --btrfs)
- dobtrfs=1
+ --btrfs | --fsmount)
+ dofsmount=1
;;
- --nobtrfs)
- dobtrfs=0
+ --nobtrfs | --nofsmount)
+ dofsmount=0
;;
- --btrfsumount)
- dobtrfsumount=1
+ --btrfsumount | --fsumount)
+ dofsumount=1
;;
--conf | -c)
[ -z "$2" ] && usage_exit
if echo $name | grep -q ^osd; then
get_conf osd_data "" "osd data"
- get_conf btrfs_path "$osd_data" "btrfs path" # mount point defaults so osd data
- get_conf btrfs_devs "" "btrfs devs"
- first_dev=`echo $btrfs_devs | cut '-d ' -f 1`
+ get_conf fs_path "$osd_data" "fs path" # mount point defaults so osd data
+ get_conf fs_devs "" "devs"
+ if [ -z "$fs_devs" ]; then
+ # try to fallback to old keys
+ get_conf tmp_btrfs_devs "" "btrfs devs"
+ if [ -n "$tmp_btrfs_devs" ]; then
+ fs_devs="$tmp_btrfs_devs"
+ else
+ echo No osd devs defined!
+ fi
+ fi
+ first_dev=`echo $fs_devs | cut '-d ' -f 1`
fi
# do lockfile, if RH
cmd="$wrap $cmd $runmode"
- if [ $dobtrfs -eq 1 ] && [ -n "$btrfs_devs" ]; then
+ if [ $dofsmount -eq 1 ] && [ -n "$fs_devs" ]; then
get_conf pre_mount "true" "pre mount command"
- get_conf btrfs_opt "noatime" "btrfs options"
- [ -n "$btrfs_opt" ] && btrfs_opt="-o $btrfs_opt"
+ get_conf fs_type "" "osd mkfs type"
+
+ if [ -z "$fs_type" ]; then
+ # try to fallback to to old keys
+ get_conf tmp_devs "" "btrfs devs"
+ if [ -n "$tmp_devs" ]; then
+ fs_type = "btrfs"
+ else
+ echo No filesystem type defined!
+ exit 0
+ fi
+ fi
+
+ get_conf fs_opt "" "osd mount options $fs_type"
+ if [ -z "$fs_opt" ]; then
+ if [ "$fs_type" = "btrfs" ]; then
+ #try to fallback to old keys
+ get_conf fs_opt "" "btrfs options"
+ fi
+
+ if [ -z "$fs_opt" ]; then
+ #fallback to use at least noatime
+ fs_opt="rw,noatime"
+ fi
+ fi
+
+ [ -n "$fs_opt" ] && fs_opt="-o $fs_opt"
[ -n "$pre_mount" ] && do_cmd "$pre_mount"
- echo Mounting Btrfs on $host:$btrfs_path
- do_root_cmd "modprobe btrfs ; btrfs device scan || btrfsctl -a ; egrep -q '^[^ ]+ $btrfs_path' /proc/mounts || mount -t btrfs $btrfs_opt $first_dev $btrfs_path"
+
+ if [ "$fs_type" == "btrfs" ]; then
+ echo Mounting Btrfs on $host:$fs_path
+ do_root_cmd "modprobe btrfs ; btrfs device scan || btrfsctl -a ; egrep -q '^[^ ]+ $fs_path' /proc/mounts || mount -t btrfs $fs_opt $first_dev $fs_path"
+ else
+ echo Mounting $fs_type on $host:$fs_path
+ do_root_cmd "modprobe $fs_type ; egrep -q '^[^ ]+ $fs_path' /proc/mounts || mount -t $fs_type $fs_opt $first_dev $fs_path"
+ fi
fi
echo Starting Ceph $name on $host...
mkdir -p $RUN_DIR
stop_daemon $name ceph-$type $pid_file
[ -n "$post_stop" ] && do_cmd "$post_stop"
[ -n "$lockfile" ] && [ "$?" -eq 0 ] && rm -f $lockfile
- if [ $dobtrfsumount -eq 1 ] && [ -n "$btrfs_devs" ]; then
- echo Unmounting Btrfs on $host:$btrfs_path
- do_root_cmd "umount $btrfs_path || true"
+ if [ $dofsumount -eq 1 ] && [ -n "$fs_devs" ]; then
+ echo Unmounting OSD volume on $host:$fs_path
+ do_root_cmd "umount $fs_path || true"
fi
;;
fi
usage_exit() {
- echo "usage: $0 -a -c ceph.conf [-k adminkeyring] [--mkbtrfs]"
+ echo "usage: $0 -a -c ceph.conf [-k adminkeyring] [--mkfs]"
echo " to generate a new ceph cluster on all nodes; for advanced usage see man page"
echo " ** be careful, this WILL clobber old data; check your ceph.conf carefully **"
exit
allhosts=0
-mkbtrfs=0
+mkfs=0
preparemonmap=0
prepareosdfs=""
initdaemon=""
preparemon=1
manual_action=1
;;
- --mkbtrfs)
- mkbtrfs=1
+ --mkbtrfs | --mkfs)
+ mkfs=1
;;
--no-copy-conf)
nocopyconf=1
get_conf osd_data "/var/lib/ceph/osd/ceph-$id" "osd data"
get_conf osd_journal "$osd_data/journal" "osd journal"
- get_conf btrfs_path "$osd_data" "btrfs path" # mount point defaults so osd data
- get_conf btrfs_devs "" "btrfs devs"
-
- if [ -z "$btrfs_devs" ]; then
- echo "no btrfs devs defined for $name"
- exit 0
+ get_conf fs_path "$osd_data" "fs path" # mount point defaults so osd data
+ get_conf fs_devs "" "devs"
+ get_conf fs_type "" "osd mkfs type"
+
+ if [ -z "$fs_devs" ]; then
+ # try to fallback to old keys
+ get_conf tmp_btrfs_devs "" "btrfs devs"
+ if [ -n "$tmp_btrfs_devs" ]; then
+ fs_devs="$tmp_btrfs_devs"
+ else
+ echo "no devs defined for $name"
+ exit 0
+ fi
+ fi
+ if [ -z "$fs_type" ]; then
+ # try to fallback to to old keys
+ get_conf tmp_devs "" "btrfs devs"
+ if [ -n "$tmp_devs" ]; then
+ fs_type = "btrfs"
+ else
+ echo No filesystem type defined!
+ exit 0
+ fi
fi
- first_dev=`echo $btrfs_devs | cut '-d ' -f 1`
- get_conf btrfs_opt "noatime" "btrfs options"
- [ -n "$btrfs_opt" ] && btrfs_opt="-o $btrfs_opt"
+ first_dev=`echo $fs_devs | cut '-d ' -f 1`
+ get_conf fs_opt "" "osd mount options $fs_type"
+ if [ -z "$fs_opt" ]; then
+ if [ "$fs_type" = "btrfs" ]; then
+ #try to fallback to old keys
+ get_conf fs_opt "" "btrfs options"
+ fi
+ if [ -z "$fs_opt" ]; then
+ #fallback to use at least rw,noatime
+ fs_opt="rw,noatime"
+ fi
+ fi
+ [ -n "$fs_opt" ] && fs_opt="-o $fs_opt"
get_conf osd_user "root" "user"
- if [ -n "$osd_journal" ] && echo "$btrfs_devs" | grep -q -w "$osd_journal" ; then
- echo "ERROR: osd journal device ($osd_journal) also used by btrfs devs ($btrfs_devs)"
+ if [ -n "$osd_journal" ] && echo "fs_devs" | grep -q -w "$osd_journal" ; then
+ echo "ERROR: osd journal device ($osd_journal) also used by devs ($fs_devs)"
exit 1
fi
test -d $osd_journal || mkdir -p `dirname $osd_journal`
fi
- umount $btrfs_path || true
- for f in $btrfs_devs ; do
+ umount $fs_path || true
+ for f in $fs_devs ; do
umount $f || true
done
- modprobe btrfs || true
- mkfs.btrfs $btrfs_devs
- btrfs device scan || btrfsctl -a
- sync # seems to fix problems for some people...
- mount -t btrfs $btrfs_opt $first_dev $btrfs_path
- chown $osd_user $btrfs_path
- chmod +w $btrfs_path
-
+ get_conf mkfs_opt "" "osd mkfs options $fs_type"
+ if [ "$fs_type" == "xfs" ] && [ -z "$mkfs_opt" ]; then
+ echo Xfs filesystem found add missing -f mkfs option!
+ mkfs_opt="-f"
+ fi
+ modprobe $fs_type || true
+ mkfs.$fs_type $mkfs_opt $fs_devs
+ mount -t $fs_type $fs_opt $first_dev $fs_path
+ chown $osd_user $fs_path
+ chmod +w $fs_path
+
exit 0
fi
fi
fi
- if [ $mkbtrfs -eq 1 ] && [ "$type" = "osd" ]; then
+ if [ $mkfs -eq 1 ] && [ "$type" = "osd" ]; then
do_root_cmd "$0 -d $rdir --prepare-osdfs $name"
fi
;debug filestore = 20
;debug journal = 20
+ ; The filesystem used on the volumes
+ osd mkfs type = btrfs
+ ; If you want to specify some other mount options, you can do so.
+ ; for other filesystems use 'osd mount options $fstype'
+ osd mount options btrfs = rw,noatime
+ ; The options used to format the filesystem via mkfs.$fstype
+ ; for other filesystems use 'osd mkfs options $fstype'
+ ; osd mkfs options btrfs =
+
+
[osd.0]
host = delta
- ; if 'btrfs devs' is not specified, you're responsible for
+ ; if 'devs' is not specified, you're responsible for
; setting up the 'osd data' dir. if it is not btrfs, things
; will behave up until you try to recover from a crash (which
; usually fine for basic testing).
- btrfs devs = /dev/sdx
-
- ; If you want to specify some other mount options, you can do so.
- ; The default values are rw,noatime
- ;btrfs options = rw,noatime
+ devs = /dev/sdx
[osd.1]
host = epsilon
- btrfs devs = /dev/sdy
+ devs = /dev/sdy
[osd.2]
host = zeta
- btrfs devs = /dev/sdx
+ devs = /dev/sdx
[osd.3]
host = eta
- btrfs devs = /dev/sdy
+ devs = /dev/sdy
keyring = /mnt/osd.$id/keyring
osd data = /mnt/osd.$id
osd journal = /dev/disk/by-label/osd.$id.journal
- btrfs devs = /dev/disk/by-label/osd.$id.data
+ osd mkfs type = btrfs
+ osd mount options btrfs = rw,noatime
+ devs = /dev/disk/by-label/osd.$id.data
; temp sage
debug osd = 20
debug ms = 1