无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
楼主: hilsonma
打印 上一主题 下一主题

[分享] Grub2的简单使用

    [复制链接]
1#
发表于 2020-2-21 08:44:47 | 显示全部楼层
最近放弃了deepin

直接用回了xorboot

简单实用方便

O(∩_∩)O
回复

使用道具 举报

2#
发表于 2020-9-16 12:01:20 | 显示全部楼层
hilsonma 发表于 2019-12-27 16:17
经过wintoflash的努力,grub2现在有了wimboot、map、ntboot这几个强大的模块,并提供了强大的grubfm应用, ...

大大好像有弄出新玩具
是不是启动可以选择不同wim或vhd等等之类的选项列表


点评

是的,可以将wim/vhd/iso等放到一个文件夹,使用grub2自定义命令将这个文件夹自动列成菜单供选择启动。  详情 回复 发表于 2020-9-16 18:00
回复

使用道具 举报

3#
发表于 2020-9-17 10:36:11 | 显示全部楼层
hilsonma 发表于 2020-9-16 18:00
是的,可以将wim/vhd/iso等放到一个文件夹,使用grub2自定义命令将这个文件夹自动列成菜单供选择启动。

这是EFI的,家里的不想折腾

想折腾办公室的,有BIOS启动的吗?

点评

bios的我使用 grldr+siso 参见http://bbs.wuyou.net/forum.php?mod=redirect&goto=findpost&ptid=419354&pid=4001350&fromuid=586362 里面的新附件 也可以使用 grldr + grub2 见附件  详情 回复 发表于 2020-9-17 15:42
回复

使用道具 举报

4#
发表于 2023-5-6 22:36:52 来自手机 | 显示全部楼层
大大,我现在主力使用deepin系统,启动菜单是xieboot,我想换到Linux自带的grub启动菜单,但是win菜单是二级菜单,请教我该怎么增加一级菜单的menuentry的语句,系统一个uefi启动模式,Win10在第三个分区,win8vhd文件也在第三分区里面,大大有空看到的话帮我写写,谢谢您!

点评

建议使用wintoflash的grub2,先使用bcdboot在win10分区建立启动文件,然后菜单如下:  详情 回复 发表于 2023-5-7 16:23
回复

使用道具 举报

5#
发表于 2023-5-7 20:29:58 | 显示全部楼层
hilsonma 发表于 2023-5-7 16:23
建议使用wintoflash的grub2,先使用bcdboot在win10分区建立启动文件,然后菜单如下:

我直接使用linux系统自带的grub启动文件可以吗?

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### 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="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

font=unicode
set gfxmode=auto
if loadfont $font ; then
  set gfxmode=1366x768,1360x768,1280x720,1024x768,auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=zh_CN
  insmod gettext
echo
fi
if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  93525f2a-925b-408d-b3b7-7b3c981cfb98
else
  search --no-floppy --fs-uuid --set=root 93525f2a-925b-408d-b3b7-7b3c981cfb98
fi
    font="/usr/share/grub/unicode.pf2"
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=1
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=1
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/black
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Deepin 20.8 GNU/Linux' --class deepin --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-93525f2a-925b-408d-b3b7-7b3c981cfb98' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  93525f2a-925b-408d-b3b7-7b3c981cfb98
        else
          search --no-floppy --fs-uuid --set=root 93525f2a-925b-408d-b3b7-7b3c981cfb98
        fi
        linux        /boot/vmlinuz-5.18.17-amd64-desktop-community-hwe root=UUID=93525f2a-925b-408d-b3b7-7b3c981cfb98 ro  splash quiet  DEEPIN_GFXMODE=$DEEPIN_GFXMODE
        initrd        /boot/initrd.img-5.18.17-amd64-desktop-community-hwe
        boot
}

这是开头

点评

自带的没有ntboot模块,要启动vhd还要另外做启动文件 还有就是自带的我没有用过,不知道怎么修改主菜单。  详情 回复 发表于 2023-5-7 21:56
回复

使用道具 举报

6#
发表于 2023-5-8 10:15:50 | 显示全部楼层
hilsonma 发表于 2023-5-7 21:56
自带的没有ntboot模块,要启动vhd还要另外做启动文件

还有就是自带的我没有用过,不知道怎么修改主菜 ...

是的,VHD启动显示 错误:无法找到命令ntboot


没修改,是通过修改40_custom,再命令修改启动菜单的。

点评

那就不用ntboot 把vhd启动项做到win10菜单,这样,一级菜单是deepin和win,win是二级菜单,有win10和win8.vhd 还有一个做法就是在第三分区做vhd启动菜单,启动文件bootmgfw.efi改名为boot8.efi 在其他分区如第  详情 回复 发表于 2023-5-9 06:37
回复

使用道具 举报

7#
发表于 2023-5-16 16:46:28 | 显示全部楼层
hilsonma 发表于 2023-5-9 06:37
那就不用ntboot
把vhd启动项做到win10菜单,这样,一级菜单是deepin和win,win是二级菜单,有win10和win ...

VHD的boot8.efi放在哪里?VHD文件系统里面还是外面哪边?

点评

按照你说的,win8在vhd里,vhd文件在第三分区里。 在pe界面,挂载vhd文件成某盘,使用bcdboot将这个盘建立引导文件到vhd文件所在的分区(第三分区) 引导文件中包含了 \EFI\Microsoft\Boot\bootmgfw.efi 将这个  详情 回复 发表于 2023-5-17 06:59
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-12 04:51

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表