I haven't run apt upgrade on my Pi 3 in a while and did it today. It resulted in an error message with my /boot partition being filled to 100%. Any subsequent apt commands are resulting in errors because the /boot partition is full (apt-get autoremove is a common suggestion, but that won't work).

I've seen on other sites suggestions to check what kernels are installed using a variant of sudo dpkg --list 'linux-image*', but when I run this I get no results (it appears no kernels are installed anymore).

Here is the output from ls -la for my /boot partition:

pi@raspberry ~ % ls -la /boot
total 41056
drwxr-xr-x  4 root root     2560 Sep 15 23:10 .
drwxr-xr-x 25 root root     4096 Jun 10  2017 ..
-rwxr-xr-x  1 root root    15660 Sep 15 23:05 bcm2708-rpi-0-w.dtb
-rwxr-xr-x  1 root root    15197 Sep 15 23:05 bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root    15456 Sep 15 23:05 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root    14916 Sep 15 23:05 bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root    16523 Sep 15 23:05 bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root    17624 Sep 15 23:05 bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root    16380 Sep 15 23:05 bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root    50248 Sep 15 23:05 bootcode.bin
-rwxr-xr-x  1 root root      187 Dec 31  1979 cmdline.txt
-rwxr-xr-x  1 root root     1662 May 31  2017 config.txt
-rwxr-xr-x  1 root root    18693 Sep 15 23:05 COPYING.linux
-rwxr-xr-x  1 root root       41 May 31  2017 .firmware_revision
-rwxr-xr-x  1 root root     2583 Sep 15 23:04 fixup_cd.dat
-rwxr-xr-x  1 root root     6674 Sep 15 23:04 fixup.dat
-rwxr-xr-x  1 root root     9813 Sep 15 23:05 fixup_db.dat
-rwxr-xr-x  1 root root     9813 Sep 15 23:05 fixup_x.dat
-rwxr-xr-x  1 root root 10201980 May 31  2017 initrd.img-4.9.30-v7+
-rwxr-xr-x  1 root root 10174464 Sep 15 23:10 initrd.img-4.9.30-v7+.dpkg-bak
-rwxr-xr-x  1 root root      145 Apr 10  2017 issue.txt
-rwxr-xr-x  1 root root  4579248 Sep 15 23:05 kernel7.img
-rwxr-xr-x  1 root root  4379032 Sep 15 23:05 kernel.img
-rwxr-xr-x  1 root root     1494 Sep 15 23:05 LICENCE.broadcom
-rwxr-xr-x  1 root root    18974 Apr 10  2017 LICENSE.oracle
drwxr-xr-x  2 root root    10240 Sep 15 23:05 overlays
-rwxr-xr-x  1 root root   659492 Sep 15 23:04 start_cd.elf
-rwxr-xr-x  1 root root  4993604 Sep 15 23:04 start_db.elf
-rwxr-xr-x  1 root root  2855556 Sep 15 23:04 start.elf
-rwxr-xr-x  1 root root  3939492 Sep 15 23:04 start_x.elf
drwxr-xr-x  2 root root      512 May 30  2017 System Volume Information

output of df -h

pi@raspberry ~ % df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  4.0G   24G  15% /
devtmpfs        458M     0  458M   0% /dev
tmpfs           462M     0  462M   0% /dev/shm
tmpfs           462M  6.6M  456M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           462M     0  462M   0% /sys/fs/cgroup
/dev/mmcblk0p1   41M   41M  3.5K 100% /boot
/dev/sda1       116G  854M  114G   1% /usr/local/src
/dev/sda1       116G  854M  114G   1% /home
tmpfs            93M  4.0K   93M   1% /run/user/1000

Output of sudo apt-get autoremove:

pi@raspberry ~ % sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.120+deb8u3) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.120+deb8u3) ...
ln: failed to create hard link ‘/boot/initrd.img-4.9.30-v7+.dpkg-bak’ => ‘/boot/initrd.img-4.9.30-v7+’: Operation not permitted
cp: error writing ‘/boot/initrd.img-4.9.30-v7+.dpkg-bak’: No space left on device
cp: failed to extend ‘/boot/initrd.img-4.9.30-v7+.dpkg-bak’: No space left on device
dpkg: error processing package initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Output of dpkg --list 'linux-image*':

pi@raspberry ~ % dpkg --list 'linux-image*'                        
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                           Version                      Architecture                 Description
un  linux-image                                    <none>                       <none>                       (no description available)

What do I need to do to get this fixed and have apt upgrade succeed?

  • We don’t know what OS you were running or how you got the boot partition in such a mess. Whatever it was it is obviously very old and probably not worth trying to “fix”.
    – Milliways
    Sep 16, 2019 at 3:58
  • Linux raspberry 4.9.30-v7+ #1001 SMP Fri May 26 16:09:18 BST 2017 armv7l GNU/Linux As for what got it into such a "mess," it was simply as I stated above: apt-get upgrade Sep 16, 2019 at 4:10
  • That is NOT an OS - it is the kernel, and is quite old. Current Raspbian are at 4.19.66-v7+ lsb_release -irdc will show OS.
    – Milliways
    Sep 16, 2019 at 4:15

2 Answers 2


The main problem is that on your installation a Ramdisk is generated. These initrd.img occupy 20 MB from 30 MB of the space of the boot partition:

-rwxr-xr-x  1 root root 10201980 May 31  2017 initrd.img-4.9.30-v7+
-rwxr-xr-x  1 root root 10174464 Sep 15 23:10 initrd.img-4.9.30-v7+.dpkg-bak0

This will of course make your problems. But Raspbian does not support Init Ramdisks. To load it you must have an entry in /boot/config.txt like this:

initramfs initrd.img-4.9.30-v7+ followkernel

To use a Ramdisk with Raspbian you may have a look at How can I use an init ramdisk (initramfs) on boot up Raspberry Pi?.

So if you do not have an entry in your config.txt as shown above then generating the initrd.img-4.9.30-v7+ is wasting of space. Then just delete the two image files and deinstall initramfs-tools. Then you should be able to upgrade your operating system.


I finally folded and moved the largest files in /boot (*.img and *.elf) to a temporary directory. The install for initramfs-tools (which was the one that was failing) then succeeded. I moved those files back to /boot and all is ok...at least for now. /boot is showing 76% utilization though, so I am suspecting this issue will crop up again unless I go through the hassle of enlarging the /boot partition.

pi@raspberry ~/boot_backup % df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  4.1G   24G  15% /
devtmpfs        458M     0  458M   0% /dev
tmpfs           462M     0  462M   0% /dev/shm
tmpfs           462M  6.6M  456M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           462M     0  462M   0% /sys/fs/cgroup
/dev/mmcblk0p1   41M   31M  9.8M  76% /boot
/dev/sda1       116G  879M  114G   1% /usr/local/src
/dev/sda1       116G  879M  114G   1% /home
tmpfs            93M  4.0K   93M   1% /run/user/1000

I edited this thinking this fixed my problem, but it just fried my entire Raspbian installation. Luckily I have a Pi 4 I was planning to upgrade to, I guess I'll just be making the upgrade sooner than expected.

  • 1
    Raspbian does not use initramfs - and had a very small boot partition. This has been increased to 256MB in Buster. If you want to run initramfs you will need to increase the size, but you are probable better to move to Buster.
    – Milliways
    Sep 16, 2019 at 4:31
  • 1
    I wouldn't have installed initramfs on my own, but in any event it appears my "fix" actually hosed the installation. I have a Pi 4 I purchased so I'll just move over to that now then. Sep 16, 2019 at 5:01
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Feb 16, 2020 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.