-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Enable trimming QEMU disks #1102
Conversation
* Resolves #356 * Add 'discard=on' argument to '-drive' flag for basedisk and diffdisk, so that running `fstrim` in the guest would reduce the size of QEMU virtual disks. Signed-off-by: Chris Xiao <30990835+chrisx8@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I'm so happy this actually works! 😄
FYI: Alpine doesn't have |
Does |
Looks like Lima only uses either basedisk or diffdisk, so I'd say yes. |
We never write to |
Lines 435 to 439 in 020d7ee
This code snippet suggests that only one of There shouldn't be any performance impact during normal use. However, |
Ah yes, the only time we use the |
This would enable trimming of QEMU virtual disks, by adding the
discard=on
argument to-drive
flag forbasedisk
ordiffdisk
. As a result, runningfstrim -a
in the guest would reduce the disk space consumed by QEMU disks (basedisk
ordiffdisk
), and reduce the disk usage of Lima guests.Current behavior: there's no easy way to reduce the disk usage of
diffdisk
, and runningfstrim -a
in the guest has no effect.Resolves #356