0

I am running out of space on the disk '/boot'. When trying to use the software updater, a message appears suggesting to remove old kernels using sudo apt autoremove, and to set COMPRESS=xz in initramfs.conf. Similarly to this question, sudo apt autoremove did not make a difference. Then, I tried with the second alternative. However, after setting COMPRESS=xz, I need to rebuild the initramfs.conf image. For this I use sudo update-initramfs -u -k all (as suggested in the answer of the above post/question), but it does not work due to lack of space. The output is the folllowing:

I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgubuntu-swap_1)
I: Set the RESUME variable to override this.
xz: (stdout): Write error: No space left on device
E: mkinitramfs failure xz --check=crc32 --threads=0 1
update-initramfs: failed for /boot/initrd.img-5.15.0-67-generic with 1.
Miguel
  • 1
  • You should probably reconfigure your device to have plenty of space in the /boot partition. – Artur Meinild Mar 20 '23 at 11:14
  • How can I reconfigure the device to have more space in the \boot partition?? – Miguel Mar 20 '23 at 11:17
  • Does this answer your question? How to resize partitions? – Artur Meinild Mar 20 '23 at 11:20
  • The obvious answer to "what do I do when I'm out of space" is "delete something". Autoremove sometimes helps. apt purge sometimes helps, but probably neither of those if /boot is separate. Maybe look and see if there are files in /boot that belong to kernels that are not "installed" that should have been deleted. Or (carefully!!) delete the oldest one that isn't in use... Ultimately, you probably need to resize the partition. – user10489 Mar 20 '23 at 11:25
  • @ArturMeinild Yes, I can try to do that. Thank you! – Miguel Mar 20 '23 at 11:25
  • Good luck...and careful what you delete or you might leave the system unbootable. – user10489 Mar 20 '23 at 11:26
  • 1
    @user10489 I see that there is an old image /boot/initrd.img-5.14.0-1055-oem that I think is not in use, since when I run uname -a, the output is a more recent image 5.14.0-1057-oem. Does this mean that I can safely delete the 5.14.0-1055-oem image? Or do I need to check something else before? – Miguel Mar 20 '23 at 11:30
  • 2
    Another possible duplicate: https://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot – Artur Meinild Mar 20 '23 at 11:32
  • Artur's suggested answer looks like it has good answers for this at a glance. If the kernel you found is older than the current one, it's probably ok to remove. I'd remove one or two large files and then use dpkg -l | grep followed by apt remove to clean up the rest. – user10489 Mar 20 '23 at 22:14
  • I followed the instructions to delete only the unused packages. I checked several times, and made sure I was not doing any mistake. Indeed, I checked based on the answer given in the post shared by @ArturMeinild, but I also checked on other webpages, blogs and other similar questions. When I was sure, I removed the old kernels, and PC never rebooted again :/ The problem seems to be related to having removed the image linux-image-x.x.x-x-generic. I made sure I removed the one that had a version number, not the Generic Linux kernel image (hwe-20.04) – Miguel Mar 29 '23 at 13:30
  • The ones with no version are symbolic links pointing to a file with actual content. All those files with actual content have a version number, and it is necessary to keep/preserve/retain the one with version number matching uname -r. Regarding the machine not booting because all kernel images were removed, I'd try booting to rescue mode from grub boot menu, and in rescue mode attempt to install a kernel. – Randall Whitman Sep 01 '23 at 16:29

0 Answers0