No space on /boot. Cannot purge

Creating a bug report/issue

Required Information

  • DietPi version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=9
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’

  • Distro version
    buster

  • Kernel version
    Linux DietPi 4.14.241+ #1 SMP PREEMPT Wed Jul 28 16:55:16 UTC 2021 armv7l GNU/Linux

  • Architecture
    armhf

  • SBC model
    Odroid XU3/XU4/MC1/HC1/HC2 (armv7l)

  • Power supply used
    12v car battery

  • SD card used
    Sandisk

Steps to reproduce

dietpi-update fails with an out of space message

Setting up linux-image-4.14.294+ (4.14.294-20220924-xu4) ...
update-initramfs: Generating /boot/initrd.img-4.14.294+
Image Name:   uInitrd
Created:      Tue May 23 20:47:07 2023
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    7540782 Bytes = 7364.04 KiB = 7.19 MiB
Load Address: 00000000
Entry Point:  00000000

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.14.294+ with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
mkimage: Can't open /boot/initrd.img-4.14.294+: No such file or directory
run-parts: /etc/kernel/postinst.d/uInitrd exited with return code 1
dpkg: error processing package linux-image-4.14.294+ (--configure):
 installed linux-image-4.14.294+ package post-installation script subprocess ret                                                                                                             urned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-4.14-armhf-odroid                                                                                                             -xu4:
 linux-image-4.14-armhf-odroid-xu4 depends on linux-image-4.14.294+; however:
  Package linux-image-4.14.294+ is not configured yet.

dpkg: error processing package linux-image-4.14-armhf-odroid-xu4 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for mime-support (3.62) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
ln: failed to create hard link '/boot/initrd.img-4.14.241+.dpkg-bak' => '/boot/i                                                                                                             nitrd.img-4.14.241+': Operation not permitted
cp: error writing '/boot/initrd.img-4.14.241+.dpkg-bak': No space left on device
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned                                                                                                              error exit status 1
Errors were encountered while processing:
 linux-image-4.14.294+
 linux-image-4.14-armhf-odroid-xu4
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here are the contents of /boot

root@DietPi:/boot# ls -Al /boot
total 65616
-rwxr-xr-x 1 root root    5482 Jul 20  2022  boot.ini
-rwxr-xr-x 1 root root  151341 Jul 28  2021  config-4.14.241+
-rwxr-xr-x 1 root root  151687 Sep 24  2022  config-4.14.294+
drwxr-xr-x 4 root root    4096 May 23 22:36  dietpi
-rwxr-xr-x 1 root root    6285 Sep 10  2018  dietpi-README.md
-rwxr-xr-x 1 root root   11432 Oct 22  2022  dietpi.txt
-rwxr-xr-x 1 root root   56387 Sep 24  2022  exynos5422-odroidhc1.dtb
-rwxr-xr-x 1 root root   63543 Sep 24  2022  exynos5422-odroidxu3.dtb
-rwxr-xr-x 1 root root   62488 Sep 24  2022  exynos5422-odroidxu3-lite.dtb
-rwxr-xr-x 1 root root   63518 Sep 24  2022  exynos5422-odroidxu4.dtb
-rwxr-xr-x 1 root root   63662 Sep 24  2022  exynos5422-odroidxu4-kvm.dtb
-rwxr-xr-x 1 root root 7540782 Jul 20  2022  initrd.img-4.14.241+
-rwxr-xr-x 1 root root 7549446 May 23 22:34  initrd.img-4.14.294+
-rwxr-xr-x 1 root root 2728720 Jul 28  2021  System.map-4.14.241+
-rwxr-xr-x 1 root root 2729863 Sep 24  2022  System.map-4.14.294+
drwxr-xr-x 2 root root    2048 Jan  1  2020 'System Volume Information'
-rwxr-xr-x 1 root root 7549510 May 23 22:43  uInitrd
-rwxr-xr-x 1 root root 7540846 May 23 22:43  uInitrd-4.14.241+
-rwxr-xr-x 1 root root 7549510 May 23 22:43  uInitrd-4.14.294+
-rwxr-xr-x 1 root root 6003440 Mar 31  2022  uInitrd-4.14.66+
-rwxr-xr-x 1 root root 5764120 Jul 28  2021  vmlinuz-4.14.241+
-rwxr-xr-x 1 root root 5782672 Sep 24  2022  vmlinuz-4.14.294+
-rwxr-xr-x 1 root root 5782672 May 23 22:43  zImage

After a bit of searching I tried
apt purge linux-image-4.14.66+

which produced this error

root@DietPi:/boot# apt purge linux-image-4.14.66+
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.14.66+*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-4.14.294+ (4.14.294-20220924-xu4) ...
update-initramfs: Generating /boot/initrd.img-4.14.294+
Image Name:   uInitrd
Created:      Tue May 23 22:43:00 2023
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    7540782 Bytes = 7364.04 KiB = 7.19 MiB
Load Address: 00000000
Entry Point:  00000000

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.14.294+ with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Image Name:   uInitrd
Created:      Tue May 23 22:43:03 2023
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    7549446 Bytes = 7372.51 KiB = 7.20 MiB
Load Address: 00000000
Entry Point:  00000000
dpkg: error processing package linux-image-4.14.294+ (--configure):
 installed linux-image-4.14.294+ package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-4.14-armhf-odroid-xu4:
 linux-image-4.14-armhf-odroid-xu4 depends on linux-image-4.14.294+; however:
  Package linux-image-4.14.294+ is not configured yet.

dpkg: error processing package linux-image-4.14-armhf-odroid-xu4 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.133+deb10u1) ...
ln: failed to create hard link '/boot/initrd.img-4.14.294+.dpkg-bak' => '/boot/initrd.img-4.14.294+': Operation not permitted
cp: error writing '/boot/initrd.img-4.14.294+.dpkg-bak': No space left on device
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-4.14.294+
 linux-image-4.14-armhf-odroid-xu4
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is df

root@DietPi:/boot# df
Filesystem      1K-blocks      Used  Available Use% Mounted on
udev               951476         0     951476   0% /dev
tmpfs              204244     24116     180128  12% /run
/dev/mmcblk1p2   30199857   3736958   25228285  13% /
tmpfs             1021208         4    1021204   1% /dev/shm
tmpfs                5120         0       5120   0% /run/lock
tmpfs             1021208         0    1021208   0% /sys/fs/cgroup
tmpfs               51200      1072      50128   3% /var/log
tmpfs             1047552         8    1047544   1% /tmp
/dev/mmcblk1p1      72542     67144       5398  93% /boot
/dev/sdb1      1953513468 430824484 1522688984  23% /mnt/usb
/dev/sda1       479620500 139250992  340353124  30% /mnt/ssd

Expected behaviour

update

Actual behaviour

fails with out of space error. Not sure what to do to clear up /boot. Is it possible to do, or do I need to fresh install which will create a larger boot partition?

Thanks!

can you try to simply remove that file?

Thanks for replying. I just tried, and the purge got a little further but still ran out of space. Is there anything else I can remove?

root@DietPi:/boot# rm uInitrd-4.14.66+
root@DietPi:/boot# df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              951472       0    951472   0% /dev
tmpfs             204244    9088    195156   5% /run
/dev/mmcblk1p2  30199479 3855144  25109721  14% /
tmpfs            1021208       0   1021208   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs            1021208       0   1021208   0% /sys/fs/cgroup
tmpfs              51200       8     51192   1% /var/log
tmpfs            1047552       0   1047552   0% /tmp
/dev/mmcblk1p1     72542   61280     11262  85% /boot
root@DietPi:/boot# apt purge linux-image-4.14.66+
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-image-4.14.66+*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up initramfs-tools (0.133+deb10u1) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-4.14.294+ (4.14.294-20220924-xu4) ...
update-initramfs: Generating /boot/initrd.img-4.14.294+
Image Name:   uInitrd
Created:      Wed May 24 14:15:20 2023
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    7549446 Bytes = 7372.51 KiB = 7.20 MiB
Load Address: 00000000
Entry Point:  00000000
Image Name:   uInitrd
Created:      Wed May 24 14:15:29 2023
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    7548874 Bytes = 7371.95 KiB = 7.20 MiB
Load Address: 00000000
Entry Point:  00000000
Setting up linux-image-4.14-armhf-odroid-xu4 (4.14.294-1) ...
(Reading database ... 28029 files and directories currently installed.)
Purging configuration files for linux-image-4.14.66+ (4.14.66-20180823-xu4) ...
Processing triggers for initramfs-tools (0.133+deb10u1) ...
ln: failed to create hard link '/boot/initrd.img-4.14.294+.dpkg-bak' => '/boot/initrd.img-4.14.294+': Operation not permitted
update-initramfs: Generating /boot/initrd.img-4.14.294+
Image Name:   uInitrd
Created:      Wed May 24 14:15:38 2023
Image Type:   ARM Linux RAMDisk Image (uncompressed)
Data Size:    7548874 Bytes = 7371.95 KiB = 7.20 MiB
Load Address: 00000000
Entry Point:  00000000

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.14.294+ with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@DietPi:/boot# ls
 boot.ini           dietpi             exynos5422-odroidhc1.dtb        exynos5422-odroidxu4.dtb       initrd.img-4.14.294+  'System Volume Information'   uInitrd-4.14.294+   zImage
 config-4.14.241+   dietpi-README.md   exynos5422-odroidxu3.dtb        exynos5422-odroidxu4-kvm.dtb   System.map-4.14.241+   uInitrd                      vmlinuz-4.14.241+
 config-4.14.294+   dietpi.txt         exynos5422-odroidxu3-lite.dtb   initrd.img-4.14.241+           System.map-4.14.294+   uInitrd-4.14.241+            vmlinuz-4.14.294+
root@DietPi:/boot# ls -lau
total 59767
drwxr-xr-x  4 root root   16384 May 24 14:15  .
drwxr-xr-x 21 root root    1024 Oct 22  2022  ..
-rwxr-xr-x  1 root root    5482 Jul 20  2022  boot.ini
-rwxr-xr-x  1 root root  151341 Mar 31  2022  config-4.14.241+
-rwxr-xr-x  1 root root  151687 May 23 01:00  config-4.14.294+
drwxr-xr-x  4 root root    4096 May 23 01:00  dietpi
-rwxr-xr-x  1 root root    6285 Sep 10  2018  dietpi-README.md
-rwxr-xr-x  1 root root   11432 Oct 22  2022  dietpi.txt
-rwxr-xr-x  1 root root   56387 May 23 01:00  exynos5422-odroidhc1.dtb
-rwxr-xr-x  1 root root   63543 May 23 01:00  exynos5422-odroidxu3.dtb
-rwxr-xr-x  1 root root   62488 May 23 01:00  exynos5422-odroidxu3-lite.dtb
-rwxr-xr-x  1 root root   63518 May 23 01:00  exynos5422-odroidxu4.dtb
-rwxr-xr-x  1 root root   63662 May 23 01:00  exynos5422-odroidxu4-kvm.dtb
-rwxr-xr-x  1 root root 7540782 Jul 20  2022  initrd.img-4.14.241+
-rwxr-xr-x  1 root root 7548874 May 24 14:15  initrd.img-4.14.294+
-rwxr-xr-x  1 root root 2728720 Mar 31  2022  System.map-4.14.241+
-rwxr-xr-x  1 root root 2729863 May 23 01:00  System.map-4.14.294+
drwxr-xr-x  2 root root    2048 Jan  1  2020 'System Volume Information'
-rwxr-xr-x  1 root root 7548938 Sep 10  2018  uInitrd
-rwxr-xr-x  1 root root 7540846 Mar 31  2022  uInitrd-4.14.241+
-rwxr-xr-x  1 root root 7548938 May 23 01:00  uInitrd-4.14.294+
-rwxr-xr-x  1 root root 5764120 Mar 31  2022  vmlinuz-4.14.241+
-rwxr-xr-x  1 root root 5782672 May 23 01:00  vmlinuz-4.14.294+
-rwxr-xr-x  1 root root 5782672 Sep 10  2018  zImage
root@DietPi:/boot#

@MichaIng can you have a look pls. Would it be possible to remove files for kernel 4.14.241 before running apt purge?

@a3542345555555 what is the actual kernel version

uname -a

Linux DietPi 4.14.294+ #1 SMP PREEMPT Sat Sep 24 10:24:15 UTC 2022 armv7l GNU/Linux

hmm, that is different to my OP yesterday! I did try an apt uprade. Has it partially upgraded?

As the new kernel v4.14.294+ is loaded, you can remove all files with 4.14.241+ suffix. Also purge the related package then, if installed:

apt purge linux-image-4.14.241+

Quite strange that removing packages requires space :smile:. But it is the initramfs generation which temporarily requires much space until the initramfs has been compressed and the uncompressed one removed.

I remember that boot partition space became an issue on some older Odroid images, similar to what happened to RPi when the RPi 4 and 64-bit kernels were added. However, the 4.14 kernel, AFAIK is not maintained anymore by Meveric, so there won’t be further updates, i.e. you won’t run into that error anymore.

When you find time, I recommend to switch to our new Odroid XU4 image, which uses a much newer kernel and a single partition only, so there won’t be such boot partition space issues. Sadly it is not possible (without significant hacking) to migrate an older image, due to these required partitioning changes.

1 Like

would
sudo apt autoremove -y
work?

Is there a way to resize the partition with gparted?

That worked thank you, I removed the 241 files, then the purge completed sucessfully, and dietpi-update also completed.

Thanks for the help both. :slight_smile:

1 Like