Removing CephFS Samba Shares
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:
- 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.
df 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.