例如运行 sudo apt-get upgrade 后,会生成以下错误代码:
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 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 initramfs-tools (0.130ubuntu3.9) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-4.15.0-109-generic (4.15.0-109.110) ...
Processing triggers for initramfs-tools (0.130ubuntu3.9) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-109-generic
Fatal: open /dev/sda: No medium found
run-parts: /etc/initramfs/post-update.d//runlilo exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-4.15.0-109-generic (4.15.0-109.110) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 4.15.0-109-generic
evdi:
Running module version sanity check.
- Original module
- This kernel never originally had a module by this name
- Installation
- Installing to /lib/modules/4.15.0-109-generic/updates/dkms/
depmod...
DKMS: install completed.
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-109-generic
/etc/kernel/postinst.d/zz-runlilo:
Fatal: open /dev/sda: No medium found
run-parts: /etc/kernel/postinst.d/zz-runlilo exited with return code 1
dpkg: error processing package linux-image-4.15.0-109-generic (--configure):
installed linux-image-4.15.0-109-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
initramfs-tools
linux-image-4.15.0-109-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
重新安装 intitramfs-tools 不起作用。有人知道问题是什么以及如何修复吗?
编辑:问题源于 lilo.conf 文件。这里定义了以下目录:boot = /dev/sda root = /dev/sda1
但是,我认为这不是启动设备,也不是根分区。我已将所有设备列在下面:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 956K 1 loop /snap/gnome-logs/93
loop1 7:1 0 956K 1 loop /snap/gnome-logs/100
loop2 7:2 0 2,4M 1 loop /snap/gnome-calculator/748
loop3 7:3 0 2,4M 1 loop /snap/gnome-calculator/730
loop4 7:4 0 2,2M 1 loop /snap/gnome-system-monitor/148
loop5 7:5 0 54,8M 1 loop /snap/gtk-common-themes/1502
loop6 7:6 0 55M 1 loop /snap/core18/1754
loop7 7:7 0 97M 1 loop /snap/core/9289
loop8 7:8 0 62,1M 1 loop /snap/gtk-common-themes/1506
loop9 7:9 0 160,2M 1 loop /snap/gnome-3-28-1804/116
loop10 7:10 0 255,6M 1 loop /snap/gnome-3-34-1804/36
loop11 7:11 0 96,5M 1 loop /snap/core/9436
loop12 7:12 0 55M 1 loop /snap/core18/1705
loop13 7:13 0 161,4M 1 loop /snap/gnome-3-28-1804/128
loop14 7:14 0 276K 1 loop /snap/gnome-characters/539
loop15 7:15 0 255,6M 1 loop /snap/gnome-3-34-1804/33
loop16 7:16 0 276K 1 loop /snap/gnome-characters/550
loop17 7:17 0 2,2M 1 loop /snap/gnome-system-monitor/145
nvme0n1 259:0 0 238,5G 0 disk
nvme0n1p1 259:1 0 499M 0 part /boot/efi
nvme0n1p2 259:2 0 128M 0 part
nvme0n1p3 259:3 0 235,5G 0 part
nvme0n1p4 259:4 0 2,4G 0 part
nvme1n1 259:5 0 931,5G 0 disk
nvme1n1p1 259:6 0 16M 0 part
nvme1n1p2 259:7 0 686,4G 0 part
nvme1n1p3 259:8 0 245,1G 0 part /
例如,如果我将启动项更改为 /dev/nvme1n1p3,则会显示以下错误:
Warning: SATA partition is in the high region (>15)
LILO needs kernel in one of the first 15 SATA partitions. If you need support for kernel in SATA partitions of the higher region than try grub2 for this purpose!
Fatal: Sorry, cannot handle device 0x10308
我不知道如何调整某些东西或如何使用 grub2,那么有谁知道如何解决这个问题吗?