一、挂载esp分区到指定盘符

1、管理员身份打开cmd,使用diskpart

diskpart
select disk 0
select partition 1
SET ID=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 OVERRIDE
assign letter=M
exit

2、重启系统,然后

3、挂载esp分区到指定盘符

二、使用 BOOTICEx64 添加新的分区
1、BOOTICEx64 v1.3.3.2
打开后,【UEFI】–》【修改启动序列】–》点击【添加】
菜单标题:OpenEulerOS, 启动文件:\EFI\openEuler\shimx64.efi
菜单标题:Windows Boot Manager, 启动文件:\EFI\Microsoft\Boot\bootmgfw.efi
菜单标题:grub2, 启动文件:\EFI\grub\grubx64.efi

这个应该是直接修改的主板的rom存储(需要bios电池供电的那个存储),和MBR模式修改启动顺序应该一样)

三、添加grub2引导:
管理员身份打开cmd
e:
cd E:\sys_tools\sys_tool\grub2_tools\grub-2.04-for-windows

mountvol M: /s
grub-install.exe --boot-directory=M:\ --efi-directory=M: --target=x86_64-efi

四、恢复esp分区
恢复,先删除盘符,再修改为esp分区类型
管理员身份打开cmd,使用diskpart

diskpart
select disk 0
select partition 1
SET ID=c12a7328-f81f-11d2-ba4b-00a0c93ec93b OVERRIDE

exit


五、grub2的配置文件:

function load_video {
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod all_video
}

load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2

set default=0
set timeout=3


menuentry "Local win10" --class windows --class os {
    insmod ntfs
    search --no-floppy --set=root -l 'SYSTEM'

    clear  
    echo "Start Windows"  
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi  
}


menuentry "Local OpenEulerOS" --class windows --class os {
    insmod ntfs
    search --no-floppy --set=root -l 'SYSTEM'

    clear  
    echo "Start OpenEulerOS"  
    chainloader /EFI/openEuler/grubx64.efi
}


menuentry "Restart"  --class windows --class os {
    insmod reboot
	reboot
}

menuentry "Power Off"  --class windows --class os{
    insmod halt
	halt
}

参考文档:
https://www.cnblogs.com/liuzhenbo/p/10809381.html
https://www.cnblogs.com/focus-g/p/11355350.html

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐