重新安装Ubuntu后添加Menuentry Windows 10时出错

我已在Windows 10引导上安装了Windows 10引导程序,/dev/sda1但grub2并未将其检测为操作系统。

$ fdisk -l

Device      Boot    Start       End         Blocks      Id  System
/dev/sda1   *       2048        2050047     1024000     b   W95 FAT32
/dev/sda2           2050048     232736767   115343360   7   HPFS/NTFS/exFAT
/dev/sda4           232738814   500117503   133689345   f   W95 Ext'd (LBA)
/dev/sda5           476450816   492834815   8192000     82  Linux swap / Solaris
/dev/sda6           492836864   500117503   3640320     83  Linux
/dev/sda7           232738816   476450815   121856000   83  Linux

因此,我添加了一个menuentry,/etc/grub.d/40_custom将文件保留为

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Windows 10' {
set root ='(hd0,msdos1)'
chainloader +1
}

但是,当我尝试进入Windows 10时,会收到此错误

错误

error: not an assigment.
error: invalid signature.

Press any key to continue...

但是我尝试用SuperGrub usb磁盘启动,它检测到操作系统,我可以顺利启动。

我究竟做错了什么?

罗恩

将菜单项更改为以下内容:

menuentry 'Windows 10' {
    set root='(hd0,msdos1)' #No 'space' between 'root' and '='
    chainloader +1
    }

为我工作。我尝试了此操作,然后又回到了Windows bootloader(已安装在sda1)中。因此,我想它也应该为您工作。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章