【2017.10.21】Windows下简单手动添加Deepin引导项
Tofloor
poster avatar
comzhong
deepin
2017-01-04 07:33
Author
本帖最后由 comzhong 于 2018-4-13 22:11 编辑

         Windows下手动添加Deepin引导,不能说是最好的方法,但是算是比较简单、实用
附件:
启动到Deepin引导菜单:win_grub2_deepin_2017.10.21.rar

Bootice_x86 x64_v1.3.4.zip
系统分区挂载管理1.4.0_x64_x86.zip
Notepad2 V5.0.26.0 绿色中文版.zip

======================
目录:
1 传统BIOS模式+MBR磁盘添加引导项
2 新型UFEI模式+GPT磁盘添加引导项
3 直接启动重要说明——直接启动deepin,不通过deepin的 /boot 分区中的grub
======================
重要补充说明
          如果文件系统不是 ext ,而是 btrfs 等等,不能启动 deepin,需要在 附件的 菜单:/boot/grub/grub.cfg 中,在:set timeout=0 下面添加如:insmod btrfs 等模块,以支持相应的文件系统。

……
set timeout=0
insmod btrfs
……
======================

     1 传统BIOS模式+MBR磁盘添加引导项
                1.1  使用附件:win_grub2_deepin 解压到C盘。

                1.2  打开bootice——BCD编辑——当前系统BCD——智能编辑模式,添加Grub4dos启动项,选择添加——新建实模式启动项(Grub/Linux),填写菜单标题(Deepin Linux)和启动文件路径(\boot\grub\grldr.mbr),保存当前系统设置,关闭bootice。

       2 新型UFEI模式+GPT磁盘添加引导项
                         2.1 下载挂载管理系统分区批处理系统分区挂载管理1.4.0_x64_x86.zip以管理员权限运行
1) 首先选择1挂载系统分区,根据提示挂载ESP分区.
2) 再选择3.  文件管理器 ,会打开一个资源管理器窗口,这个时候就可以在这个资源管理器窗口里面正常操作ESP分区文件了。
3) 操作完成后选择2.卸载系统分区,去卸载挂载的ESP分区。

                        2.2 启动到Deepin引导菜单使用附件:win_grub2_deepin 解压到到ESP分区。


                        2.3 添加UEFI启动序列,打开bootice,按下图添加启动序列,之后就可以在启动时按F12 或 ESC 选择了 , 或者在这里调整顺序为第一,或者较新的电脑可以进BIOS设置调整顺序也可以



       3 启动不成功             附件中的 grub.cfg 若不能成功启动,请用附件中 notepad2 编辑修改 /boot/grub/grub.cfg 内容,set root=(hd1,4) 如何确定请参见 5  判断启动分区号。
==============================
set prefix=(${root})/boot/Grub
set timeout=0
insmod btrfs

menuentry "Deepin Linux"{
         set root=(hd1,4)
        set prefix=($root)/boot/grub
        configfile  $prefix/grub.cfg
}
==============================


       4  直接启动重要说明——直接启动deepin,不通过deepin的 /boot 分区中的grub
                        菜文件为:/boot/grub/grub.cfg,菜单为UTF-8无BOM格式,编码不对可能出错,可以使用附件中 notepad2 编辑。

grub2 的第一磁盘好像是 grub2 所处磁盘,Linux 第一磁盘好像是 内核所处磁盘,所以双硬盘的要注意了。
==================================
set prefix=(${root})/boot/Grub
set timeout=0

menuentry "Deepin Linux"{
        set root=(hd0,4)
        linux /vmlinuz root=/dev/sda4 ro quiet splash
        initrd /initrd.img
}
=================================



5  判断启动分区号

grub2          Linux
(hd0,1)      /dev/sda1         第一硬盘的第一分区(通用于MBR与GPT分区)
(hd0,2)     /dev/sda2         第一硬盘的第二分区(通用于MBR与GPT分区)

(hd1,1)     /dev/sdb1         第二硬盘的第一分区(通用于MBR与GPT分区)
(hd1,2)     /dev/sdb2         第二硬盘的第二分区(通用于MBR与GPT分区)

5.1 grub2 命令行判断
         将附件中 /boot/grub/grub.cfg 修改 “set timeout=0” 时间改长,比如 “set timeout=10” ,删除后面的内容,启动到 grub2 菜单,按 C 进入 grub2 命令行,用 “ls” 命令查看有那些分区。

         再用 “ls (hd0,1)/” 看分区根目录文件,判断分区内容,比如deepin单分区时 “ls (hd1,3)/” 出现 deepin 分区文件,那么用下面两条命令
======================
set root=(hd1,3)
set prefix=($root)/boot/grub
configfile $prefix/grub.cfg
======================
应该就加载deepin 的 grub2 菜单了。之后进系统,修改前面 放在 Windows 下的gurb 2 菜单。

5.2 自己观察判断
比如:我是单硬盘 GPT分区表,linux 分区位于磁盘第 4 分区,则菜单中要改为:set root=(hd0,4) 和 root=/dev/sda4
比如:如果是单硬盘 MBR 分区表,主分区号依次是 1、2、3、4,不管有多少个主分区,扩展分区从 5 开始,依次是 5、6、7、8……。
           如下图,,linux 分区位于磁盘第一个扩展分区即第 5 分区,则菜单中要改为:set root=(hd0,5) 和 root=/dev/sda5
=====================================
硬盘安装和U盘安装Deepin_最简单iSO启动方法
https://bbs.deepin.org/post/135051

Reply Favorite View the author
All Replies
...6 / 7
To page
sdwfwmj
deepin
2017-10-22 19:14
#101
这个得标记下
Reply View the author
dzuiuabi
deepin
2017-10-23 05:35
#102
你好!

     hen'rong'xing
     很荣幸可以看到您的这个帖子。
     在没有看到你这个帖子以先,我是进不了Grub的,也看不到熟悉的Grub2的引导界面。但是当我回车确认Deepin的时候却出现了一些问题,大致描述如下:
     可以看到Deepin Linux的引导项,但是运行确认了以后却不能正常打开Linux,提示:
     出现这个问题,是我已经安装好了Linux,然后我又在我的Pc上升级了Windows10,导致进入不了Linux,我很困惑。按照您的方法我试过很多遍。
     希望您能在看到以后抽出一点宝贵的时间帮助一下我!万分感谢!!
Reply View the author
dzuiuabi
deepin
2017-10-23 05:36
#103
你好!

     hen'rong'xing
     很荣幸可以看到您的这个帖子。
     在没有看到你这个帖子以先,我是进不了Grub的,也看不到熟悉的Grub2的引导界面。但是当我回车确认Deepin的时候却出现了一些问题,大致描述如下:
     可以看到Deepin Linux的引导项,但是运行确认了以后却不能正常打开Linux,提示:No symbol table....然后就是黑底白字的命令行界面,不过我从未见过。
     出现这个问题,是我已经安装好了Linux,然后我又在我的Pc上升级了Windows10,导致进入不了Linux,我很困惑。按照您的方法我试过很多遍。
     希望您能在看到以后抽出一点宝贵的时间帮助一下我!万分感谢!!
Reply View the author
comzhong
deepin
2017-10-23 06:12
#104
https://bbs.deepin.org/post/133725
你好!

     hen'rong'xing

you could try command in grub2 Boot interface.

when you could see the grub2 menu, press "C" for command-line ,then to use command like this:

  1. ls
  2. ls (hd0,1)/
  3. ls (hd0,2)/
  4. ls (hd0,3)/
Copy the Code

     and so on , until find those files of deepin, example (hd0,5)

then try :
  1. set root=(hd0,5)
  2. set prefix=($root)/boot/grub
  3. configfile  $prefix/grub.cfg
Copy the Code

       then you could see this menu:

    at the last, you should rewrite the /boot/grub/grub.cfg in partition of windows10。


  1. set prefix=(${root})/boot/Grub
  2. set timeout=0
  3. insmod btrfs

  4. menuentry "Deepin Linux"{
  5.          set root=(hd0,5)
  6.         set prefix=($root)/boot/grub
  7.         configfile  $prefix/grub.cfg
  8. }
Copy the Code


   if you couldn't find the  those files of deepin , mabey need fix the partition of deepin,I'm not sure。
Reply View the author
dzuiuabi
deepin
2017-10-24 01:46
#105
https://bbs.deepin.org/post/133725
you could try command in grub2 Boot interface.

when you could see the grub2 menu, press "C" for c ...

Thank you for your answer.
This problem has been resolved because my main partition is not closed and damaged.
When I use the FS repair command under Live CD, then I can open my Deepin
Reply View the author
1***2@qq.com
deepin
2018-04-11 06:26
#106
谢谢大佬!
按照1 传统BIOS模式+MBR磁盘添加引导项
做好了!!!!!!
Reply View the author
132******02
deepin
2018-04-13 21:57
#107
本帖最后由 q13140676165 于 2018-4-13 14:00 编辑

问一下我在你5.1步骤下可以输入命令跳转到deepin grub2选择系统,但是那个window grub2怎么关掉呀,让他直接跳转到deepin grub2呀
Reply View the author
132******02
deepin
2018-04-14 03:28
#108
我的grub.cfg这样写为什么没反应呀,点那个deepin的还是在grub下,并没有跳转到deepin启动项上
Reply View the author
netzx
deepin
2018-04-14 05:02
#109
楼主威武!此贴解决了困扰我已久的启动问题。
Reply View the author
comzhong
deepin
2018-04-14 06:16
#110
https://bbs.deepin.org/post/133725
问一下我在你5.1步骤下可以输入命令跳转到deepin grub2选择系统,但是那个window grub2怎么关掉呀,让他直接 ...

将 EFI/启动 分区的  /boot/grub/grub.cfg 里面内容写好,设置:set timeout=0 就立即执行了

set prefix=(${root})/boot/Grub
set timeout=0
insmod btrfs

menuentry "Deepin Linux"{
         set root=(hd1,4)
        set prefix=($root)/boot/grub
        configfile  $prefix/grub.cfg
}
Reply View the author
comzhong
deepin
2018-04-14 06:18
#111
https://bbs.deepin.org/post/133725
我的grub.cfg这样写为什么没反应呀,点那个deepin的还是在grub下,并没有跳转到deepin启动项上
...

set root=(hd0,3) 是第一硬盘第 3 分区,是 deepin 的 /boot 所在分区吗?
Reply View the author
gongyf
deepin
2018-04-14 08:23
#112
这个学到了,收藏
Reply View the author
132******02
deepin
2018-04-14 15:27
#113
本帖最后由 q13140676165 于 2018-4-14 07:37 编辑
https://bbs.deepin.org/post/133725
set root=(hd0,3) 是第一硬盘第 3 分区,是 deepin 的 /boot 所在分区吗?

我在grub内(就是电脑黑屏下)写hd0,3是可以跳转到deepin启动项的,但是我不知道怎么点击"Deepin Linux"直接跳转到deepin启动引导选择界面,我点击"Deepin Linux"跳转的是grub界面,就是那个黑屏写代码的界面,我还要输入一遍代码才跳转到deepin引导界面
Reply View the author
132******02
deepin
2018-04-14 16:16
#114
https://bbs.deepin.org/post/133725
将 EFI/启动 分区的  /boot/grub/grub.cfg 里面内容写好,设置:set timeout=0 就立即执行了

set prefix ...

请问修改哪里的grub.cfg,我是mbr分区的,我修改的是c盘 /Boot/grub/grub.cfg,感觉修改这个没啥用,系统好似不读取这个文件,直接跳转到grub2界面(黑屏界面),然后我输入代码才能进入deepin的启动项选择界面
Reply View the author
132******02
deepin
2018-04-14 16:16
#115
https://bbs.deepin.org/post/133725
将 EFI/启动 分区的  /boot/grub/grub.cfg 里面内容写好,设置:set timeout=0 就立即执行了

set prefix ...

请问修改哪里的grub.cfg,我是mbr分区的,我修改的是c盘 /Boot/grub/grub.cfg,感觉修改这个没啥用,系统好似不读取这个文件,直接跳转到grub2界面(黑屏界面),然后我输入代码才能进入deepin的启动项选择界面
Reply View the author
132******02
deepin
2018-04-14 16:17
#116
https://bbs.deepin.org/post/133725
将 EFI/启动 分区的  /boot/grub/grub.cfg 里面内容写好,设置:set timeout=0 就立即执行了

set prefix ...

请问修改哪里的grub.cfg,我是mbr分区的,我修改的是c盘 /Boot/grub/grub.cfg,感觉修改这个没啥用,系统好似不读取这个文件,直接跳转到grub2界面(黑屏界面),然后我输入代码才能进入deepin的启动项选择界面
Reply View the author
comzhong
deepin
2018-04-15 01:10
#117
https://bbs.deepin.org/post/133725
请问修改哪里的grub.cfg,我是mbr分区的,我修改的是c盘 /Boot/grub/grub.cfg,感觉修改这个没啥用,系统好似 ...

grub2 命令行输入:echo $root    看看是哪个分区的  /Boot/grub/grub.cfg
Reply View the author
132******02
deepin
2018-04-15 01:56
#118
comzhong 发表于 2018-4-14 17:10
grub2 命令行输入:echo $root    看看是哪个分区的  /Boot/grub/grub.cfg

上面写的can't find command 'echo'
Reply View the author
comzhong
deepin
2018-04-15 02:14
#119
https://bbs.deepin.org/post/133725
上面写的can't find command 'echo'

你看看 bootice 看看 BCD 里面 启动项信息
Reply View the author
132******02
deepin
2018-04-15 02:17
#120
https://bbs.deepin.org/post/133725
你看看 bootice 看看 BCD 里面 启动项信息

能聊qq吗,大神,我qq 1909008351
Reply View the author
...6 / 7
To page