How to delete a file that is stored in Ceph via Block device mounted on Ubuntu?

How to delete a file that is stored in Ceph via Block device mounted on Ubuntu?

I have followed the docs here and created a basic Ceph block device
I can also read/write to the block device using basic C# file operation.
Howerver when i delete a file using rm command in linux terminal, the file is removed from mounted device but the disk still remains occupied (at least that is what is shown in dashboard plugin).
Any why one knows the cause?

Solutions/Answers:

Solution 1:

Ceph block storage (rbd) allows you to create full file systems on top of ceph. However these filesystems don’t know they’re on top of ceph and behave as they would normally. When an object is deleted the filesystem marks it as deleted without actually releasing space to the underlying data store.

You can force the filesystem to release the space by running the fstrim command on the block device.

See this post for a more detailed explanation of what’s going on: https://www.sebastien-han.fr/blog/2015/01/26/ceph-and-krbd-discard/

References

Loading...