No room on /boot for updates

Have you tried running:

sudo apt autoremove

?

1 Like

My question was what file(s) – specifically kernel images no longer in use – could I safely remove. Unless Bleachbit has that knowledge, it won’t be useful. I doubt that it arbitrarily decides that kernel images are unimportant.

Another responder asked whether I had run “sudo apt autoremove” – yes, and to no effect.

But I managed to find a way to get past the original problem of having insufficient space in /boot to support system updates.

I did a work-around as follows. The kernel-image files themselves are used only at boot time: the image is loaded into RAM and executed. While it is running, the file itself will no longer be used, until the next boot. So it should be safe to move one of the images temporarily, perform the update, and restore the image to /boot. I inspected config.txt to see if a named image file was being invoked at boot; the kernel-image description was commented out. That means the system uses the default “kernel.img” at boot. I moved “kernel7.img” to /tmp, which provided enough space in /boot to allow updates to be done. After successful update, I returned “kernel7.img” to /boot. No problems since.

A longer-term solution would be to take the SD card out, put it into a USB reader attached to another system, and use gparted to enlarge the /boot partition. (I would have to first reduce the size of the other partition [root], and then assign the freed-up space to the /boot partition.)

Seems rather drastic just to do a simple maintenance task of removing defunct kernel images.

I also found in /lib/modules some evidence of six kernel images having been on the machine at one point or other. Makes me wonder if rpi-update is automagically doing some of the kernel-image maintenance for me – like keeping just the last two kernel images in /boot. That would, of course, be useful; but a little documentation to that effect would go a long way. And it still doesn’t solve the problem of having the distro set up a /boot partition that soon ends up being too small to accommodate ordinary maintenance.

Thanks to all for their assistance.

2 Likes

Ubuntu Cleaner might be more useful for cleaning old kernels?:

Thanks for the suggestion. My hunch is that Ubuntu Cleaner is aimed at platforms other than the Raspberry Pi, which currently has idiosyncratic procedures for kernel updating. Ubuntu Cleaner probably does the “linux-image” tricks that work everywhere else and not on the Pi.

My kingdom for some Pi-specific documentation on kernel-maintenance tool behaviors. All I have so far is “only use rpi-update” in the welcome window. I just get the sound of crickets when I try “man rpi-update”.

1 Like

Perhaps this link may be of some assistance -

Did you copy the right link? I ask because I see nothing kernel related :confused:

It was meant to be another site to post questions concerning the raspberry pi, not specific to the lack of /boot space.

@ptdyma - I don’t see anything redundant in that original listing, but you haven’t shown the space use/left in /boot (df -h): I have 45M free of the filesystem 60M.
Perhaps there is something which would show if you used ls -al /boot to show all the files.
Also, there might be something in the /boot/overlays/ files

I too have this problem. uname -r gives 4.4.19-v7 as the answer. I currently have no way to fix this and provide enough space for the update. Help would be appreciated

What were the results of dandnsmith suggestions?

Not sure what works with ARM, but on a standard install:

sudo apt autoremove --purge

Just thought of something else that could list the installed kernels.

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"`

@pdtyma, I recently installed Ubuntu BSP kernel on a Pine A64 board (2GB). This board has a similar ARM CPU to the Pi. An image was created by a contributor to the Pine64 forum called Longsleep. This is based on the BSP kernel. After resizing the filing system and running a script to install the Mate desktop, I tried to run Software Updater from the System/Administration menu. I got the same message about freeing space on /boot.

This thread, which I started on forum.pine64.org asked about this problem. There were no previous kernels installed. This was fresh install. The answer given by the forum member MarkHaysHarris777 solved my problem. This may work for the Pi as well. See forum thread: http://forum.pine64.org/showthread.php?tid=3202

Let us know here if this works as I have a number of Pi boards.

1 Like

The software updater install error message says that the upgrade requires 48.2M free space on /boot. There is 45M available on /boot. How can an upgrade take up more than twice the space of the installed system?
frank@RaspPi:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 30G 14G 16G 47% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 35M 429M 8% /dev/shm
tmpfs 463M 6.8M 457M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p1 64M 20M 45M 32% /boot
tmpfs 93M 40K 93M 1% /run/user/1000
frank@RaspPi:~$
The error message asks to free up space, but is this the real problem? Only 6.9M is being downloaded!

Try ‘sudo apt update && sudo apt upgrade’, then ‘sudo rpi-update’ (without quotes) and reboot.

I have a similar problem with the software updater, but using the command line works for me. You could also try resizing the /boot partition (and shrinking /root) using gparted on a linux machine.

1 Like

I, too, have a lot of free space on /boot – at least 45 MB. The problem is that the “SoftwareUpdater” program says it needs at least 3 MB more.

Thank you for your suggestion. After browsing the site you cite, I find two things:

  1. There is another, potentially simpler, work-around: if I enter “sudo apt update && sudo apt upgrade” in a terminal window, the updating proceeds without a problem. There is no complaint of insufficient space. I have done this now several times without a hitch.

  2. There are many reports of systems becoming unusable after a kernel update. This is potentially a serious problem. Because the procedures for kernel updates for Raspberry Pi are very different from what is done with other Ubuntu installations (and poorly documented), the usual things one does on an Intel-based Ubuntu are not available. There is no grub2 to allow you to choose which kernel to boot (after, say, a problembatic kernel update); and there is no knowledge base I can find that offers maintenence tricks, such as using Synaptic to remove linux-image and linux-header packages that constitute kernels that are no longer needed.

I tried the autoremove you suggest – it made no difference in the behavior of SoftwareUpdater.

Your suggestion about listing the installed kernels works great everywhere except on the Raspberry Pi, which is where I encountered the problem.

It doesn’t help that all Raspberry Pi kernels are named “kernel.img” – and I’m unaware of a tool that can be used to tell me what version it is. Invoking “file /boot/kernel.img” just tells me that it is a kernel image for ARM, but offers no information about version number.

I thank all the responders for their suggestions.

Here’s where I come out on all of this.

  1. There appears to be a bug in SoftwareUpdater that on some Raspberry Pi systems makes it need (or think it needs) more free space in /boot than a “sudo apt update && sudo apt upgrade” requires to do the actual update itself. Work-arounds, such as using the shell or temporarily moving a kernel-image file out of /boot, are capable of getting the job done.

  2. There is a need for documentation about how to do kernel maintenance on Raspberry Pi systems. What files constitute a kernel release? How can a particular kernel be chosen at boot time? What files are overlaid when the kernel is updated? How can the version number of a “kernel.img” be identified?

If there’s anybody out there on the development team who can share this knowledge, I’d be happy to volunteer my time to write, edit, or proof-read a kernel-maintenance document for the Raspberry Pi. Until then, I’ll have to temper my enthusiasm for installing the security protections of new kernel releases with the knowledge that a failed update may require starting my installation from scratch again.

1 Like

I am intrigued what you actually ran (the EXACT command) [quote=“pdtyma, post:1, topic:11336”]
Software Updater
[/quote]

The PI /boot structure is quite different from normal Linux, and AFAIK it is NOT POSSIBLE to update the firmware using the normal dist-upgrade, or at least if you try it will destroy the image. (I last tried this on 15.04.)

The “recommended” method of updating firmware is rpi-update, although this is not without its problems.

On the other hand a normal update and upgrade should not touch the boot sector. (Unless there has been some change since 16.04.

To answer you question kernel.img is not needed (this is for ARM6). You can remove any .dtb for models you don’t have e.g bcm2708-rpi-b-plus.dtb, the B+ wouldn’t run Ubuntu anyway. These are generally small files, so make little impact.

You could remove start_x.elf if you don’t use the camera module.

Incidentally all the recommendations and comments about running clean are futile, as none of the files are on /boot.

1 Like

Two issues are being confused here: one is software updates and the other is kernel updates.

Software updating is achieved by ‘sudo apt update && sudo apt upgrade’ for software installed on /ROOT. This does not update the kernel or the /BOOT partition files.

Kernels (modules and firmware) are updated with ‘sudo rpi-update’. After a new kernel is installed and your PI has been rebooted, old kernels and their modules can be removed.

‘uname -a’ will tell you the name of the running kernel, something like ‘Linux RPI-3 4.4.47-v7+ #961 SMP Sun Feb 5 20:17:00 GMT 2017 armv7l armv7l armv7l GNU/Linux’

You can safely go to /lib/modules and remove earlier versions (4.4.46*, for example). This will require root permission.

None of this will prevent Software Updater from complaining, but your system will have up-to-date software and kernel.

If you have a spare SD card, you can use Ubuntu’s disk utility installed on a regular laptop to image the card as backup.

2 Likes