使用 ubuntu 18.04 在没有 USB 的情况下安装 Windows 10:这不是可引导磁盘错误

Mar*_*dru 4 partitioning boot grub2 dual-boot

我在谷歌上找到了一种无需 USB/DVD 即可安装 Windows 10 的方法,方法是将安装程序复制到第二个分区并使其可启动。我已经设法做到了这一点并更新了我的 grub,但是当我尝试启动到新分区时出现此错误:This is not a bootable disk please insert a bootable floppy.

有没有办法使用这种方式安装Windows 10,否则我应该放弃?请注意,我目前无法购买 USB。

这是我用于 Windows 设置的 grub 菜单项:

menuentry 'Windows Recovery Environment (on /dev/sda4)' --class windows --class os $menuentry_id_option 'osprober-chain-592C85254E2CD0B7' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos4'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  592C85254E2CD0B7
    else
      search --no-floppy --fs-uuid --set=root 592C85254E2CD0B7
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}
Run Code Online (Sandbox Code Playgroud)

C.S*_*ron 7

使用 Ubuntu 在没有 USB 的情况下安装 Windows 10,一步一步

这一步是根据 OP @Marcel Alexandru 提供的信息创建的。

  • 备份目标驱动器。

  • 在硬盘驱动器上创建一个 6GB 的 NTFS 分区并将 Windows ISO 解压缩到其中。

  • 在硬盘驱动器上为 Windows 安装创建一个 20GB 或更大的 NTFS 分区。

  • 打开磁盘 (Gnome-Disks),并记下 Windows ISO 提取分区的设备 (/dev/sdx) 和 UUID。

  • 对于 msdos 分区表,将此问题中给出的菜单项复制到/etc/grub.d/40-custom/*

  • ntldr /bootmgr在下面添加一行chainloader +1

  • 编辑menuentry,改变sda4 to sdaxmsdos4msdosx(4处),并且对592C85254E2CD0B7 UUID,(3处),上述套装步骤4。

  • 运行sudo update grub确认ntldr /bootmgr出现在 grub.cfg 中。

  • 将计算机启动到新创建的菜单项并将 Windows 安装到它的新分区中。

  • 如果需要,重新安装 Ubuntu,GRUB 引导加载程序将替换为 Windows 引导加载程序。

*来自 OP 的注意事项:您不必重新安装 Ubuntu 来修复 grub 加载程序。您可以在 Ubuntu Live USB 中启动,打开终端并使用boot-repair命令打开启动修复。如果它不可用,您可以使用以下命令安装它:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Run Code Online (Sandbox Code Playgroud)

有关修复 Grub 的更多信息,请访问此链接:https : //help.ubuntu.com/community/Boot-Repair

*对于 gpt 分区表,将以下菜单项复制到/etc/grub.d/40-custom/

menuentry 'Windows Recovery Environment (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-chain-5642BC722509341F' {
    insmod part_gpt
    insmod ntfs
    set root='hd0,gpt1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  5642BC722509341F
    else
      search --no-floppy --fs-uuid --set=root 5642BC722509341F
    fi
    drivemap -s (hd0) ${root}
    chainloader +1
    ntldr /bootmgr
}
Run Code Online (Sandbox Code Playgroud)

也可以调整此方法以制作 Windows 安装程序 USB 或将 Windows 安装程序添加到多重引导 USB。

限制

Windows 10 在分区表和启动模式方面存在限制。

我能够将旧模式 Windows 安装到带有 MSDOS 分区表的驱动器上。

我能够将 UEFI 模式 Windows 安装到带有 GPT 分区表的驱动器上。

我无法将旧模式 Windows 安装到带有 GPT 分区表的驱动器。

我无法将 UEFI 模式 Windows 安装到具有 GPT 分区表和传统模式 Ubuntu 的驱动器。

可能存在超出本答案范围的解决方法。