How discard generally work:
consider a logical volume (lv) of a thin pool.
Once created a lv, the allocated spaced is 0.
I create a filesystem on in (i.e. ext4), add some data till it allocates 5G.
I remove 2G of files but the allocated space is still 5G.
By fstrim, it will de-allocate/discard the 2G so only 3G will be allocated.
I the example above, the filesystem (ext4) is stored directly on the lv, without another partition table as it happens if the lv is used as virtual disk for qemu/proxmox.
My first question is, does discard work also in this case?
Or shall I use discard only on lv with no partition table?
My second question is: when will data be discard by proxmox? At guest shutdown/restart?
Third question: do all thin provisioning storage (lvm, zfs, qcow2) work the same way?
Thank you.
consider a logical volume (lv) of a thin pool.
Once created a lv, the allocated spaced is 0.
I create a filesystem on in (i.e. ext4), add some data till it allocates 5G.
I remove 2G of files but the allocated space is still 5G.
By fstrim, it will de-allocate/discard the 2G so only 3G will be allocated.
I the example above, the filesystem (ext4) is stored directly on the lv, without another partition table as it happens if the lv is used as virtual disk for qemu/proxmox.
My first question is, does discard work also in this case?
Or shall I use discard only on lv with no partition table?
My second question is: when will data be discard by proxmox? At guest shutdown/restart?
Third question: do all thin provisioning storage (lvm, zfs, qcow2) work the same way?
Thank you.