Currently, the virtio specification does not include provision for the TRIM (aka DISCARD) command that allows a guest operating system to signal the disk hardware that blocks have become unused so that the underlying device may clear the physical data. The TRIM/DISCARD command was introduced for SSD disks as an extension to the AHCI specification that is used in SATA systems. With Virtual Machines we can use this command to tell QEMU's Qcow2 driver to reclaim unused space in the disk image. This ensures the disk image file is kept to the smallest size possible where without the TRIM/DISCARD command it grows to it's maximum configured size and never shrinks again when data is deleted. Let's swap our default disk driver from `virtio-blk-pci` which does not support TRIM to `ahci` which does. (We cannot use `virtio-scsi-pci` when running macOS, like we do in our default disk device, because macOS does not support SCSI disks at all on x86_64 systems.)pull/571/head
parent
fb8deb10e8
commit
881adb289a
Loading…
Reference in new issue