Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support shrinking the disk image #3030

Open
AkihiroSuda opened this issue Dec 18, 2024 · 1 comment
Open

Support shrinking the disk image #3030

AkihiroSuda opened this issue Dec 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Dec 18, 2024

virt-sparsify should be used under the hood: https://libguestfs.org/virt-sparsify.1.html

Virt-sparsify can locate and sparsify free space in most filesystems (eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes.

Virt-sparsify can also convert between some disk formats, for example converting a raw disk image to a thin-provisioned qcow2 image.

This tool is not available on Homebrew yet.

Integrating it to Lima is likely to depend on:

@jandubois
Copy link
Member

Isn't running fstrim inside the instance doing the same thing?

I know that at least inside Alpine I can delete lots of stuff in the diffdisk, run fstrim, and du diffdisk will report that the space is no longer being used.

For that reason Rancher Desktop runs fstrim on each start/shutdown of the instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants