启动分区已满,无法删除内核

启动分区已满,无法删除内核

在我深入描述我的问题之前,我只想说明一下我对 Linux 还很陌生,所以如果我没有指出显而易见的问题,请记住这一点。

我的 Ubuntu 服务器遇到了一些问题。最初,我发现它不断循环重启。强制关闭电源,然后拔掉电源线,重新连接并再次启动后,我能够成功启动服务器。经过一番调查,我相信导致我服务器问题的罪魁祸首是我的启动分区已满。

输出uname -r

3.16.0-41-generic

输出cat /etc/fstab

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/NUCmedia--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sdb1 during installation
UUID=b81a82f4-5f78-4f1e-9aaf-711ce2eb08e8 /boot           ext2    defaults        0       2
/dev/mapper/NUCmedia--vg-swap_1 none            swap    sw              0       0
/dev/NUCmedia-vg/NUCstorage     /mnt/NUCStorage ext4    defaults        0       0

输出df -h

Filesystem                           Size  Used Avail Use% Mounted on
/dev/mapper/NUCmedia--vg-root         29G  8.2G   20G  30% /
none                                 4.0K     0  4.0K   0% /sys/fs/cgroup
udev                                 3.9G  8.0K  3.9G   1% /dev
tmpfs                                788M  1.9M  786M   1% /run
none                                 5.0M     0  5.0M   0% /run/lock
none                                 3.9G   88K  3.9G   1% /run/shm
none                                 100M   16K  100M   1% /run/user
/dev/sda1                            236M  233M     0 100% /boot
/dev/mapper/NUCmedia--vg-NUCstorage  422G  206G  195G  52% /mnt/NUCStorage

输出dpkg -l | grep linux-image

ii  linux-image-3.16.0-33-generic                               3.16.0-33.44~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-34-generic                               3.16.0-34.47~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-36-generic                               3.16.0-36.48~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-37-generic                               3.16.0-37.51~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-38-generic                               3.16.0-38.52~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-39-generic                               3.16.0-39.53~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
iF  linux-image-3.16.0-41-generic                               3.16.0-41.57~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
iF  linux-image-3.16.0-43-generic                               3.16.0-43.58~14.04.1                                amd64        Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-33-generic                         3.16.0-33.44~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-34-generic                         3.16.0-34.47~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-36-generic                         3.16.0-36.48~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-37-generic                         3.16.0-37.51~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-38-generic                         3.16.0-38.52~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-39-generic                         3.16.0-39.53~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-41-generic                         3.16.0-41.57~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-43-generic                         3.16.0-43.58~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-44-generic                         3.16.0-44.59~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-51-generic                         3.16.0-51.69~14.04.1                                amd64        Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-generic-lts-utopic                              3.16.0.51.42                                        amd64        Generic Linux kernel image

如果我尝试运行以下命令输出sudo apt-get remove linux-image-3.16.0-33-generic

no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-image-extra-3.16.0-33-generic : Depends: linux-image-3.16.0-33-generic but it is not going to be installed
 linux-image-extra-3.16.0-44-generic : Depends: linux-image-3.16.0-44-generic but it is not going to be installed
 linux-image-extra-3.16.0-51-generic : Depends: linux-image-3.16.0-51-generic but it is not going to be installed
 linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-51-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

当我尝试删除内核 34、36 等时,我似乎得到了类似的输出。

我在 Google 上搜索了很多次,但还是没有找到解决方案。有一个报告可以尝试,'apt-get -f install' with no packages但我不确定该怎么做,或者我是否应该尝试。

如能得到关于如何修复此问题的任何帮助或指点,我们将不胜感激!

谢谢,

托巴克

答案1

用来sudo dpkg -r <pkgname>删除每个较旧的内核包,然后通过这样做释放一些空间sudo apt-get install -f

答案2

我最终只是将 initrd.img-3.16.0-33-generic(以及 34、36、37 和 38)移动到临时文件夹,然后能够成功执行sudo apt-get install -f。完成后,我执行了,sudo apt-get autoremove成功释放了启动分区上的一些空间。现在一切都很好!

相关内容