mount.ceph – mount a Ceph file system

Synopsis

mount.ceph [mon1_socket,mon2_socket,…]:/[subdir] dir [-o options ]

Description

mount.ceph is a helper for mounting the Ceph file system on a Linux host.It serves to resolve monitor hostname(s) into IP addresses and readauthentication keys from disk; the Linux kernel client component does most ofthe real work. In fact, it is possible to mount a non-authenticated Ceph filesystem without mount.ceph by specifying monitor address(es) by IP:

  1. mount -t ceph 1.2.3.4:/ /mnt/mycephfs

The first argument is the device part of the mount command. It includes host’ssocket and path within CephFS that will be mounted at the mount point. Thesocket, obviously, takes the form ip_address[:port]. If the port is notspecified, the Ceph default of 6789 is assumed. Multiple monitor addresses canbe passed by separating them by commas. Only one monitor is needed to mountsuccessfully; the client will learn about all monitors from any responsivemonitor. However, it is a good idea to specify more than one in case the onehappens to be down at the time of mount.

If the host portion of the device is left blank, then mount.ceph willattempt to determine monitor addresses using local configuration filesand/or DNS SRV records. In similar way, if authentication is enabled on Cephcluster (which is done using CephX) and options secret and secretfileare not specified in the command, the mount helper will spawn a child processthat will use the standard Ceph library routines to find a keyring and fetchthe secret from it.

A sub-directory of the file system can be mounted by specifying the (absolute)path to the sub-directory right after “:” after the socket in the device partof the mount command.

Mount helper application conventions dictate that the first two options aredevice to be mounted and the mountpoint for that device. Options must bepassed only after these fixed arguments.

Options

Basic

  • conf
  • Path to a ceph.conf file. This is used to initialize the Ceph contextfor autodiscovery of monitor addresses and auth secrets. The default isto use the standard search path for ceph.conf files.
  • command
  • _mds_namespace=_Specify the non-default file system to be mounted. Not passing thisoption mounts the default file system.

  • mount_timeout
  • int (seconds), Default: 60

  • name

  • RADOS user to authenticate as when using CephX. Default: guest

  • secret

  • secret key for use with CephX. This option is insecure because it exposesthe secret on the command line. To avoid this, use the secretfile option.

  • secretfile

  • path to file containing the secret key to use with CephX

  • recover_session=

  • Set auto reconnect mode in the case where the client is blacklisted. Theavailable modes are no and clean. The default is no.

      • no: never attempt to reconnect when client detects that it has been
      • blacklisted. Blacklisted clients will not attempt to reconnect andtheir operations will fail too.
    • clean: client reconnects to the Ceph cluster automatically when itdetects that it has been blacklisted. During reconnect, client dropsdirty data/metadata, invalidates page caches and writable file handles.After reconnect, file locks become stale because the MDS loses track ofthem. If an inode contains any stale file locks, read/write on the inodeis not allowed until applications release all stale file locks.

Advanced

  • cap_release_safety
  • int, Default: calculated

  • caps_wanted_delay_max

  • int, cap release delay, Default: 60

  • caps_wanted_delay_min

  • int, cap release delay, Default: 5

  • dirstat

  • funky cat dirname for stats, Default: off

  • nodirstat

  • no funky cat dirname for stats

  • ip

  • my ip

  • noasyncreaddir

  • no dcache readdir

  • nocrc

  • no data crc on writes

  • noshare

  • create a new client instance, instead of sharing an existing instance ofa client mounting the same cluster

  • osdkeepalive

  • int, Default: 5

  • osdtimeout

  • int (seconds), Default: 60

  • osd_idle_ttl

  • int (seconds), Default: 60

  • rasize

  • int (bytes), max readahead. Default: 8388608 (8192*1024)

  • rbytes

  • Report the recursive size of the directory contents for st_size ondirectories. Default: off

  • norbytes

  • Do not report the recursive size of the directory contents forst_size on directories.

  • readdir_max_bytes

  • int, Default: 524288 (512*1024)

  • readdir_max_entries

  • int, Default: 1024

  • rsize

  • int (bytes), max read size. Default: 16777216 (1610241024)

  • snapdirname

  • string, set the name of the hidden snapdir. Default: .snap

  • write_congestion_kb

  • int (kb), max writeback in flight. scale with availablememory. Default: calculated from available memory

  • wsize

  • int (bytes), max write size. Default: 16777216 (1610241024) (writebackuses smaller of wsize and stripe unit)

Examples

Mount the full file system:

  1. mount.ceph :/ /mnt/mycephfs

Assuming mount.ceph is installed properly, it should be automatically invokedby mount(8):

  1. mount -t ceph :/ /mnt/mycephfs

Mount only part of the namespace/file system:

  1. mount.ceph :/some/directory/in/cephfs /mnt/mycephfs

Mount non-default FS, in case cluster has multiple FSs:

  1. mount -t ceph :/ /mnt/mycephfs2 -o mds_namespace=mycephfs2

Pass the monitor host’s IP address, optionally:

  1. mount.ceph 192.168.0.1:/ /mnt/mycephfs

Pass the port along with IP address if it’s running on a non-standard port:

  1. mount.ceph 192.168.0.1:7000:/ /mnt/mycephfs

If there are multiple monitors, passes addresses separated by a comma:

  1. mount.ceph 192.168.0.1,192.168.0.2,192.168.0.3:/ /mnt/mycephfs

If authentication is enabled on Ceph cluster:

  1. mount.ceph :/ /mnt/mycephfs -o name=fs_username

Pass secret key for CephX user optionally:

  1. mount.ceph :/ /mnt/mycephfs -o name=fs_username,secret=AQATSKdNGBnwLhAAnNDKnH65FmVKpXZJVasUeQ==

Pass file containing secret key to avoid leaving secret key in shell’s commandhistory:

  1. mount.ceph :/ /mnt/mycephfs -o name=fs_username,secretfile=/etc/ceph/fs_username.secret

Availability

mount.ceph is part of Ceph, a massively scalable, open-source, distributed storage system. Pleaserefer to the Ceph documentation at http://ceph.com/docs for moreinformation.

See also

ceph-fuse(8),ceph(8)