Did you know  45Drives offers free  public and private  webinars ? Click here to learn more  & register! Build & Price

KB450228 – Mounting CephFS

You are here:


  • This guide will show you how to mount CephFS filesystem on a Linux client using a kernel driver mount and secret file.



Ceph-Common Package Installation

  • The only package required on the client is ceph-common package and its dependencies.
  • First, we’ll have to enable the Ceph repositories on our client machines.

CentOS 7

root@centos7-45drives:~# cat <<EOF >> /etc/yum.repos.d/ceph_stable.repo 
  baseurl = http://download.ceph.com/rpm-octopus/el7/$basearch 
  gpgcheck = 1 
  gpgkey = https://download.ceph.com/keys/release.asc 
  name = Ceph Stable $basearch repo priority = 2
  baseurl = http://download.ceph.com/rpm-octopus/el7/noarch
  gpgcheck = 1
  gpgkey = https://download.ceph.com/keys/release.asc
  name = Ceph Stable noarch repo
  priority = 2
  • Now we can install the ceph-common package.
root@centos7-45drives:~# yum install ceph-common

Ubuntu 20.04

  • Get the release key
root@ubuntu-45drives:~# wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
  • Add the ceph repository
root@ubuntu-45drives:~# apt-add-repository 'deb https://download.ceph.com/debian-octopus/ focal main'
  • Update the system to get the new repo.
root@ubuntu-45drives:~# apt update 
if the update fails try the flag "--allow-unverified"
root@ubuntu-45drives:~# apt upgrade
  • Now we can install the ceph-common package.
root@ubuntu-45drives:~# apt install ceph-common

Creating CephFS mount point on client

  • First, create a directory to mount CephFS.
root@client-45drives:~# mkdir /mnt/mycephfsmount

Mounting CephFS on client

  • First we need to make and copy the admin.secret file to use for authentication on the client. on a ceph monitor run the following
root@ceph:~# cd /etc/ceph 
root@ceph:~# ceph auth get-key client.admin > admin.secret
root@ceph:~# scp admin.secret user@(clientip):/etc/ceph/
  • Next, we mount the filesystem to that directory using the following command.
root@client-45drives:~# mount -t ceph {ip-address-of-ceph-monitor}:/ /mnt/mycephfsmount -o name=admin,secretfile=/etc/ceph/admin.secret

  • For example, if our Ceph Monitors were,, and, we would mount CephFS similar to the following.
root@client-45drives:~# mount -t ceph,, /mnt/mycephfsmount -o name=admin,secretfile=/etc/ceph/admin.secret

Configuring CephFS in /etc/fstab

  • Next, we’ll have to configure our CephFS mount to automagically remount on reboot by editing the /etc/fstab file.
root@client-45drives:~# vim /etc/fstab
  • We can add the following to our fstab file to ensure it will remount on reboot.
CEPH-MON-IP(s):/     /mnt/mycephfsmount   ceph    name=admin,secretfile=/etc/ceph/admin.secret	noatime,_netdev 0 0,, /mnt/mycephfsmount ceph name=admin,secretfile=/etc/ceph/admin.secret,noatime,_netdev 0 0


  • If we run df -h we should now see CephFS mounted and the available storage for the mount.
root@client-45drives:~# df -h

Further Reading

Was this article helpful?
Dislike 0
Views: 4217
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access