pop-os / default-settings

Distribution Default Settings
Other
44 stars 16 forks source link

Change initramfs compression mode from `zstd` to `xz` to save space on ESP #168

Closed leviport closed 3 months ago

leviport commented 1 year ago

Older installs that still have a 512mb (which includes all HP Dev Ones) ESP are getting "low space" warnings. Resizing the ESP on existing installs cannot be done automatically, and if the installation is encrypted, doing it manually is a pain.

A quick way to free up a little space is to change initramfs compression to xz. This can be done manually by changing COMPRESS=zstd to COMPRESS=xz in /etc/initramfs-tools/initramfs.conf and regenerating initramfs (sudo update-initramfs -c -k all). I propose we make this the default automatically.

We may need to take more drastic steps later, but this seems like a good quick improvement.

peelos commented 11 months ago

Thanks, this helped me gain crucially enough space to allow firmware updates.. with no noticeable difference in boot speed

JonnesBezerra commented 8 months ago

Wow, I changed it and it works. Now the laptop is updated! Thank you

gabriele2000 commented 3 months ago

Why not zstd --ultra -22?

I feel that changing it to xz would mean "going backwards" since zstd is more advanced and faster. The improved size compared to xz is trivial at level 22, you may gain 1% or 2% of the total size.

with no noticeable difference in boot speed

I feel like you aren't thinking about the fact that generating an initramfs image takes more time than updating something like 100 packages on a fast SSD. It's a bottleneck.

A good solution would be to make the user choose the level of the ZSTD compression (with level 10 as default)

leviport commented 3 months ago

The user is free to set whatever option they want in /etc/initramfs-tools/initramfs.conf

We've freed up space elsewhere, so I don't think this issue is valid any longer.

kenricashe commented 2 months ago

The user is free to set whatever option they want

Okay but which option is ideal?