You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04无法以UEFI模式启动,进入initramfs提示符(找不到/dev/sdaX)的解决求助

Ubuntu 22.04无法以UEFI模式启动,进入initramfs提示符(找不到/dev/sdaX)的解决求助

我现在碰到了一个头疼的启动问题,想向大家求助:

我的磁盘分区情况是这样的:

  • sda1 挂载 /boot/efi/EFI/
  • sda3 是Ubuntu系统分区
  • sda4 挂载 /var
  • sda6 挂载 /home

现在系统启动时会先进入grub>提示符,执行exit后会进入initramfs>,提示找不到local-block的脚本,还提到了mdadm(但我的系统根本没配置RAID),我怀疑是不是udev没完全生成/dev目录?

另外,我其他硬盘上还装了能正常启动的Ubuntu 22.04,但就是找不到正确的命令序列来启动sda上的系统。

我之前运行了Boot Repair工具,下面是它的总结报告:

============================= Boot Repair Summary ==============================

modprobe: FATAL: Module efivars not found in directory /lib/modules/6.5.0-26-generic

Recommended repair: ____________________________________________________________

The default repair of the Boot-Repair utility will purge (in order to unsign) and reinstall the grub-efi of
sde2,
using the following options:  sde1/boot sde6/boot/efi
Additional repair will be performed: unhide-bootmenu-10s use-standard-efi-file

/dev/sda3 is 97 % full

(org.gnome.Nautilus:36401): libunity-CRITICAL **: 18:07:42.946: file unity-launcher.c: line 1638: unexpected error: Failed to execute child process “dbus-launch” (No such file or directory) (g-exec-error-quark, 8)

(org.gnome.Nautilus:36401): libunity-CRITICAL **: 18:07:42.947: unity_launcher_entry_dbus_impl_construct: assertion 'conn != NULL' failed

(org.gnome.Nautilus:36401): libunity-CRITICAL **: 18:07:42.950: unity-inspector.vala:96: Unable to connect to session bus: Failed to execute child process “dbus-launch” (No such file or directory)

(org.gnome.Nautilus:36401): dconf-WARNING **: 18:07:43.044: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

(org.gnome.Nautilus:36401): dconf-WARNING **: 18:07:43.044: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

** (org.gnome.Nautilus:36401): WARNING **: 18:07:43.118: Unable to get contents of the bookmarks file: Error opening file /root/.gtk-bookmarks: No such file or directory

** (org.gnome.Nautilus:36401): WARNING **: 18:07:43.118: Unable to get contents of the bookmarks file: Error opening file /root/.gtk-bookmarks: No such file or directory

(org.gnome.Nautilus:36401): dconf-WARNING **: 18:07:43.126: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

** (org.gnome.Nautilus:36401): CRITICAL **: 18:07:43.140: update_dbus_opened_locations: assertion 'dbus_object_path' failed

(org.gnome.Nautilus:36401): dconf-WARNING **: 18:07:43.140: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)

** (org.gnome.Nautilus:36401): CRITICAL **: 18:08:05.433: update_dbus_opened_locations: assertion 'dbus_object_path' failed

(org.gnome.Nautilus:36401): dconf-WARNING **: 18:08:05.433: failed to commit changes to dconf: Failed to execute child process “dbus-launch” (No such file or directory)
/dev/sde2/boot/efi not empty
apt-get -y update
Purge the GRUB of /dev/sde2
grub-efi available

0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 11 not to upgrade.
DEBCHECK debOK, grub-efi
DEBCHECK debOK
Please type: sudo dpkg --configure -ansudo apt-get install -fynsudo apt-get purge --allow-remove-essential -y grub-com*nsudo apt-get purge --allow-remove-essential -y grub2-com*nsudo apt-get purge --allow-remove-essential -y shim-signednsudo apt-get purge --allow-remove-essential -y grub-common:*nsudo apt-get purge --allow-remove-essential -y grub2-common:*n
Then type: sudo apt-get install -y grub-efi os-prober

Unhide GRUB boot menu in sde2/etc/default/grub

================ Reinstall the grub-efi os-prober of /dev/sde2 =================

grub-install --version
grub-install (GRUB) 2.06-2ubuntu7.2
modprobe: FATAL: Module efivars not found in directory /lib/modules/6.5.0-26-generic
modprobe efivars

efibootmgr -v before grub install
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0004,0007,0009,000A,0008
Boot0003* debian    HD(1,GPT,b54ba509-9eaa-464f-9108-9bc20c956a9f,0x22,0x1dcd65)/File(EFIDEBIANSHIMX64.EFI)
Boot0004* ubuntu    HD(6,GPT,5a126de3-d8ec-48f2-b1f6-653bc549265b,0x89b82800,0xf4000)/File(EFIUBUNTUGRUBX64.EFI)
Boot0007* debian    HD(1,GPT,b54ba509-9eaa-464f-9108-9bc20c956a9f,0x22,0x1dcd65)/File(EFIDEBIANGRUBX64.EFI)..BO
Boot0008* UEFI: SanDisk, Partition 2    PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/USB(2,0)/HD(2,GPT,abbd44c4-640c-4cea-acc9-ca38273f602e,0x955d78,0x2754)..BO
Boot0009* ubuntu    HD(1,GPT,b1f21868-b832-460c-ba67-39cc32a6f876,0x800,0xee000)/File(EFIUBUNTUSHIMX64.EFI)..BO
Boot000A* ubuntu    HD(1,GPT,b54ba509-9eaa-464f-9108-9bc20c956a9f,0x22,0x1dcd65)/File(EFIUBUNTUGRUBX64.EFI)..BO

uname -r
6.5.0-26-generic

grub-install --efi-directory=/boot/efi --target=x86_64-efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
Refind detected on sdd1
df /dev/sde6
mv /boot/efi/EFI/Boot/bootx64.efi /boot/efi/EFI/Boot/bkpbootx64.efi
cp /boot/efi/efi/ubuntu/grubx64.efi /boot/efi/EFI/Boot/bootx64.efi
df /dev/sdd1
touch /mnt/boot-sav/sdd1/EFI/Boot/bootx64.efi.grb
cp /boot/efi/efi/ubuntu/grubx64.efi /mnt/boot-sav/sdd1/EFI/Boot/bootx64.efi
df /dev/sda1
mv /mnt/boot-sav/sda1/EFI/Boot/bootx64.efi /mnt/boot-sav/sda1/EFI/Boot/bkpbootx64.efi
cp /boot/efi/efi/ubuntu/grubx64.efi /mnt/boot-sav/sda1/EFI/Boot/bootx64.efi

grub-install --efi-directory=/boot/efi --target=x86_64-efi
Installing for x86_64-efi platform.
Installation finished. No error reported.

efibootmgr -v after grub install
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0004,0003,0007,0008
Boot0003* debian    HD(1,GPT,b54ba509-9eaa-464f-9108-9bc20c956a9f,0x22,0x1dcd65)/File(EFIDEBIANSHIMX64.EFI)
Boot0004* ubuntu    HD(6,GPT,5a126de3-d8ec-48f2-b1f6-653bc549265b,0x89b82800,0xf4000)/File(EFIubuntugrubx64.efi)
Boot0007* debian    HD(1,GPT,b54ba509-9eaa-464f-9108-9bc20c956a9f,0x22,0x1dcd65)/File(EFIDEBIANGRUBX64.EFI)..BO
Boot0008* UEFI: SanDisk, Partition 2    PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x0)/USB(2,0)/HD(2,GPT,abbd44c4-640c-4cea-acc9-ca38273f602e,0x955d78,0x2754)..BO

update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Found linux image: /boot/vmlinuz-6.5.0-26-generic
Found initrd image: /boot/initrd.img-6.5.0-26-generic
Found linux image: /boot/vmlinuz-6.5.0-25-generic
Found initrd image: /boot/initrd.img-6.5.0-25-generic
Found Ubuntu 22.04.4 LTS (22.04) on /dev/sda3
Found Debian GNU/Linux 10 (buster) on /dev/sdb3
Found Debian GNU/Linux 11 (bullseye) on /dev/sdd4
Adding boot menu entry for UEFI Firmware Settings ...

Unhide GRUB boot menu in sde2/boot/grub/grub.cfg

Unhide GRUB boot menu in sdd4/boot/grub/grub.cfg

Unhide GRUB boot menu in sda1/boot/grub/grub.cfg

Boot successfully repaired.

You can now reboot your computer.
Please do not forget to make your UEFI firmware boot on the The OS now in use - Ubuntu 22.04.4 LTS entry (sde6/efi/ubuntu/grubx64.efi file) !

之后我清理了一些缓存文件,sda3的空间占用已经降下来了,但尝试启动sda1时,现在能进入选择操作系统的界面,点击Ubuntu后启动到一半就报错:

Running /scripts/local-block... mdadm. No devices listed in conf file were found. Gave up waiting for root file system. ALERT! /dev/sda3 does not exist. Dropping to a shell.

然后就进入了(initramfs)提示符。而且Boot Repair现在总想修复其他硬盘,不是sda。我的系统真的没有RAID,有没有大佬能给我一些思路?另外,我还想问问,如果要重装Ubuntu,怎么才能保留/etc目录里的设置?

备注:内容来源于stack exchange,提问作者Michael Lager

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 13:18:06