Skip to content

[vioscsi] - Windows 10 "Optimize drive"/Trim/Discard causes all data to be rewritten #666

@milsav92

Description

@milsav92

I'm using the virtio-win-0.1.208.iso version of vioscsi on Windows 10 x64 21H1 in a libvirt+KVM+QEMU combo.

Running the trim command causes a high cpu load, runs for an absurd time (bare metal installation runs for ~5 sec vs 10-15 min for the vioscsi version) and it causes all the data to be rewritten again instead of just trimming the drive (can be seen in iotop, iostat and in S.M.A.R.T. Lifetime writes) which is less than ideal for a ssd.
Linux guests do not suffer from this problem.

Passing the device.scsi0-0-0-0.rotation_rate=1 aka. SSD emulation argument to QEMU doesn't have an impact.

A similar problem can be seen here https://forum.level1techs.com/t/win10-optimize-drives-makes-underlying-sparse-storage-grow-not-shrink/172803

Is this perhaps a Windows defrag.exe issue?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions