TransWikia.com

How to clean up my /boot partition?

Raspberry Pi Asked on November 5, 2021

My /boot partition on my Raspberry model 3b is running low storage. I want to prevent running into feature troubles. I cant find any solution that fits my situation. Note that I’m pretty much a noob on a raspberry.

output of df -h

pi@raspberrypi:/boot $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        30G  6.8G   22G  25% /
devtmpfs        431M     0  431M   0% /dev
tmpfs           464M     0  464M   0% /dev/shm
tmpfs           464M   48M  417M  11% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           464M     0  464M   0% /sys/fs/cgroup
/dev/sda1        15G  2.3G   13G  16% /media/usb-drive
/dev/mmcblk0p1   60M   55M  5.4M  92% /boot
tmpfs            93M     0   93M   0% /run/user/1000

Output of ls -la /boot

pi@raspberrypi:/boot $ ls -la /boot
total 54164
drwxr-xr-x  4 root root    16384 Jan  1  1970  .
drwxr-xr-x 22 root root     4096 Apr  1 12:27  ..
-rwxr-xr-x  1 root root    25033 Jul 21 01:02  bcm2708-rpi-b.dtb
-rwxr-xr-x  1 root root    25296 Jul 21 01:02  bcm2708-rpi-b-plus.dtb
-rwxr-xr-x  1 root root    24644 Jul 21 01:02  bcm2708-rpi-b-rev1.dtb
-rwxr-xr-x  1 root root    24766 Jul 21 01:02  bcm2708-rpi-cm.dtb
-rwxr-xr-x  1 root root    24738 Jul 21 01:02  bcm2708-rpi-zero.dtb
-rwxr-xr-x  1 root root    25931 Jul 21 01:02  bcm2708-rpi-zero-w.dtb
-rwxr-xr-x  1 root root    26299 Jul 21 01:02  bcm2709-rpi-2-b.dtb
-rwxr-xr-x  1 root root    26448 Jul 21 01:02  bcm2710-rpi-2-b.dtb
-rwxr-xr-x  1 root root    27946 Jul 21 01:02  bcm2710-rpi-3-b.dtb
-rwxr-xr-x  1 root root    28565 Jul 21 01:02  bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x  1 root root    26255 Jul 21 01:02  bcm2710-rpi-cm3.dtb
-rwxr-xr-x  1 root root    47437 Jul 21 01:02  bcm2711-rpi-4-b.dtb
-rwxr-xr-x  1 root root    47542 Jul 21 01:02  bcm2711-rpi-cm4.dtb
-rwxr-xr-x  1 root root    52480 Jul 21 01:03  bootcode.bin
-rwxr-xr-x  1 root root      136 Apr  1 12:36  cmdline.txt
-rwxr-xr-x  1 root root     1630 Oct 26  2017  config.txt
-rwxr-xr-x  1 root root    18693 Jul 21 01:02  COPYING.linux
-rwxr-xr-x  1 root root     3148 Jul 21 01:03  fixup4cd.dat
-rwxr-xr-x  1 root root     5407 Jul 21 01:03  fixup4.dat
-rwxr-xr-x  1 root root     8414 Jul 21 01:03  fixup4db.dat
-rwxr-xr-x  1 root root     8418 Jul 21 01:03  fixup4x.dat
-rwxr-xr-x  1 root root     3148 Jul 21 01:03  fixup_cd.dat
-rwxr-xr-x  1 root root     7274 Jul 21 01:03  fixup.dat
-rwxr-xr-x  1 root root    10266 Jul 21 01:03  fixup_db.dat
-rwxr-xr-x  1 root root    10266 Jul 21 01:03  fixup_x.dat
-rwxr-xr-x  1 root root      103 Feb 26  2016  issue.txt
-rwxr-xr-x  1 root root  5599624 Jul 21 01:02  kernel7.img
-rwxr-xr-x  1 root root  5997544 Jul 21 01:02  kernel7l.img
-rwxr-xr-x  1 root root 15483392 Jul 21 01:02  kernel8.img
-rwxr-xr-x  1 root root  5247472 Jul 21 01:02  kernel.img
-rwxr-xr-x  1 root root     1594 Jul 21 01:03  LICENCE.broadcom
-rwxr-xr-x  1 root root    18974 Feb 26  2016  LICENSE.oracle
drwxr-xr-x  2 root root    24576 Jul 21 01:03  overlays
-rwxr-xr-x  1 root root   819100 Jul 21 01:03  start4cd.elf
-rwxr-xr-x  1 root root  3778856 Jul 21 01:03  start4db.elf
-rwxr-xr-x  1 root root  2277376 Jul 21 01:03  start4.elf
-rwxr-xr-x  1 root root  3036168 Jul 21 01:03  start4x.elf
-rwxr-xr-x  1 root root   819100 Jul 21 01:03  start_cd.elf
-rwxr-xr-x  1 root root  4850760 Jul 21 01:03  start_db.elf
-rwxr-xr-x  1 root root  3001440 Jul 21 01:03  start.elf
-rwxr-xr-x  1 root root  3759720 Jul 21 01:03  start_x.elf
drwxr-xr-x  2 root root     8192 Jan 20  2018 'System Volume Information'

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

    pi@raspberrypi:/boot $ dpkg --list 'linux-image*'
    Desired=Unknown/Install/Remove/Purge/Hold
    | 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)

Output of sudo apt-get autoremove

pi@raspberrypi:/boot $ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Output of cat /etc/*-release

pi@raspberrypi:/boot $ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Did I do something wrong and what can I do to prevent a full /boot partition?
Thanks in advance!

3 Answers

You obviously ignored the Foundation advice to perform a fresh install.

It is futile "cleaning" the boot partition because every time you try to upgrade the firmware the files will be restored.

Your only option is to adjust the partition sizes (which can't be done on the Pi).

You will need a Linux computer.

There are numerous other hidden problems with attempting version upgrades (which is why the Foundation does not attempt to support it). You would be better to perform a fresh install.

If you do decide to stick with the existing image you could use the procedure I use to create a Backup image of SD Card.
This creates an installable image with the correct partition sizes for Buster and it can be done on the Pi (with external storage for the image).

Answered by Milliways on November 5, 2021

Burried in the Buster release notes for the version 2019-06-20 is a small entry that states:

Boot partition size set to 256M

This is to allow for larger software upgrades (shades of Windows 10) and more software (e.g. Pi 4 firmware) to be shipped as defaults on the FAT32 portion of the SD card.

If you do not want to reload your card from scratch then I would look to use gparted to resize the partitions on this card. You will need a Pi or a Linux box running a GUI and a micro SD to USB adapter

  1. Make a backup of this card
  2. Build a new Pi using one of the GUI enabled versions
  3. Bring it up to date with sudo apt update && sudo apt full-install && sudo apt autoremove && sudo reboot
  4. Install gparted with sudo apt update && sudo apt install gparted
  5. Install the copy of the SD card in the Pi
  6. Use gparted in the GUI to resize partitions so the FAT32 partition has 256M as a min
  7. Try it in the Pi

Note: This is not possible to do on a Mac with Catalina and Paragon extFS support - Disk Utility does not allow resizing of the partitions.

Answered by user115418 on November 5, 2021

The ideal way to do this is to expand the filesystem, which requires moving the second partition.

However, if you don't want to bother with that, a lot of the space is taken up by the biggest files, which are the kernels and start_elfs. If this card is only used in one Pi, you don't need all of those. If it is a single core model, you only need kernel.img, not the 7 or 8; if it is a Pi 2 or 3, you need kernel7.img (I notice there's also a kernel7l.img in the current version). It it's a Pi 4, you only need kernel8.img.

Likewise, there are two sets of start_elf files, one for the Pi 4 and one for everything else. All told you can probably delete 15-20 MB worth of space.

Note that they may get replaced by the distro when the kernel is upgraded.

Answered by goldilocks on November 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP