Re: Discard / Trim does not shrink rbd image size when disk is partitioned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux