700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > linux gpt引导分区 linux 引导gpt分区windows及clover

linux gpt引导分区 linux 引导gpt分区windows及clover

时间:2020-11-15 02:35:54

相关推荐

linux gpt引导分区 linux 引导gpt分区windows及clover

原因:电脑采用gpt分区,安装了win10+linux(debian)+mac 10.11(El capitan),使用clover做引导器时,可以引导linux和mac,但通过bootmgfw.efi引导win10时无限转圈,不能正常启动win10。所以考虑用linux的grubx引导器。

1、引导Clocer

查看clover所在EFI分区uuid

执行命令:sudo blkid |grep EFI

/dev/sdb1: LABEL="EFI" UUID="67E3-17ED" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="88634925-55b0-497d-a4b7-c4965a7d66c7"

修改/boot/grub/grub.cfg,增加以下内容:

menuentry 'Clover (on /dev/sdb1)' --class Clover --class os

$menuentry_id_option 'osprober-efi-67E3-17ED' {

insmod part_gpt

insmod fat

set root='hd1,gpt1'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt167E3-17ED

else

search --no-floppy --fs-uuid --set=root 67E3-17ED

fi

chainloader /EFI/Boot/bootx64.efi

}

2、类似方法引导win10

menuentry 'Windows Boot Manager (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-efi-67E3-17ED' {

insmod part_gpt

insmod fat

set root='hd1,gpt1'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt167E3-17ED

else

search --no-floppy --fs-uuid --set=root 67E3-17ED

fi

chainloader /EFI/Microsoft/Boot/bootmgfw.efi

}

3、修改默认引导菜单和等待时间

通过set default修改默认引导菜单:

### BEGIN /etc/grub.d/00_header ###

if [ -s $prefix/grubenv ]; then

set have_grubenv=true

load_env

fi

if [ "${next_entry}" ] ; then

set default="${next_entry}"

set next_entry=

save_env next_entry

set boot_once=true

else

###以下修改引导菜单编号###

set default="3"

fi

通过set timeout修改引导等待时间

set timeout_style=menu

if [ "${timeout}" = 0 ]; then

set timeout=8

fi

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。