Hi Janne, thanks for the hint. I was aware of that, but it is goot to add that knowledge to the question for further googlesearcher. Hi Ilya, that fixed it. Do we know why the discard does not work when the partition table is not aligned? We provide OS templates to our customer, but they can also create and attach an empty block device, and they will certainly not check if the partitions are aligned correctly. Cheers Boris Am Fr., 13. Aug. 2021 um 08:44 Uhr schrieb Janne Johansson < icepic.dz@xxxxxxxxx>: > Den tors 12 aug. 2021 kl 17:04 skrev Boris Behrens <bb@xxxxxxxxx>: > > Hi everybody, > > we just stumbled over a problem where the rbd image does not shrink, when > > files are removed. > > This only happenes when the rbd image is partitioned. > > > > * We tested it with centos8/ubuntu20.04 with ext4 and a gpt partition > table > > (/boot and /) > > * the kvm device is virtio-scsi-pci with krbd > > * Mount option discard is set > > * command to create large file: dd if=/dev/zero of=testfile bs=64M > > count=1000 > > * the image grows in the size we expect > > * when we remove the testfile the rbd image stays at the size > > * we wen recreate the deleted file with the command the rbd image grows > > further > > Just a small nit on this single point, regardless of if trim/discard > works or not: > There is no guarantee that writing a file, removing it and then > re-writing a file > will ever end up in the same spot again. In fact, most modern filesystems > will > probably make sure to NOT place things at the same spot again. > Since the second write ends up in a different place, it will once again > expand > your sparse/thin image by the amount of written bytes, this is very much > to be expected. > > I'm sorry if you already knew this and I am just stating the obvious to > you, but > your text came over as if you expected the second write to not increase the > image since that "space" was already blown up on the first write. > > Trim/discard should still be investigated so you can make it shrink back > again somehow, just wanted to point this out for the records. > > > -- > May the most significant bit of your life be positive. > -- Die Selbsthilfegruppe "UTF-8-Probleme" trifft sich diesmal abweichend im groüen Saal. _______________________________________________ ceph-users mailing list -- ceph-users@xxxxxxx To unsubscribe send an email to ceph-users-leave@xxxxxxx