Less than one year ago, I have enabled --discard for all guest storages, last week, I have seen in logs that one guest fails on it's weekly "fstrim /".
1h ago, in guest:
Code: Select all
# fstrim -a -v
Code: Select all
# systemctl status virtualbox-leon-05.service
# VBoxManage storageattach Leon-05 --storagectl "SATA" --port 0 --discard on --nonrotational on
# systemctl start virtualbox-leon-05.service
Code: Select all
# hdparm -I /dev/sda | grep TRIM
* Data Set Management TRIM supported (limit unknown)
1: for which reason could one guest loose DISCARD, and not other guests ?
2: is there a way to check the status of this flag perdiocally ? Goes the guest need to be off for this check, or can I perform this check live (from the host) ?
This feature is critial on long term. It helps me keeping my guest images small, and allows over-allocation of host storage (12 guests can have a 160G disk each on a 256G host; weekly trim allows to shrink VDI files when possible. Overall, my host usually stays around 80% free; but all guests can use huge space when needed). In the end, keeping my host always with more than 50% free spaces increases the SSD lifetime. For example, after running fstrim on this guest, my host gained 4G free space. I encourage all VB users to study this feature; it's really VERY usefull.