0

I have a dedicated /boot partition. It's VERY small (86–94 MB, depending on whether you listen to df or fdisk). I would increase it (or get rid of it!) but this is a coloc server thousands of miles away, and booting from a livecd is expensive. I'm really hoping to limp along via ssh alone.

I'm trying to update from 20.04 to 22.04, but do-release-upgrade failed with:

The upgrade has aborted. The upgrade needs a total of 56.5 M free 
space on disk '/boot'. Please free at least an additional 17.2 M of 
disk space on '/boot'. You can remove old kernels using 'sudo apt 
autoremove' and you could also set COMPRESS=xz in 
/etc/initramfs-tools/initramfs.conf to reduce the size of your 
initramfs. 

Unlike these questions…

…I don't have old kernels in my /boot, and I have COMPRESS=xz and MODULES=dep set in /etc/initramfs-tools/initramfs.conf, and I've rebuilt the initramfs to try and minimize space. I'm just still too short.

So, I'm asking dumb questions:

  • Can I symlink files in /boot to another partition, permanently? (I may not be phrasing this correctly, but: can the GRUB bootloader handle symlinks to another partition? Is the other partition guaranteed to be mounted in time, or can a retry be mandated?)

    They'd be symlinked to another partition on the same physical SSD. Both /boot and the target partition are using ext4:

     $ lsblk -o NAME,FSTYPE,FSAVAIL,MOUNTPOINT /dev/sda
     NAME   FSTYPE FSAVAIL MOUNTPOINT
     sda                   
     ├─sda1 ext4     37.4M /boot
     ├─sda2 swap           [SWAP]
     └─sda3 ext4     24.2G /
    
  • If that's not valid, can I do something dangerous like symlink some files just while I'm running do-release-upgrade, and afterwards I'll have new kernel files that I can (hopefully, surely) rely on for a reboot?

I don't reboot this server more than 1–3 times per year. I don't care if it's slow to boot. I do need it to boot reliably, however.

Here's what /boot looks like right now. If there's a way to get more lean, I'm interested to know it.

$ uname -r
5.4.0-193-generic

$ sudo du -sh /boot/* 233K /boot/config-5.4.0-193-generic 6.7M /boot/grub 17M /boot/initrd.img-5.4.0-193-generic 12K /boot/lost+found 179K /boot/memtest86+.bin 181K /boot/memtest86+.elf 181K /boot/memtest86+_multiboot.bin 4.6M /boot/System.map-5.4.0-193-generic 14M /boot/vmlinuz-5.4.0-193-generic

$ df -h /boot Filesystem Size Used Avail Use% Mounted on /dev/sda1 86M 42M 38M 53% /boot

$ sudo sfdisk -l -s /dev/sda1 | awk '{print $1 / 1024 "MiB"}' # 1kiB blocks to MiB 94MiB

$ grub-install --version grub-install (GRUB) 2.04-1ubuntu26.17

Phrogz
  • 1,712

0 Answers0