/boot 内核上没有足够的可用磁盘空间,无法删除吗?

/boot 内核上没有足够的可用磁盘空间,无法删除吗?

我反复尝试了许多我能找到的答案。它们都导致相同的错误。我不确定原因,但感觉状态仍处于从 6.2.0-26 升级到 6.2.0-27 的中间阶段。但这完全是我的猜测。我不知道为什么会处于这种状态,我尝试遵循的每个文档都试图清除旧内核,但都失败了,因为似乎虽然旧内核可见,但它们并未安装?

我尝试按照软件更新程序中的建议,通过更改 /etc/initramfs-tools/initramfs.conf 中的 COMPRESS=xz,但可用空间也有所不同。

> sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Requesting to save current system state
ERROR couldn't save system state: Minimum free space to take a snapshot and preserve ZFS performance is 20%.
Free space on pool "bpool" is 9%.
Please remove some states manually to free up space. 
Setting up initramfs-tools (0.142ubuntu2) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-6.2.0-27-generic (6.2.0-27.28) ...
I: /boot/initrd.img is now a symlink to initrd.img-6.2.0-27-generic
Setting up linux-firmware (20230323.gitbcdcfbcf-0ubuntu1.5) ...
update-initramfs: Generating /boot/initrd.img-6.2.0-26-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p2
I: (UUID=9707427f-ea21-4f24-a222-71616b39623d)
I: Set the RESUME variable to override this.
xz: (stdout): Write error: No space left on device
E: mkinitramfs failure xz  --check=crc32 --threads=0 1
update-initramfs: failed for /boot/initrd.img-6.2.0-26-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-6.2.0-26-generic (6.2.0-26.26) ...
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 6.2.0.27.27); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the err
or message indicates its a followup error from a previous failure.
                                                                  Processing triggers for initramfs-tools (0.142ubuntu2) ...
ln: failed to create hard link '/boot/initrd.img-6.2.0-26-generic.dpkg-bak': No space left on device
cp: cannot create regular file '/boot/initrd.img-6.2.0-26-generic.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
No apport report written because MaxReports is reached already
                                                              Processing triggers for linux-image-6.2.0-27-generic (6.2.0-27.28) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.2.0-27-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.2.0-27-generic
touch: cannot touch '/boot/initrd.img-6.2.0-27-generic.new': No space left on device
I: The initramfs will attempt to resume from /dev/nvme0n1p2
I: (UUID=9707427f-ea21-4f24-a222-71616b39623d)
I: Set the RESUME variable to override this.
xz: (stdout): Write error: No space left on device
E: mkinitramfs failure xz  --check=crc32 --threads=0 1
update-initramfs: failed for /boot/initrd.img-6.2.0-27-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-6.2.0-27-generic (--configure):
 installed linux-image-6.2.0-27-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Processing triggers for linux-image-6.2.0-26-generic (6.2.0-26.26) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.2.0-26-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.2.0-26-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p2
I: (UUID=9707427f-ea21-4f24-a222-71616b39623d)
I: Set the RESUME variable to override this.
xz: (stdout): Write error: No space left on device
E: mkinitramfs failure xz  --check=crc32 --threads=0 1
update-initramfs: failed for /boot/initrd.img-6.2.0-26-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-6.2.0-26-generic (--configure):
 installed linux-image-6.2.0-26-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-firmware
 linux-image-generic
 linux-generic
 initramfs-tools
 linux-image-6.2.0-27-generic
 linux-image-6.2.0-26-generic
ZSys is adding automatic system snapshot to GRUB menu
E: Sub-process /usr/bin/dpkg returned an error code (1)

磁盘使用情况:

> df -h
Filesystem                                        Size  Used Avail Use% Mounted on
tmpfs                                             3.2G  2.9M  3.2G   1% /run
rpool/ROOT/ubuntu_zwy26j                          794G  7.9G  786G   1% /
tmpfs                                              16G   97M   16G   1% /dev/shm
tmpfs                                             5.0M   16K  5.0M   1% /run/lock
rpool/USERDATA/matt_7cxeqg                        846G   61G  786G   8% /home/matt
rpool/USERDATA/root_7cxeqg                        786G  1.2M  786G   1% /root
rpool/ROOT/ubuntu_zwy26j/srv                      786G  128K  786G   1% /srv
rpool/ROOT/ubuntu_zwy26j/usr/local                786G  177M  786G   1% /usr/local
rpool/ROOT/ubuntu_zwy26j/var/lib                  795G  9.1G  786G   2% /var/lib
rpool/ROOT/ubuntu_zwy26j/var/games                786G  128K  786G   1% /var/games
rpool/ROOT/ubuntu_zwy26j/var/snap                 786G  2.4M  786G   1% /var/snap
rpool/ROOT/ubuntu_zwy26j/var/log                  787G  766M  786G   1% /var/log
rpool/ROOT/ubuntu_zwy26j/var/mail                 786G  128K  786G   1% /var/mail
rpool/ROOT/ubuntu_zwy26j/var/www                  786G  128K  786G   1% /var/www
rpool/ROOT/ubuntu_zwy26j/var/spool                786G  128K  786G   1% /var/spool
rpool/ROOT/ubuntu_zwy26j/var/lib/AccountsService  786G  128K  786G   1% /var/lib/AccountsService
rpool/ROOT/ubuntu_zwy26j/var/lib/NetworkManager   786G  256K  786G   1% /var/lib/NetworkManager
rpool/ROOT/ubuntu_zwy26j/var/lib/apt              786G   97M  786G   1% /var/lib/apt
rpool/ROOT/ubuntu_zwy26j/var/lib/dpkg             786G   50M  786G   1% /var/lib/dpkg
bpool/BOOT/ubuntu_zwy26j                          288M  258M   30M  90% /boot
/dev/nvme0n1p1                                    511M   72M  440M  14% /boot/efi
tmpfs                                             3.2G  128K  3.2G   1% /run/user/1000

内核镜像

> dpkg -l | tail -n +6 | grep -E 'linux-image'                                                                     
ic  linux-image-5.13.0-40-generic              5.13.0-40.45                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-27-generic              5.15.0-27.28                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-30-generic              5.15.0-30.31                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-33-generic              5.15.0-33.34                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-35-generic              5.15.0-35.36                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-37-generic              5.15.0-37.39                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-39-generic              5.15.0-39.42                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-40-generic              5.15.0-40.43                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-41-generic              5.15.0-41.44                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-43-generic              5.15.0-43.46                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-46-generic              5.15.0-46.49                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-47-generic              5.15.0-47.51                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-48-generic              5.15.0-48.54                            amd64        Signed kernel image generic
ic  linux-image-5.15.0-52-generic              5.15.0-52.58                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-23-generic              5.19.0-23.24                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-26-generic              5.19.0-26.27                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-28-generic              5.19.0-28.29                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-29-generic              5.19.0-29.30                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-31-generic              5.19.0-31.32                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-35-generic              5.19.0-35.36                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-40-generic              5.19.0-40.41                            amd64        Signed kernel image generic
ic  linux-image-5.19.0-41-generic              5.19.0-41.42                            amd64        Signed kernel image generic
ic  linux-image-6.2.0-20-generic               6.2.0-20.20                             amd64        Signed kernel image generic
ic  linux-image-6.2.0-23-generic               6.2.0-23.23                             amd64        Signed kernel image generic
ic  linux-image-6.2.0-24-generic               6.2.0-24.24                             amd64        Signed kernel image generic
ic  linux-image-6.2.0-25-generic               6.2.0-25.25                             amd64        Signed kernel image generic
iF  linux-image-6.2.0-26-generic               6.2.0-26.26                             amd64        Signed kernel image generic
iF  linux-image-6.2.0-27-generic               6.2.0-27.28                             amd64        Signed kernel image generic
iU  linux-image-generic                        6.2.0.27.27                             amd64        Generic Linux kernel image

无法删除不存在的旧图像?

> sudo apt remove linux-image-5.13.0-40-generic                                                                     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'linux-image-5.13.0-40-generic' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
^C⏎                                                                       
> uname -r
6.2.0-26-generic
ls -l /boot                                                                                                      
total 263675
-rw-r--r-- 1 root root    275950 Jul 10 17:25 config-6.2.0-26-generic
-rw-r--r-- 1 root root    275939 Jul 12 18:22 config-6.2.0-27-generic
drwxr-xr-x 4 root root      4096 Dec 31  1969 efi/
drwxr-xr-x 5 root root      4096 Aug 16 10:05 grub/
-rw-r--r-- 1 root root 235906921 Aug 11 09:16 initrd.img-6.2.0-26-generic
lrwxrwxrwx 1 root root        27 Aug 11 09:16 initrd.img.old -> initrd.img-6.2.0-26-generic
-rw-r--r-- 1 root root    138712 Feb 11  2023 memtest86+ia32.bin
-rw-r--r-- 1 root root    139776 Feb 11  2023 memtest86+ia32.efi
-rw-r--r-- 1 root root    144312 Feb 11  2023 memtest86+x64.bin
-rw-r--r-- 1 root root    145408 Feb 11  2023 memtest86+x64.efi
-rw------- 1 root root   8163538 Jul 10 17:25 System.map-6.2.0-26-generic
-rw------- 1 root root   8166850 Jul 12 18:22 System.map-6.2.0-27-generic
lrwxrwxrwx 1 root root        24 Aug 11 09:16 vmlinuz -> vmlinuz-6.2.0-27-generic
-rw------- 1 root root  14482632 Jul 10 17:31 vmlinuz-6.2.0-26-generic
-rw------- 1 root root  13872968 Jul 12 18:23 vmlinuz-6.2.0-27-generic
lrwxrwxrwx 1 root root        24 Aug 11 09:16 vmlinuz.old -> vmlinuz-6.2.0-26-generic

从目录列表可以看出。启动空间主要由一个无法删除的文件使用,initrd.img-6.2.0-26-generic 使用了 /boot 目录中 258M 中的 225M。我无法删除唯一活动的内核,因此无法按照删除额外内核的步骤操作。请不要将其关闭为重复项。

启动分区是使用 Ubuntu 的默认安装设置创建的。更新始终从软件更新程序应用。dpkg 显示一堆内核,但使用 remove 命令显示它们未安装,因此无法删除。

当我打开“磁盘”应用程序时,我甚至看不到 /boot 分区。只有 /boot/efi 仍有大量空间,还有其他未挂载的分区?

gparted 屏幕截图显示 /boot/efi

相关内容