我有一台 2 TB M.2 HD 双启动的机器,使用 Ubuntu 20.04 和 18.04(由于遗留原因仍需要 18.04,请不要询问详细信息:)。
我刚刚对 20.04 进行了更新,现在如果不选择特殊选项,18.04 将无法启动。这是我在启动时通常的 grub 屏幕:
如果我选择Ubuntu 18.04
我会得到这个:
如果改为在主启动菜单中选择Advanced options for Ubutnu 18.04.5 LTS (18.04) (on /dev/nvme0n1p2)
我会得到以下信息:
如果我选择这些非恢复模式选项中的任何一个,一切都会启动并正常工作。
我不明白的是为什么通常的引导选项会寻找以 结尾的内核版本70
?它已经不存在了!我怎样才能让它寻找存在的内核版本之一?
ls
当我得到以下内容时,我做了更多的探索/boot
:
$ ls -l
total 169176
-rw-r--r-- 1 root root 237757 Apr 16 07:44 config-5.4.0-73-generic
-rw-r--r-- 1 root root 237757 Jul 13 10:52 config-5.4.0-80-generic
-rw-r--r-- 1 root root 237757 Jul 23 05:56 config-5.4.0-81-generic
drwx------ 3 root root 4096 Dec 31 1969 efi
drwxr-xr-x 6 root root 4096 Aug 19 11:17 grub
-rw-r--r-- 1 root root 43261536 Jul 22 09:33 initrd.img-5.4.0-73-generic
-rw-r--r-- 1 root root 43267722 Jul 23 10:31 initrd.img-5.4.0-80-generic
-rw-r--r-- 1 root root 43266831 Aug 17 11:26 initrd.img-5.4.0-81-generic
-rw-r--r-- 1 root root 182704 Jan 28 2016 memtest86+.bin
-rw-r--r-- 1 root root 184380 Jan 28 2016 memtest86+.elf
-rw-r--r-- 1 root root 184840 Jan 28 2016 memtest86+_multiboot.bin
-rw------- 1 root root 4586616 Apr 16 07:44 System.map-5.4.0-73-generic
-rw------- 1 root root 4587397 Jul 13 10:52 System.map-5.4.0-80-generic
-rw------- 1 root root 4587874 Jul 23 05:56 System.map-5.4.0-81-generic
-rw------- 1 root root 9449728 Apr 16 07:44 vmlinuz-5.4.0-73-generic
-rw------- 1 root root 9453824 Jul 13 11:28 vmlinuz-5.4.0-80-generic
-rw------- 1 root root 9457920 Jul 23 05:59 vmlinuz-5.4.0-81-generic
所以再次以, 和vmlinuz
结尾73
,但不是那个 grub 似乎正在寻找的。我也检查过,它也有条目,但没有!grub 是从哪里来的?80
81
70
/boot/grub/grub.conf
73
80
81
70
70
根据其他一些帖子,我还尝试c
从 grub 主菜单按进行终端会话,我找到了以下信息,但我不确定该怎么做,抱歉这张照片有点模糊:
如果可能的话,我不确定如何在此处输入命令来解决此问题。
我应该提到的另一件事是在执行高级启动选项以返回 Ubuntu 18.04 之后,我尝试过:
sudo apt-get update
sudo apt-get upgrade
和
sudo update-grub
希望这些能解决问题,但他们没有。建议??
-- 回复@heynnema --
这是您建议的命令的终端输出:
$ sudo update-initramfs -c -k 5.4.0-81-generic
[sudo] password for cdahms:
update-initramfs: Generating /boot/initrd.img-5.4.0-81-generic
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8125a-3.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168fp-3.fw for module r8169
重新启动后结果与以前相同(与通常的 18.04 启动菜单选择相同的错误,仍然适用于高级选项选择)
-- 第二次回复@heynnema --
fdisk
:
$ sudo fdisk -l
Disk /dev/loop0: 32.3 MiB, 33865728 bytes, 66144 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop1: 704 KiB, 720896 bytes, 1408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop2: 243.9 MiB, 255762432 bytes, 499536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop3: 276 KiB, 282624 bytes, 552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop4: 2.5 MiB, 2621440 bytes, 5120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop5: 32.3 MiB, 33853440 bytes, 66120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop6: 2.4 MiB, 2555904 bytes, 4992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop7: 61.7 MiB, 64729088 bytes, 126424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/nvme0n1: 1.9 TiB, 2048408248320 bytes, 4000797360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 63850E58-ACD2-4B55-B5D5-29E46C830D03
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 2029461901 2028411278 967.2G Linux filesystem
/dev/nvme0n1p3 2029463552 4000796671 1971333120 940G Linux filesystem
Disk /dev/loop8: 65.1 MiB, 68259840 bytes, 133320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop9: 548 KiB, 561152 bytes, 1096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop10: 2.5 MiB, 2605056 bytes, 5088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop11: 219 MiB, 229638144 bytes, 448512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop12: 2.2 MiB, 2342912 bytes, 4576 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop13: 219 MiB, 229629952 bytes, 448496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop14: 64.8 MiB, 67915776 bytes, 132648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop15: 548 KiB, 561152 bytes, 1096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop16: 55.4 MiB, 58130432 bytes, 113536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop17: 55.5 MiB, 58134528 bytes, 113544 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/loop18: 61.8 MiB, 64770048 bytes, 126504 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
blkid
:
$ sudo blkid
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/nvme0n1: PTUUID="63850e58-acd2-4b55-b5d5-29e46c830d03" PTTYPE="gpt"
/dev/nvme0n1p1: UUID="B97B-4975" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="b1d40bc5-1bc0-490b-92d4-256bad74c673"
/dev/nvme0n1p2: UUID="cdc92bbb-f4d8-4a31-9cbf-5215632adb49" TYPE="ext4" PARTUUID="3079da12-a09d-4a1a-a21a-61af34810c23"
/dev/nvme0n1p3: UUID="93b02138-35e3-4446-a2b9-e16cf6c22786" TYPE="ext4" PARTUUID="51df7e8c-fa57-4275-9348-27902134ee6a"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
/dev/loop12: TYPE="squashfs"
/dev/loop13: TYPE="squashfs"
/dev/loop14: TYPE="squashfs"
/dev/loop15: TYPE="squashfs"
/dev/loop16: TYPE="squashfs"
/dev/loop17: TYPE="squashfs"
/dev/loop18: TYPE="squashfs"
根据这篇文章的答案之一,如何从终端检测我的磁盘是使用 GPT 还是 MBR?我做了:
$ sudo ls
aws IntelliScan_Haze_Class_005 pycharm
awscliv2.zip IntelliScan_Images_005 rotated_IntelliScan_Images_007
Desktop IntelliScan_Images_006 snap
Documents IntelliScan_Images_007 temp
Downloads minicom.log temp2.txt
Downloads2 Music Templates
Dropbox 'Nala devices' temp.txt
eclipse Nala_PVT3_2mm_lens_haze Videos
examples.desktop Pictures 'Volumetric Dummy Devices.txt'
IntelliScan_Haze_Class_001 Public workspace-apps
IntelliScan_Haze_Class_002 PVT3_haze workspace-prod
IntelliScan_Haze_Class_003 PVT4
IntelliScan_Haze_Class_004 'PVT4 IMEIs.txt'
然后:
$ sudo fdisk -l | grep -B 5 Disklabel
Disk /dev/nvme0n1: 1.9 TiB, 2048408248320 bytes, 4000797360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
所以看来我正在使用 GPT 格式
-- 第三次回复@heynnema --
是的,我确实使用Grub Customizer
过,那是不是搞砸了?我听说它可以做到这一点,但我以前从未遇到过问题。这是我的ls -al /etc/grub.d
:
$ ls -al /etc/grub.d
total 100
drwxr-xr-x 5 root root 4096 Aug 19 11:00 .
drwxr-xr-x 140 root root 12288 Aug 19 10:32 ..
-rwxr-xr-x 1 root root 10046 Jul 30 2020 00_header
-rwxr-xr-x 1 root root 6258 Jul 20 2020 05_debian_theme
-rwxr-xr-x 1 root root 914 May 23 22:55 10_linux_proxy
-rwxr-xr-x 1 root root 221 May 23 22:55 40_custom_proxy
-rwxr-xr-x 1 root root 914 May 23 22:55 41_linux_proxy
-rwxr-xr-x 1 root root 11298 Jul 30 2020 44_linux_xen
-rwxr-xr-x 1 root root 1992 Jan 28 2016 45_memtest86+
-rwxr-xr-x 1 root root 1539 May 23 22:55 46_os-prober_proxy
-rwxr-xr-x 1 root root 1418 Jul 30 2020 47_uefi-firmware
-rwxr-xr-x 1 root root 285 May 23 22:55 48_custom_proxy
-rwxr-xr-x 1 root root 216 Jul 30 2020 49_custom
drwxr-xr-x 4 root root 4096 May 23 22:55 backup
drwxr-xr-x 2 root root 4096 May 23 22:55 bin
drwxr-xr-x 2 root root 4096 May 23 22:55 proxifiedScripts
-rw-r--r-- 1 root root 483 Jul 30 2020 README
-rw-r--r-- 1 root root 272 May 23 22:55 .script_sources.txt
-- 对@heynnema 的第四次回复 --
grep -i 5.4.0-70 /etc/grub.d/*
:
$ grep -i 5.4.0-70 /etc/grub.d/*
/etc/grub.d/10_linux_proxy:-'SUBMENU' as 'Advanced options for Ubuntu'{-'Advanced options for Ubuntu'/*, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-73-generic'~408f07b7e0dd8d620374c5b681855861~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-73-generic (recovery mode)'~003de087994ae2af14e29d21bf9905b2~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-72-generic'~c5a297cf454d7588afd791e38e600c79~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-72-generic (recovery mode)'~fdd81b462724bdc5fe27e5506ee615f4~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-70-generic'~6f6c570f06cb15f97ea26de817f5f40a~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-70-generic (recovery mode)'~6b0d22eb9c2641ea1add550c2162c631~}
/etc/grub.d/41_linux_proxy:+'SUBMENU' as 'Advanced options for Ubuntu'{+'Advanced options for Ubuntu'/*, +'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-73-generic'~408f07b7e0dd8d620374c5b681855861~, +'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-73-generic (recovery mode)'~003de087994ae2af14e29d21bf9905b2~, +'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-72-generic'~c5a297cf454d7588afd791e38e600c79~, +'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-72-generic (recovery mode)'~fdd81b462724bdc5fe27e5506ee615f4~, +'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-70-generic'~6f6c570f06cb15f97ea26de817f5f40a~, +'Advanced options for Ubuntu'/'Ubuntu, with Linux 5.4.0-70-generic (recovery mode)'~6b0d22eb9c2641ea1add550c2162c631~}
grep: /etc/grub.d/backup: Is a directory
grep: /etc/grub.d/bin: Is a directory
grep: /etc/grub.d/proxifiedScripts: Is a directory
似乎 5.4.0-70 在 grub.d 中!也许这就是问题所在?
cat /etc/fstab
:
$ 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>
# / was on /dev/nvme0n1p2 during installation
UUID=cdc92bbb-f4d8-4a31-9cbf-5215632adb49 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=B97B-4975 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
-- 第 5 次回复@heynnema --
这是常规 Ubuntu 18.04 菜单项的 Grub Customizer 编辑屏幕:
我不明白这个 b/c-73
是不是在这里-70
?!?!
-- 第六次回复@heynnema --
主 Grub 定制器屏幕:
默认的 GRUB 引导正在寻找不存在的内核 vmlinuz-5.4.0-70-generic。
附加选项引导正确显示内核 -73、-80 和 -81。
GRUB Customizer
被用来定制 GRUB 菜单,结果搞砸了。查看GRUB Customizer
菜单以寻找 -70 的自定义条目,或寻找恢复到标准 GRUB 菜单的方法。