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

KB450431 – Removing CephFS Samba Shares

You are here:


This article details the process of removing a samba share from your Ceph cluster.


  • Configured Ceph Cluster
  • Configured SMB share that you want to delete


Removing the SMB Sharing Protocol from the Directory

  • To remove the share you will need to ssh into a gateway server. If you do not have gateways, then ssh into a node with the MDS service.
  • To see your existing shares you can use the following command:
testparm -s

  • In this example, we will be deleting the share called “secure”. Use the following command to delete the sharing of the data through SMB. This will not delete data, but will stop all sharing through SMB.
net conf delshare (sharename)


  • As seen in the image above the share is no longer listed when running the command “testparm -s”. The data is still stored just not being shared out.

Deleting the Data that was stored in that Share

This next portion of the guide will delete the data stored on the share. All data will be lost.
  • As seen below, when you go to the directory where the shares are stored, it will still list the deleted share. On the gateways you can see what shares are still mounted using this command:

  • Go on each gateway node and unmount the share you want to delete and remove the line with your sharename from fstab using the following commands.
umount /mnt/cephfs/fsgw/(sharename)
vim /etc/fstab
  • Once the share has been unmounted and the fstab command removed on all gateways we can proceed to mount the cephfs filesystem directly on OSD1 and removing the data from that point using the following:
mount -t ceph :/fsgw /mnt/cephfs/fsgw -o name=samba,secretfile=/etc/ceph/samba.secret
cd /mnt/cephfs/fsgw
rm -rf (sharename)
umount /mnt/cephfs/fsgw
  • Once the data is deleted you can unmount the share. Use the “df” command to check the mountpoint and the command below to unmount. Unmount the path on each gateway.

  • Now the share has been deleted, and all the contents have been removed.


  • To confirm the share is deleted use the command:

testparm -s

  • To ensure the data is deleted from CephFS, you can mount CephFS onto a node/gateway and make sure the directory is gone. To mount:
mkdir /mnt/cephfs/
mount -t ceph :/fsgw /mnt/cephfs/ -o name=samba,secretfile=/etc/ceph/samba.secret
  • Now you can go to the mount point and check if the share is deleted, these commands will show the shares that are created:
cd /mnt/cephfs/fsgw



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