KB450231 – How To Mount CephFS on Linux Clients

Last modified: March 23, 2021
You are here:
Estimated reading time: 1 min

      KB450231 – CephFS Kernel Mount using Secretfile on Linux Clients


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


  • A running Ceph Cluster
  • CephFS filesystem running on a Ceph Cluster
  • The IP or host-name of one or more Ceph monitors
  • Access to a linux client system that is able to connect to the Ceph Cluster through a network


Install required packages and dependencies on the linux client system

  • The only package required on the client is the ceph-common package and dependencies
For 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
root@centos7-45drives:~# yum install ceph-common

For Ubuntu 20.04:

root@ubuntu-45drives:~# vim /etc/apt/source.list
deb https://download.ceph.com/debian-octopus/ focal main
# deb-src https://download.ceph.com/debian-octopus/ focal main
root@ubuntu-45drives:~# apt install ceph-common

Copy secret-client-admin-keyring to client system in secret file

On any ceph monitor system:
  • Create client user admin keyring:

root@OSD1-45drives:~# ceph auth get-key client.admin > admin.secret
  • Copy it to the client machine

root@OSD1-45drives:~# scp admin.secret clientIP:/etc/ceph/
On client system:

Ensure the permissions are set appropriately for the file most likely:

root@client-45drives:~# chmod 600 /etc/ceph/admin.secret

Mounting filesystem on Client

Kernel Driver Mount:
  • Create location to mount CephFS:

root@client-45drives:~# mkdir /mnt/mycephfsmount
  • Mount the filesystem:
root@client-45drives:~# mount -t ceph {ip-address-of-ceph-monitor}:/ /mnt/mycephfsmount -o name=admin,secretfile=/etc/ceph/admin.secret


root@client-45drives:~# mount -t ceph,, /mnt/mycephfsmount -o name=admin,secretfile=/etc/ceph/admin.secret

Adding Filesystem to fstab to remount on boot:

  • To remount the CephFS filesystem on boot, we’ll have to edit the /etc/fstab file. We do this by:

root@client-45drives:~# vim /etc/fstab
CEPH-MON-IP:/     /mnt/mycephfsmount   ceph    name=admin,secretfile=/etc/ceph/admin.secret	noatime,_netdev    0       0

Example:,, /mnt/mycephfsmount ceph name=admin,secretfile=/etc/ceph/admin.secret,noatime,_netdev 0 0


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

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