OSError: [Errno 28] 设备上没有剩余空间: '/boot/initrd.img

OSError: [Errno 28] 设备上没有剩余空间: '/boot/initrd.img

从今天早上开始,我基本上无法使用apt而不遇到错误,因为所有调用都会导致错误:kernelstub.Installer : ERROR Couldn't copy the initrd onto the ESP!。我正在使用基于 Ubuntu 20.04.2 LTS x86_64 的 Pop!_OS。经过回溯,问题似乎如下:

OSError: [Errno 28] No space left on device: '/boot/initrd.img-5.11.0-7614-generic' -> '/boot/efi/EFI/Ubuntu-22666039-42da-4b29-8575-b464fa505439/initrd.img'

我尝试使用删除旧内核sudo apt-get autoremove linux-image-5.11.0-7612-generic我尝试按照建议这里sudo apt --purge autoremove按照建议这里。两次尝试相同的更新都失败。

这是完整的调用:

update-initramfs: Generating /boot/initrd.img-5.11.0-7614-generic
cryptsetup: WARNING: Resume target cryptswap uses a key file
kernelstub.Config    : INFO     Looking for configuration...
kernelstub           : INFO     System information: 

    OS:..................Ubuntu 20.04
    Root partition:....../dev/nvme0n1p3
    Root FS UUID:........22666039-42da-4b29-8575-b464fa505439
    ESP Path:............/boot/efi
    ESP Partition:......./dev/nvme0n1p1
    ESP Partition #:.....1
    NVRAM entry #:.......-1
    Boot Variable #:.....0000
    Kernel Boot Options:.quiet loglevel=0 systemd.show_status=false splash
    Kernel Image Path:.../boot/vmlinuz-5.11.0-7614-generic
    Initrd Image Path:.../boot/initrd.img-5.11.0-7614-generic
    Force-overwrite:.....False

kernelstub.Installer : INFO     Copying Kernel into ESP
kernelstub.Installer : INFO     Copying initrd.img into ESP
kernelstub.Installer : ERROR    Couldn't copy the initrd onto the ESP!
This is a critical error and we cannot continue. Check your settings to see if there is a typo. Otherwise, check permissions and try again.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kernelstub/installer.py", line 247, in copy_files
    shutil.copy(src, dest)
  File "/usr/lib/python3.8/shutil.py", line 415, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.8/shutil.py", line 272, in copyfile
    _fastcopy_sendfile(fsrc, fdst)
  File "/usr/lib/python3.8/shutil.py", line 163, in _fastcopy_sendfile
    raise err from None
  File "/usr/lib/python3.8/shutil.py", line 149, in _fastcopy_sendfile
    sent = os.sendfile(outfd, infd, offset, blocksize)
OSError: [Errno 28] No space left on device: '/boot/initrd.img-5.11.0-7614-generic' -> '/boot/efi/EFI/Ubuntu-22666039-42da-4b29-8575-b464fa505439/initrd.img'

这是输出df -H

Filesystem      Size  Used Avail Use% Mounted on
udev             17G     0   17G   0% /dev
tmpfs           3.4G  4.2M  3.4G   1% /run
/dev/nvme0n1p3  483G  226G  233G  50% /
tmpfs            17G  128M   17G   1% /dev/shm
tmpfs           5.3M     0  5.3M   0% /run/lock
tmpfs            17G     0   17G   0% /sys/fs/cgroup
/dev/loop0       34M   34M     0 100% /snap/snapd/11402
/dev/loop2       34M   34M     0 100% /snap/snapd/11588
/dev/loop1       59M   59M     0 100% /snap/core18/1988
/dev/loop3       59M   59M     0 100% /snap/core18/1997
/dev/nvme0n1p2  4.3G  2.6G  1.8G  60% /recovery
/dev/nvme0n1p1  522M  522M     0 100% /boot/efi
/dev/sda1       984G  910G   25G  98% /mnt/data
tmpfs           3.4G   25k  3.4G   1% /run/user/1000

这些是内核:

sudo dpkg --list | egrep -i --color 'linux-image|linux-headers'
ii  linux-headers-5.11.0-7612                     5.11.0-7612.13~1617215757~20.04~97a8d1a                   all          Header files related to Linux kernel version 5.11.0
ii  linux-headers-5.11.0-7612-generic             5.11.0-7612.13~1617215757~20.04~97a8d1a                   amd64        Linux kernel headers for version 5.11.0 on 64 bit x86 SMP
ii  linux-headers-5.11.0-7614                     5.11.0-7614.15~1618626693~20.04~ecb25cd                   all          Header files related to Linux kernel version 5.11.0
ii  linux-headers-5.11.0-7614-generic             5.11.0-7614.15~1618626693~20.04~ecb25cd                   amd64        Linux kernel headers for version 5.11.0 on 64 bit x86 SMP
ii  linux-headers-5.8.0-7642                      5.8.0-7642.47~1614007149~20.04~82fb226                    all          Header files related to Linux kernel version 5.8.0
ii  linux-headers-5.8.0-7642-generic              5.8.0-7642.47~1614007149~20.04~82fb226                    amd64        Linux kernel headers for version 5.8.0 on 64 bit x86 SMP
ii  linux-headers-generic                         5.11.0.7614.15~1618626693~20.04~ecb25cd                   amd64        Generic Linux kernel headers
rc  linux-image-5.11.0-7612-generic               5.11.0-7612.13~1617215757~20.04~97a8d1a                   amd64        Linux kernel image for version 5.11.0 on 64 bit x86 SMP
ii  linux-image-5.11.0-7614-generic               5.11.0-7614.15~1618626693~20.04~ecb25cd                   amd64        Linux kernel image for version 5.11.0 on 64 bit x86 SMP
rc  linux-image-5.4.0-7642-generic                5.4.0-7642.46~1598628707~20.04~040157c                    amd64        Linux kernel image for version 5.4.0 on 64 bit x86 SMP
rc  linux-image-5.8.0-7630-generic                5.8.0-7630.32~1609193707~20.04~781bb80                    amd64        Linux kernel image for version 5.8.0 on 64 bit x86 SMP
rc  linux-image-5.8.0-7642-generic                5.8.0-7642.47~1614007149~20.04~82fb226                    amd64        Linux kernel image for version 5.8.0 on 64 bit x86 SMP
ii  linux-image-generic                           5.11.0.7614.15~1618626693~20.04~ecb25cd                   amd64        Generic Linux kernel image

任何想法如何解决这一问题?

答案1

我刚刚找到解决方案这里。基本上问题是/boot/efi/EFI已经满了。我将其发布在这里,因为链接的答案未被接受并被否决。但它解决了我的问题。

基本上我用过:

sudo su
cd /boot/efi/EFI
ls

这找到了一个名为 的文件夹Ubuntu-22666039-42da-4b29-8575-b464fa505439。由于我使用的是 Pop!_OS,我猜想我在 EFI 文件夹中不需要它,所以我移动了它:

mv Ubuntu-22666039-42da-4b29-8575-b464fa505439 /home/johannes/Downloads/backup/

如果我遇到麻烦,我可以将其移回原处,但现在一切似乎都正常。

相关内容