1

I had set xattrs for quota limits on CephFS

$ setfattr -n ceph.quota.max_bytes -v 1100000000  /mnt/cephfs/data/

I can get value of this attribute

$ getfattr -n ceph.quota.max_bytes /mnt/cephfs/data/
getfattr: Removing leading '/' from absolute path names
# file: mnt/cephfs/data/
ceph.quota.max_bytes="1100000000"

But then I try to remove quota, I had

$ setfattr -x ceph.quota.max_bytes /mnt/cephfs/data/
setfattr: /mnt/cephfs/data/: No such attribute

How can I remove this xattr?

1 Answer 1

1

The way to remove the quota is not to use setfattr -x but set the value to 0:

setfattr -n ceph.quota.max_bytes -v 0 /mnt/cephfs/data/

After the value has been set to 0 the attribute is not present anymore:

getfattr /mnt/cephfs/data/ -n ceph.quota.max_bytes
/mnt/cephfs/data/: ceph.quota.max_bytes: No such attribute

Check out the docs for more information.

2
  • I know this way, but I need to remove attribute, not set to 0. Its optional attribute. Other optional attributes are removed without problem, but Ceph's are not. They have some limitations getfattr -d don't show ceph domain too. I need to exactly remove optional attr, may be by call syscalls or any dirty tricks
    – Dan B
    Jun 21, 2023 at 4:33
  • Did you read the docs? If you set the value to 0 the attribute is actually removed. If you run a getfattr on the path again it will show you "No such attribute"
    – eblock
    Jun 21, 2023 at 8:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .