如何列出启动到 Windows 和 Ubuntu,在外部驱动器上安装 Ubuntu 后无法启动到 Windows

如何列出启动到 Windows 和 Ubuntu,在外部驱动器上安装 Ubuntu 后无法启动到 Windows

我在外部 SSD 硬盘上安装了 Ubuntu,主 HDD 上安装了 Windows。

当我在 SSD 上安装 Ubuntu 时,它应该让我选择启动到 Ubuntu 还是 Windows,但是 PC 直接启动到 Ubuntu,而没有给我任何启动到 Windows 或 Ubuntu 的选择......

我怎样才能改变这一点?

顺便说一下,我使用过 Ubuntu,并在其中保存了重要数据,我不想丢失它或丢失 Windows 数据

有什么建议么?

答案1

只需安装 rEFInd 启动管理器包:

sudo apt install refind

并在 ESP/EFI 分区上自动安装启动管理器:

sudo refind-install

或自定义(例如在 USB 记忆棒分区上):

sudo refind-install --usedefault "/dev/sdX1" # X1 = example: /dev/sdb1

并重新启动,它会自动启动并发现所有驱动器上的所有可启动分区。

另一个技巧是在启动期间按 F12 打开启动菜单。

故障排除?启动像 Ubuntu 18.04 这样的实时系统。下载并写入 USB 系统:

dd if=Downloads/ubuntu-18.04.1-desktop-amd64.iso of=/dev/sdx
bs=$((1024**2)) /dev/sdx

/dev/sdx 是您的目标驱动器,如 /dev/sdb 或 /dev/sdc。

使用 gnome-disks 打开所有 ESP/EFI 分区并在终端中检查子目录结构类型:

find \`mount | grep vfat | sort | head -1 | awk '{ print $3 }'\`

它可能/应该看起来像这样:

/media/ron/DB9A-B328/ /media/ron/DB9A-B328/EFI
/media/ron/DB9A-B328/EFI/ubuntu /media/ron/DB9A-B328/EFI/ubuntu/fw
/media/ron/DB9A-B328/EFI/ubuntu/fwupx64.efi
/media/ron/DB9A-B328/EFI/ubuntu/grubx64.efi
/media/ron/DB9A-B328/EFI/ubuntu/grub.cfg
/media/ron/DB9A-B328/EFI/ubuntu/shimx64.efi
/media/ron/DB9A-B328/EFI/ubuntu/mmx64.efi
/media/ron/DB9A-B328/EFI/ubuntu/BOOTX64.CSV
/media/ron/DB9A-B328/EFI/BOOT
/media/ron/DB9A-B328/EFI/BOOT/BOOTX64.EFI
/media/ron/DB9A-B328/EFI/BOOT/fbx64.efi
/media/ron/DB9A-B328/EFI/BOOT/drivers_x64
/media/ron/DB9A-B328/EFI/BOOT/drivers_x64/ext4_x64.efi
/media/ron/DB9A-B328/EFI/BOOT/icons
/media/ron/DB9A-B328/EFI/BOOT/icons/README
/media/ron/DB9A-B328/EFI/BOOT/icons/arrow_left.png
/media/ron/DB9A-B328/EFI/BOOT/icons/arrow_right.png
/media/ron/DB9A-B328/EFI/BOOT/icons/boot_linux.png
/media/ron/DB9A-B328/EFI/BOOT/icons/boot_win.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_about.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_csr_rotate.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_exit.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_firmware.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_hidden.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_reset.png
/media/ron/DB9A-B328/EFI/BOOT/icons/func_shutdown.png
/media/ron/DB9A-B328/EFI/BOOT/icons/mouse.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_arch.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_centos.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_chakra.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_chrome.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_clover.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_crunchbang.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_debian.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_devuan.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_elementary.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_fedora.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_freebsd.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_frugalware.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_gentoo.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_gummiboot.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_haiku.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_hwtest.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_kubuntu.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_legacy.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_linux.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_linuxmint.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_lubuntu.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_mac.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_mageia.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_mandriva.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_netbsd.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_network.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_opensuse.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_redhat.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_refind.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_refit.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_slackware.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_suse.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_trusty.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_ubuntu.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_unknown.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_win.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_win8.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_xenial.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_xubuntu.png
/media/ron/DB9A-B328/EFI/BOOT/icons/os_zesty.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_apple_rescue.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_fwupdate.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_memtest.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_mok_tool.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_netboot.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_part.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_rescue.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_shell.png
/media/ron/DB9A-B328/EFI/BOOT/icons/tool_windows_rescue.png
/media/ron/DB9A-B328/EFI/BOOT/icons/transparent.png
/media/ron/DB9A-B328/EFI/BOOT/icons/vol_external.png
/media/ron/DB9A-B328/EFI/BOOT/icons/vol_internal.png
/media/ron/DB9A-B328/EFI/BOOT/icons/vol_net.png
/media/ron/DB9A-B328/EFI/BOOT/icons/vol_optical.png
/media/ron/DB9A-B328/EFI/BOOT/keys
/media/ron/DB9A-B328/EFI/BOOT/keys/altlinux.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/canonical-uefi-ca.der
/media/ron/DB9A-B328/EFI/BOOT/keys/centos.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/fedora-ca.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/microsoft-kekca-public.der
/media/ron/DB9A-B328/EFI/BOOT/keys/microsoft-pca-public.der
/media/ron/DB9A-B328/EFI/BOOT/keys/microsoft-uefica-public.der
/media/ron/DB9A-B328/EFI/BOOT/keys/openSUSE-UEFI-CA-Certificate-4096.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/openSUSE-UEFI-CA-Certificate.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/refind.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/refind_local.cer
/media/ron/DB9A-B328/EFI/BOOT/keys/SLES-UEFI-CA-Certificate.cer
/media/ron/DB9A-B328/EFI/BOOT/refind.conf
/media/ron/DB9A-B328/EFI/BOOT/BOOT.CSV /media/ron/DB9A-B328/EFI/refind
/media/ron/DB9A-B328/EFI/refind/refind_x64.efi
/media/ron/DB9A-B328/EFI/refind/drivers_x64
/media/ron/DB9A-B328/EFI/refind/drivers_x64/ext4_x64.efi
/media/ron/DB9A-B328/EFI/refind/keys
/media/ron/DB9A-B328/EFI/refind/keys/refind_local.cer
/media/ron/DB9A-B328/EFI/refind/keys/refind_local.crt
/media/ron/DB9A-B328/EFI/refind/keys/altlinux.cer
/media/ron/DB9A-B328/EFI/refind/keys/canonical-uefi-ca.der
/media/ron/DB9A-B328/EFI/refind/keys/centos.cer
/media/ron/DB9A-B328/EFI/refind/keys/fedora-ca.cer
/media/ron/DB9A-B328/EFI/refind/keys/microsoft-kekca-public.der
/media/ron/DB9A-B328/EFI/refind/keys/microsoft-pca-public.der
/media/ron/DB9A-B328/EFI/refind/keys/microsoft-uefica-public.der
/media/ron/DB9A-B328/EFI/refind/keys/openSUSE-UEFI-CA-Certificate-4096.cer
/media/ron/DB9A-B328/EFI/refind/keys/openSUSE-UEFI-CA-Certificate.cer
/media/ron/DB9A-B328/EFI/refind/keys/refind.cer
/media/ron/DB9A-B328/EFI/refind/keys/SLES-UEFI-CA-Certificate.cer
/media/ron/DB9A-B328/EFI/refind/icons
/media/ron/DB9A-B328/EFI/refind/icons/README
/media/ron/DB9A-B328/EFI/refind/icons/arrow_left.png
/media/ron/DB9A-B328/EFI/refind/icons/arrow_right.png
/media/ron/DB9A-B328/EFI/refind/icons/boot_linux.png
/media/ron/DB9A-B328/EFI/refind/icons/boot_win.png
/media/ron/DB9A-B328/EFI/refind/icons/func_about.png
/media/ron/DB9A-B328/EFI/refind/icons/func_csr_rotate.png
/media/ron/DB9A-B328/EFI/refind/icons/func_exit.png
/media/ron/DB9A-B328/EFI/refind/icons/func_firmware.png
/media/ron/DB9A-B328/EFI/refind/icons/func_hidden.png
/media/ron/DB9A-B328/EFI/refind/icons/func_reset.png
/media/ron/DB9A-B328/EFI/refind/icons/func_shutdown.png
/media/ron/DB9A-B328/EFI/refind/icons/mouse.png
/media/ron/DB9A-B328/EFI/refind/icons/os_arch.png
/media/ron/DB9A-B328/EFI/refind/icons/os_centos.png
/media/ron/DB9A-B328/EFI/refind/icons/os_chakra.png
/media/ron/DB9A-B328/EFI/refind/icons/os_chrome.png
/media/ron/DB9A-B328/EFI/refind/icons/os_clover.png
/media/ron/DB9A-B328/EFI/refind/icons/os_crunchbang.png
/media/ron/DB9A-B328/EFI/refind/icons/os_debian.png
/media/ron/DB9A-B328/EFI/refind/icons/os_devuan.png
/media/ron/DB9A-B328/EFI/refind/icons/os_elementary.png
/media/ron/DB9A-B328/EFI/refind/icons/os_fedora.png
/media/ron/DB9A-B328/EFI/refind/icons/os_freebsd.png
/media/ron/DB9A-B328/EFI/refind/icons/os_frugalware.png
/media/ron/DB9A-B328/EFI/refind/icons/os_gentoo.png
/media/ron/DB9A-B328/EFI/refind/icons/os_gummiboot.png
/media/ron/DB9A-B328/EFI/refind/icons/os_haiku.png
/media/ron/DB9A-B328/EFI/refind/icons/os_hwtest.png
/media/ron/DB9A-B328/EFI/refind/icons/os_kubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons/os_legacy.png
/media/ron/DB9A-B328/EFI/refind/icons/os_linux.png
/media/ron/DB9A-B328/EFI/refind/icons/os_linuxmint.png
/media/ron/DB9A-B328/EFI/refind/icons/os_lubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons/os_mac.png
/media/ron/DB9A-B328/EFI/refind/icons/os_mageia.png
/media/ron/DB9A-B328/EFI/refind/icons/os_mandriva.png
/media/ron/DB9A-B328/EFI/refind/icons/os_netbsd.png
/media/ron/DB9A-B328/EFI/refind/icons/os_network.png
/media/ron/DB9A-B328/EFI/refind/icons/os_opensuse.png
/media/ron/DB9A-B328/EFI/refind/icons/os_redhat.png
/media/ron/DB9A-B328/EFI/refind/icons/os_refind.png
/media/ron/DB9A-B328/EFI/refind/icons/os_refit.png
/media/ron/DB9A-B328/EFI/refind/icons/os_slackware.png
/media/ron/DB9A-B328/EFI/refind/icons/os_suse.png
/media/ron/DB9A-B328/EFI/refind/icons/os_trusty.png
/media/ron/DB9A-B328/EFI/refind/icons/os_ubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons/os_unknown.png
/media/ron/DB9A-B328/EFI/refind/icons/os_win.png
/media/ron/DB9A-B328/EFI/refind/icons/os_win8.png
/media/ron/DB9A-B328/EFI/refind/icons/os_xenial.png
/media/ron/DB9A-B328/EFI/refind/icons/os_xubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons/os_zesty.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_apple_rescue.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_fwupdate.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_memtest.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_mok_tool.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_netboot.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_part.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_rescue.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_shell.png
/media/ron/DB9A-B328/EFI/refind/icons/tool_windows_rescue.png
/media/ron/DB9A-B328/EFI/refind/icons/transparent.png
/media/ron/DB9A-B328/EFI/refind/icons/vol_external.png
/media/ron/DB9A-B328/EFI/refind/icons/vol_internal.png
/media/ron/DB9A-B328/EFI/refind/icons/vol_net.png
/media/ron/DB9A-B328/EFI/refind/icons/vol_optical.png
/media/ron/DB9A-B328/EFI/refind/refind.conf
/media/ron/DB9A-B328/EFI/refind/BOOT.CSV
/media/ron/DB9A-B328/EFI/refind/icons-backup
/media/ron/DB9A-B328/EFI/refind/icons-backup/README
/media/ron/DB9A-B328/EFI/refind/icons-backup/arrow_left.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/arrow_right.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/boot_linux.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/boot_win.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_about.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_csr_rotate.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_exit.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_firmware.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_hidden.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_reset.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/func_shutdown.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/mouse.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_arch.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_centos.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_chakra.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_chrome.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_clover.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_crunchbang.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_debian.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_devuan.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_elementary.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_fedora.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_freebsd.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_frugalware.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_gentoo.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_gummiboot.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_haiku.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_hwtest.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_kubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_legacy.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_linux.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_linuxmint.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_lubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_mac.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_mageia.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_mandriva.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_netbsd.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_network.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_opensuse.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_redhat.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_refind.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_refit.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_slackware.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_suse.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_trusty.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_ubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_unknown.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_win.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_win8.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_xenial.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_xubuntu.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/os_zesty.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_apple_rescue.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_fwupdate.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_memtest.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_mok_tool.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_netboot.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_part.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_rescue.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_shell.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/tool_windows_rescue.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/transparent.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/vol_external.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/vol_internal.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/vol_net.png
/media/ron/DB9A-B328/EFI/refind/icons-backup/vol_optical.png
/media/ron/DB9A-B328/EFI/refind/refind.conf-sample
/media/ron/DB9A-B328/EFI/tools

上面的refind subdir结构是因为我安装了rEFInd。

答案2

首先启动什么取决于您的 BIOS/UEFI 启动设置和 MBR 的配置。

BIOS/UEFI 让您选择首先启动哪个驱动器。

  1. 如果您选择 USB,则将选择外部 USB-SSD 来启动操作系统。如果 SSD 没有带有引导加载程序的引导扇区(可让您选择要启动哪个驱动器),它将直接引导驱动器(在本例中为 SSD)上的操作系统,而内部 HDD 将被忽略。
  2. 如果选择 HDD,则会选择内部 HDD 来启动操作系统,而外部 SSD 可能会被忽略。

最好的解决方案是在两个驱动器(内部 HDD 和外部 SSD)上安装软件/引导加载程序grub,这两个驱动器都应该有相互引用的选项。这样,您就可以始终选择要启动哪个驱动器(以及操作系统)。

这并不容易,但可能在 AskUbuntu 回答引导加载程序问题的其他答案中得到了很好的解释。

相关内容