fstrim doesn't reclaim space even with discard enabled

Thatoo

Member
Jun 11, 2021
53
0
11
38
Hello,
I face difficulty to reclaim space.
Here is the config I have for disks
1725038648773.png

Here is command I did
Code:
aaa@xxxx:~$ df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
udev               5,9G       0  5,9G   0% /dev
tmpfs              1,2G    960K  1,2G   1% /run
/dev/sda6          457G    210G  224G  49% /
tmpfs              5,9G     16K  5,9G   1% /dev/shm
tmpfs              5,0M       0  5,0M   0% /run/lock
/dev/sdb1          344G    164G  163G  51% /media/stockage
/dev/sda1          230M    183M   31M  86% /boot
tmpfs              1,2G       0  1,2G   0% /run/user/72054
aaa@xxxx:~$ sudo fstrim -av
/boot : 46,8 MiB (49092608 octets) réduits sur /dev/sda1
/media/stockage : 180,2 GiB (193461346304 octets) réduits sur /dev/sdb1
/ : 246,7 GiB (264887894016 octets) réduits sur /dev/sda6
aaa@xxxx:~$

and here is the result I keep having whereas I was expecting to have 842.64-180.2-246.7 = 415.74 GB

1725038833512.png

What am I doing wrong? How can I reclaim space?
Inside the Debian VM, the filesystem is ext4.
 
If I `fstrim -av` again, then I get

Code:
sudo fstrim -av
/boot : 0 B (0 octets) réduits sur /dev/sda1
/media/stockage : 0 B (0 octets) réduits sur /dev/sdb1
/ : 448,6 MiB (470351872 octets) réduits sur /dev/sda6

but if I reboot the VM and I `fstrim -av` again then I get like the first time, 180 Gb on /dev/sdb1 and 246 Gb on /dv/sda6 and still nothing happen on the LVM-Thin.
 
but if I reboot the VM and I `fstrim -av` again then I get like the first time, 180 Gb on /dev/sdb1 and 246 Gb on /dv/sda6 and still nothing happen on the LVM-Thin.
After the first time, no more deleted data can be discarded. Maybe there was no (or not much) deleted data to begin with in this VM?
Maybe the deleted data that is still taking up space is in other VMs?
 
There is only one VM.
If I reboot it, then I get again
Code:
aaa@xxxx:~$ sudo fstrim -av
/boot : 46,8 MiB (49092608 octets) réduits sur /dev/sda1
/media/stockage : 180,2 GiB (193461346304 octets) réduits sur /dev/sdb1
/ : 246,7 GiB (264887894016 octets) réduits sur /dev/sda6
as if deleted data had not been discarded with the previous `sudo fstrim -av` before the reboot.
 
DOes discard and trim work only with data deleted after activation of "discard" option?
 
If I reboot it, then I get again
Code:
aaa@xxxx:~$ sudo fstrim -av
/boot : 46,8 MiB (49092608 octets) réduits sur /dev/sda1
/media/stockage : 180,2 GiB (193461346304 octets) réduits sur /dev/sdb1
/ : 246,7 GiB (264887894016 octets) réduits sur /dev/sda6
as if deleted data had not been discarded with the previous `sudo fstrim -av` before the reboot.
It always looks like that. It tells the underlying storage that everything that is free is free. It only remembers until a reboot.
DOes discard and trim work only with data deleted after activation of "discard" option?
No, it just tells the underlying storage with blocks are unused (and can be discarded in the actual storage).
There is only one VM.
Does your VM have snapshots? Discard cannot delete data that is kept by the snapshots.
Can you check the LVM-Thin for any other data that might be on there?
 
  • Like
Reactions: Thatoo
Does your VM have snapshots? Discard cannot delete data that is kept by the snapshots.
Thank you!!!!!
That was the issue. I didn't know that and I had a snapshot. After deleting the snapshot, space has been directly reclaimed.
Awesome!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!