I created an opnsense 24.1 guest. Backed up, this vm uses 1.2GB.
I upgraded the guest to opnsense 24.7. The backup now occupies 2.84GB.
I'd enabled the discard option on the vm. But it seems the opnsense installer, unable to determione the disk type, did not enable trim:
I then booted the guest to single user mode and enabled trim:
My understanding is this enables trim for deletions going forward. But it will not trim previously deleted, now free, blocks (of which there are alot following the upgrade). And sure enough, the size of subsequent backups remains unchanged, at around 2.84GB.
How to issue a full/manual trim of the filesystem? Running
I upgraded the guest to opnsense 24.7. The backup now occupies 2.84GB.
I'd enabled the discard option on the vm. But it seems the opnsense installer, unable to determione the disk type, did not enable trim:
Bash:
~ # camcontrol identify da0
camcontrol: ATA ATA_IDENTIFY via pass_16 failed
camcontrol: ATA ATAPI_IDENTIFY via pass_16 failed
~ # tunefs -p /
...
tunefs: trim: (-t) disabled
...
I then booted the guest to single user mode and enabled trim:
Bash:
~ # fsck -y
~ # tunefs -t enable /
~ # tunefs -p /
...
tunefs: trim: (-t) enabled
...
My understanding is this enables trim for deletions going forward. But it will not trim previously deleted, now free, blocks (of which there are alot following the upgrade). And sure enough, the size of subsequent backups remains unchanged, at around 2.84GB.
How to issue a full/manual trim of the filesystem? Running
fsck_ffs -E /
in the guest does not seem to have had any effect on the size of new backups.