请看最新更新版: grub4dos初级教程 -入门篇、应用篇【07-03-27更新】
http://www.cn-dos.net/forum/viewthread.php?tid=28300&fpage=1
说明:更新部分内容,为便于阅读,合并“入门篇“与”应用篇”,pdf图文版可去我网盘下载或去时空论坛下载。(本站目前似乎已无法发附件)
-------------------------------------------------
grub4dos初级教程-应用篇
lianjiang 2007.03.14 第二次修改
1 硬盘上的应用
2 光盘上的应用
3 软盘上的应用
4 优盘上的应用
5 结言
6 致谢
注:1) 本教程引用的很多资料均来自于互联网,版权归原网站或者原作者所有。
2) 请先参阅“grub4dos初级教程-入门篇”
3) 应用环境为windows/dos。
4)本人接触grub不久,对grub的了解还很肤浅,错误之处,敬请指出。
******************************************************************
1 硬盘上应用
硬盘上应用grub,首先要进行安装,安装/启动方式主要有3中,即a,通过Windows NT的启动菜单进入grub4dos;b,通过DOS启动grub;c, 通过mbr启动grub。
安装完grub后,需要准备菜单文件menu.lst。
1.1 加载软盘镜像。
对于Windows用户,用grub加载软盘镜象是最常用的功能之一。由于windows2k/xp已脱离了dos,因此进行包括系统备份/恢复在内的一些dos下操作,成为初学者的一个难题。以前我们可能就需要用启动光盘等才能进入dos,光盘的特性决定了很难及时方便地更新光盘上的工具。grub的出现与应用,解决了这个难题。我们不仅无需借助其它的介质就能进入dos环境,而且能及时更新工具。网上下载的各种系统维护工具,很多都是img形式,无需把文件提取出来,稍微修改menu.lst就能使用,各种工具也能和谐共处,使用非常方便。
如何把下载的xxx.img加入grub启动菜单呢?
你只要把xxx.img保存到C:\boot\grub目录下,编辑menu.lst,加入下面内容就行了。
title Boot from Floppy image XXX
map --mem /boot/grub/xxx.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
注意:这几行内容不能加在最前面,因为前面是一些对全局有效的设置。
你需要的工具都可以这种方式加进去。
也许你有很多工具,都加进menu的话,显得很乱。平时常用的可能也就一两个工具,不少只是偶尔一用。对于这种情况,可以采取下面的方法。即:把常用的写入菜单,同时在菜单中写一个通用启动img文件的内容。比如上面的
title Boot from Floppy image XXX
map --mem /boot/grub/xxx.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
这样可以在启动grub进入菜单后,选择“Boot from Floppy image XXX”后,按“e”进入编辑状态,移动方向键,修改xxx.img为需要启动的文件名,回车,按“b”启动即可。(img文件保存在其它路径的话,则改成相应的路径。)
1.2 启动WinPE。
有些系统维护操作在dos下操作不太方便,甚至不能进行。WinPE的出现,给我们带来了很多方便。下面以广受好评的老毛桃修改的光棍版WinPE为例,介绍如何用grub启动WinPE。(光棍版WinPE中已带有安装程序,我这里介绍的是在menu.lst中加入通用的winpe选项。)
步骤:1,下载光棍版WinPE,解压后得到BootCD.ISO。
2, 用虚拟光驱或UltraISO等提取iso中的WINPE.IS_,WINNT.XPE和WXPE\SETUPLDR.BIN,把这3个文件拷贝到C:\,并把SETUPLDR.BIN改名为ldrxpe。需要外置程序的,还需把XPEMENU.INI和“外置程序”目录一起拷贝到任一盘符的根目录。
3,在menu.lst中加入
title Micro Windows XPE (by LaoMaotao)
chainloader /ldrxpe
这样启动grub时选择“Micro Windows XPE (by LaoMaotao)”就能启动WinPE了。
1.3 启动系统
对于单一硬盘装了多系统及多硬盘装了多系统的,用grub可以方便地对各系统进行启动管理。
比如在menu.lst中可加入下面的选项:
title 启动第一硬盘第一主分区(hd0,0)上的操作系统
rootnoverify (hd0,0)
makeactive
chainloader +1
title 启动第一硬盘第二主分区(hd0,1)上的操作系统
rootnoverify (hd0,1)
makeactive
chainloader +1
title 启动第二硬盘第一主分区(hd1,0)上的操作系统
rootnoverify (hd1,0)
makeactive
chainloader +1
title 启动Windows NT/2000/XP/2003
find --set-root /ntldr
chainloader /ntldr
title 启动Microsoft Windows Vista
find --set-root /bootmgr
chainloader /bootmgr
title 启动DOS/Windows 95/98/Me
find --set-root /io.sys
chainloader /io.sys
******************************************************************
2 光盘上的应用
下面介绍两种在光盘上应用grub的方法。
2.1 grub引导的可启动光盘
以grldr作为光盘的启动文件引导光盘,加载menu.lst,通过menu菜单选择启动项目。
步骤:1) 准备必要的img文件,及grldr,menu.lst(根据需要准备字体,背景图片,memdisk.gz等文件)。
2) 编辑menu.lst。引导光盘上的img文件的格式如下:
title Win98 (MAP-HOOK-1)
map --mem (cd)/boot/grub/win98.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
菜单中也可引导硬盘上的img文件,比如:
title GreenGhost (MEMDISK)
kernel (hd0,4)/boot/grub/memdisk.gz c=200 h=2 s=36 floppy
initrd (hd0,4)/boot/grub/gghost.img c=200 h=2 s=36 floppy
3) 组织文件。比如在E:\temp下建个grubcd目录,把menu.lst拷贝到此目录下,menu.lst文件将在光盘根目录下。在此目录下建boot\grub目录,保存各种img,字体等文件。注意:menu.lst文件中引用的所有文件的文件名在硬盘上显示的需是小写,大写的要改成小写。
4) 制作ISO。用UltraISO新建一个ISO文件,把E:\temp\grubcd目录下的所有文件加入iso文件;执行“启动光盘”-“加载引导文件”,选择grldr文件。再执行“文件”-“属性”,选上“允许小写字母”选项,保存ISO文件。
也可使用mkisofs.exe或CDIMAGE.EXE等工具制作启动iso。
5) 用nero等把制作的可启动ISO刻盘。有条件的可先在虚拟机上测试通过后刻盘,或用CD-RW/DVD+RW刻盘。
2.2 BCDW引导GRUB的可启动光盘
此法是用BCDW制作启动光盘,通过BCDW执行grub来加载grub菜单。
步骤:1) 首先下载BCDW软件包,解压后获取所需文件。
2)组织文件。比如在E:\temp下建个bcdwcd目录,此目录下文件将在光盘根目录下,下面建boot\grub目录和bcdw目录,把软件包中bcdw目录下的bcdw.bin,bcdw.ini和loader.bin拷贝到所建的bcdwcd\bcdw目录下;把grldr、各种img、字体等文件拷贝到bcdwcd\boot\grub目录。menu.lst文件的编辑方法与上面2.1中介绍的相同。
3) 编辑bcdw.ini文件。打开bcdw.ini,找到部分,比如:
C:\ ; Boot from drive C:
\WNPE\setupldr.bin ; Bart's Preinstalled Environment
\I386\setupldr.bin ; Microsoft Windows XP Setup
\BCDW\bcdw2dos.ima \WIN9X\setup.exe ; Microsoft Windows 98 Setup
上面的就是BCDW启动菜单的例子。在其中加上grub项,变成:
\boot\grub\grldr ; Grub4dos
C:\ ; Boot from drive C:
\WNPE\setupldr.bin ; Bart's Preinstalled Environment
\I386\setupldr.bin ; Microsoft Windows XP Setup
\BCDW\bcdw2dos.ima \WIN9X\setup.exe ; Microsoft Windows 98 Setup
4)制作ISO文件与刻录ISO的方法与2.1中的基本相同。所不同的只是在制作ISO文件时,需把loader.bin作为ISO的引导文件。也可使用mkisofs.exe或CDIMAGE.EXE等工具制作启动iso。
******************************************************************
3 软盘上的应用
在软盘上应用grub,主要有两种方式,即通过DOS启动grub和把GRLDR引导记录安装到软盘的引导扇区(安装方法参看“grub4dos初级教程-入门篇”)。
3.1 通过DOS启动grub的软盘应用
先把软盘制作成启动盘,最简单的,软盘中只需io.sys,msdos.sys和command.com三个文件。
再把grub.exe和menu.lst拷贝到软盘根目录。
新建一个autoexec.bat文件,里面只需写上4个字母。
grub
然后编辑menu.lst,由于软盘容量所限,一般很难直接在menu中调用软盘上的img文件,因此,主要可用来启动硬盘上的img文件,还可用于对各系统进行启动管理。菜单文件中使用的指定路径的文件(如字体,img文件等),应预先准备好,否则该选项不能运行。(网上也有在软盘有限的容量里,包括众多维护工具的实例,感兴趣的可自行搜索。)
menu.lst文件的例子:
timeout 10
default 0
splashimage (fd0)/boot/grub/xp2008.gz
fontfile (fd0)/boot/grub/fonts
title GreenGhost (MAP-HOOK)
map --mem (hd0,4)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title 寻找硬盘上的/menu.lst
find --set-root /menu.lst
configfile /menu.lst
title 启动第一硬盘第一主分区(hd0,0)上的操作系统
rootnoverify (hd0,0)
makeactive
chainloader +1
title 启动第一硬盘第二主分区(hd0,1)上的操作系统
rootnoverify (hd0,1)
makeactive
chainloader +1
title 启动第二硬盘第一主分区(hd1,0)上的操作系统
rootnoverify (hd1,0)
makeactive
chainloader +1
title 重启
reboot
title 关机
halt
3.2 引导扇区安装了GRLDR引导记录的软盘应用
GRLDR引导记录安装后,在软盘上只需保留有grldr和menu.lst及menu.lst中引用到的文件。menu.lst文件与“3.1 通过DOS启动grub”的软盘中的使用是一样的。
******************************************************************
4 优盘上的应用
在优盘上应用grub,与软盘类似,主要有两种方式,即通过DOS启动grub和把GRLDR引导记录安装到优盘的引导扇区(安装方法参看“grub4dos初级教程-入门篇”)。
首先把U盘用优盘自带工具或usboot,flashboot等制作成dos启动盘,同时设置电脑的cmos里相应的选项,看优盘能否启动进入dos,能的话,可继续往下阅读;不能启动的话,可尝试不同模式、用其它制作工具等,能启动后再往下阅读。
不同的启动模式,U盘启动进入dos后,在你的电脑上可能是A盘,也可能C盘。
由于u盘容量大,在u盘上就可以存放各种工具及WinPE。
当显示为A盘时,使用方法类似于软盘。
menu.lst文件中启动img镜像文件的用法如:
title GreenGhost (MAP-HOOK)
map --mem (fd0)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
当显示为C盘时,使用方法类似于硬盘。
menu.lst文件中启动img镜像文件的用法如:
title GreenGhost (MAP-HOOK)
map --mem (hd0,0)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
在上面的例子里,menu.lst中引用文件使用的是绝对路径,即(fd0)/boot/grub/gghost.img和(hd0,0)/boot/grub/gghost.img,这种用法对于特定的机子是没有问题的。但在同一U盘,要使用到不同机子时,可能带来一个问题。也就是可能不同的机子,要用不同的menu.lst文件,否则不能正常启动工具。那么,能否用什么办法,不用这么麻烦呢?答案是肯定的,那就是使用"find --set-root"和相对路径来实现。这样就不必为U盘被识别为fd还是hd烦恼了。
比如,你可以在u盘根目录建一个特征文件,如myudisk.txt
这样在启动u盘上的img镜像文件就可用下面的方法来实现:
title GreenGhost (MAP-HOOK)
find --set-root /myudisk.txt
map --mem /boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
启动u盘上的WinPE就可用:
title Micro Windows XPE (by LaoMaotao)
find --set-root /myudisk.txt
chainloader /ldrxpe
参考其它示例,通过编辑你的menu.lst,你就能够充分发挥U盘的效能。
******************************************************************
5 结言
本文写的仅仅是grub4dos的一些最基本应用,Grub4dos更多的功能有待你去尝试和挖掘。
希望这篇文章有助于你更快地把grub4dos使用起来。
更期待能分享你的成果。
注:我的网盘:
http://lianjiang2004.ys168.com 也提供部分grub相关文件及资料的下载。
推荐论坛:
时空论坛:
http://bbs.znpc.net
中国DOS联盟论坛:
http://www.cn-dos.net/forum/
无忧启动论坛:
http://bbs.wuyou.com
******************************************************************
6 致谢
本文的完成,参考、引用了众多的资料,不少已找不到原始出处。初稿完成后,不少网友指出了其中的不足之处,并提出了修改的建议,也得到了软件开发者的支持和鼓励。在此一并表示感谢。
lianjiang 2007.03.13 初稿
2007.03.13 第一次修改
2007.03.14 第二次修改
Last edited by lianjiang2004 on 2007-3-29 at 09:01 PM ]
Please see the latest updated version: grub4dos Beginner's Tutorial - Introduction Chapter, Application Chapter
http://www.cn-dos.net/forum/viewthread.php?tid=28300&fpage=1
Description: Update some content. For easy reading, merge "Introduction Chapter" and "Application Chapter". The PDF graphic version can be downloaded from my network disk or from the Space Forum. (It seems that the site can no longer attach files currently)
-------------------------------------------------
grub4dos Beginner's Tutorial - Application Chapter
lianjiang 2007.03.14 Second Revision
1 Application on Hard Disk
2 Application on CD
3 Application on Floppy Disk
4 Application on USB Flash Drive
5 Conclusion
6 Acknowledgments
Note: 1) Many materials cited in this tutorial are from the Internet, and the copyright belongs to the original website or the original author.
2) Please refer to "grub4dos Beginner's Tutorial - Introduction Chapter" first.
3) The application environment is Windows/DOS.
4) I have just come into contact with grub and have a very superficial understanding of grub. Please point out any errors.
******************************************************************
1 Application on Hard Disk
To apply grub on a hard disk, you first need to install it. The installation/booting methods are mainly 3 types, namely a, enter grub4dos through the boot menu of Windows NT; b, boot grub through DOS; c, boot grub through MBR.
After installing grub, you need to prepare the menu file menu.lst.
1.1 Loading Floppy Disk Image
For Windows users, using grub to load a floppy disk image is one of the most commonly used functions. Since Windows 2K/XP has been separated from DOS, performing some operations under DOS such as system backup/recovery has become a difficult problem for beginners. Previously, we might need to use a boot CD, etc., to enter DOS. The characteristics of the CD determine that it is difficult to update the tools on the CD in a timely and convenient manner. The appearance and application of grub have solved this problem. We can not only enter the DOS environment without using other media, but also update tools in a timely manner. Many of the various system maintenance tools downloaded from the Internet are in img format. Without extracting the files, we can use them by slightly modifying menu.lst, and various tools can coexist harmoniously, which is very convenient to use.
How to add the downloaded xxx.img to the grub boot menu?
You just need to save xxx.img to the C:\boot\grub directory, edit menu.lst, and add the following content.
title Boot from Floppy image XXX
map --mem /boot/grub/xxx.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
Note: These lines of content cannot be added at the very beginning because the previous ones are some settings that are effective globally.
All the tools you need can be added in this way.
Maybe you have many tools, and adding them all to the menu will make it messy. Usually, there may be only one or two commonly used tools, and many are only used occasionally. For this situation, you can take the following method. That is, write the commonly used ones into the menu, and at the same time write the content of a general startup img file in the menu. For example, the above
title Boot from Floppy image XXX
map --mem /boot/grub/xxx.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
In this way, after starting grub and entering the menu, select "Boot from Floppy image XXX", press "e" to enter the editing state, move the direction keys, modify xxx.img to the file name you need to start, press Enter, and press "b" to start. (If the img file is saved in another path, change it to the corresponding path.)
1.2 Booting WinPE
Some system maintenance operations are not convenient or even cannot be performed under DOS. The appearance of WinPE has brought us a lot of convenience. The following takes the widely praised光棍版 WinPE modified by LaoMaotao as an example to introduce how to use grub to boot WinPE. (The光棍版 WinPE already has an installation program. Here, I will introduce adding a general winpe option in menu.lst.)
Steps: 1. Download the光棍版 WinPE, extract it to get BootCD.ISO.
2. Use a virtual CD-ROM or UltraISO, etc., to extract WINPE.IS_, WINNT.XPE, and WXPE\SETUPLDR.BIN from the ISO, copy these 3 files to C:\, and rename SETUPLDR.BIN to ldrxpe. If external programs are needed, also copy XPEMENU.INI and the "external program" directory to the root directory of any disk.
3. Add the following in menu.lst
title Micro Windows XPE (by LaoMaotao)
chainloader /ldrxpe
In this way, when you start grub and select "Micro Windows XPE (by LaoMaotao)", you can boot WinPE.
1.3 Booting Systems
For a single hard disk with multiple systems installed and multiple hard disks with multiple systems installed, grub can be used to conveniently manage the booting of each system.
For example, you can add the following options in menu.lst:
title Boot the operating system on the first primary partition (hd0,0) of the first hard disk
rootnoverify (hd0,0)
makeactive
chainloader +1
title Boot the operating system on the second primary partition (hd0,1) of the first hard disk
rootnoverify (hd0,1)
makeactive
chainloader +1
title Boot the operating system on the first primary partition (hd1,0) of the second hard disk
rootnoverify (hd1,0)
makeactive
chainloader +1
title Boot Windows NT/2000/XP/2003
find --set-root /ntldr
chainloader /ntldr
title Boot Microsoft Windows Vista
find --set-root /bootmgr
chainloader /bootmgr
title Boot DOS/Windows 95/98/Me
find --set-root /io.sys
chainloader /io.sys
******************************************************************
2 Application on CD
The following introduces two methods to apply grub on a CD.
2.1 Bootable CD guided by grub
Use grldr as the boot file of the CD to guide the CD, load menu.lst, and select the boot item through the menu.
Steps: 1) Prepare necessary img files, and grldr, menu.lst (prepare font, background image, memdisk.gz, etc., files as needed).
2) Edit menu.lst. The format to guide the img file on the CD is as follows:
title Win98 (MAP-HOOK-1)
map --mem (cd)/boot/grub/win98.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
The menu can also guide the img file on the hard disk, for example:
title GreenGhost (MEMDISK)
kernel (hd0,4)/boot/grub/memdisk.gz c=200 h=2 s=36 floppy
initrd (hd0,4)/boot/grub/gghost.img c=200 h=2 s=36 floppy
3) Organize files. For example, create a grubcd directory under E:\temp, copy menu.lst to this directory, and the menu.lst file will be in the root directory of the CD. Create a boot\grub directory under this directory to save various img, font, etc., files. Note: The file names of all files referenced in menu.lst that are displayed on the hard disk need to be lowercase, and uppercase ones need to be changed to lowercase.
4) Make ISO. Use UltraISO to create a new ISO file, add all files in the E:\temp\grubcd directory to the ISO file; perform "Boot CD" - "Load Boot File", select the grldr file. Then perform "File" - "Properties", select the "Allow lowercase letters" option, and save the ISO file.
You can also use tools such as mkisofs.exe or CDIMAGE.EXE to make a bootable ISO.
5) Burn the made bootable ISO with Nero, etc. If conditions permit, you can test it in a virtual machine first and then burn it, or use CD-RW/DVD+RW to burn it.
2.2 Bootable CD with BCDW guiding GRUB
This method is to use BCDW to make a bootable CD, and execute grub through BCDW to load the grub menu.
Steps: 1) First download the BCDW software package, extract it to get the required files.
2)Organize files. For example, create a bcdwcd directory under E:\temp. The files in this directory will be in the root directory of the CD. Create a boot\grub directory and a bcdw directory under it. Copy bcdw.bin, bcdw.ini, and loader.bin from the bcdw directory in the software package to the created bcdwcd\bcdw directory; copy grldr, various img, font, etc., files to the bcdwcd\boot\grub directory. The editing method of the menu.lst file is the same as introduced in 2.1 above.
3) Edit the bcdw.ini file. Open bcdw.ini, find the part, for example:
C:\ ; Boot from drive C:
\WNPE\setupldr.bin ; Bart's Preinstalled Environment
\I386\setupldr.bin ; Microsoft Windows XP Setup
\BCDW\bcdw2dos.ima \WIN9X\setup.exe ; Microsoft Windows 98 Setup
The above is an example of the BCDW boot menu. Add the grub item in it to become:
\boot\grub\grldr ; Grub4dos
C:\ ; Boot from drive C:
\WNPE\setupldr.bin ; Bart's Preinstalled Environment
\I386\setupldr.bin ; Microsoft Windows XP Setup
\BCDW\bcdw2dos.ima \WIN9X\setup.exe ; Microsoft Windows 98 Setup
4)The method of making the ISO file and burning the ISO is basically the same as in 2.1. The difference is that when making the ISO file, loader.bin needs to be used as the boot file of the ISO. You can also use tools such as mkisofs.exe or CDIMAGE.EXE to make a bootable ISO.
******************************************************************
3 Application on Floppy Disk
There are mainly two ways to apply grub on a floppy disk, namely booting grub through DOS and installing the GRLDR boot record to the boot sector of the floppy disk (for the installation method, refer to "grub4dos Beginner's Tutorial - Introduction Chapter").
3.1 Application of Floppy Disk Booted by grub through DOS
First, make the floppy disk into a bootable disk. The simplest way is that the floppy disk only needs three files: io.sys, msdos.sys, and command.com.
Then copy grub.exe and menu.lst to the root directory of the floppy disk.
Create a new autoexec.bat file, which only needs to write 4 letters.
grub
Then edit menu.lst. Due to the limited capacity of the floppy disk, it is generally difficult to directly call the img file on the floppy disk in the menu. Therefore, it can mainly be used to boot the img file on the hard disk and also to manage the booting of each system. The files with specified paths used in the menu file (such as fonts, img files, etc.) should be prepared in advance, otherwise the option cannot run. (There are also examples on the Internet of including many maintenance tools in the limited capacity of the floppy disk. Those who are interested can search by themselves.)
An example of the menu.lst file:
timeout 10
default 0
splashimage (fd0)/boot/grub/xp2008.gz
fontfile (fd0)/boot/grub/fonts
title GreenGhost (MAP-HOOK)
map --mem (hd0,4)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title Find /menu.lst on the hard disk
find --set-root /menu.lst
configfile /menu.lst
title Boot the operating system on the first primary partition (hd0,0) of the first hard disk
rootnoverify (hd0,0)
makeactive
chainloader +1
title Boot the operating system on the second primary partition (hd0,1) of the first hard disk
rootnoverify (hd0,1)
makeactive
chainloader +1
title Boot the operating system on the first primary partition (hd1,0) of the second hard disk
rootnoverify (hd1,0)
makeactive
chainloader +1
title Reboot
reboot
title Shutdown
halt
3.2 Application of Floppy Disk with GRLDR Boot Record Installed in the Boot Sector
After the GRLDR boot record is installed, only grldr and menu.lst and the files referenced in menu.lst need to be retained on the floppy disk. The use of the menu.lst file is the same as in "3.1 Booting grub through DOS" on the floppy disk.
******************************************************************
4 Application on USB Flash Drive
To apply grub on a USB flash drive, it is similar to a floppy disk. There are mainly two ways, namely booting grub through DOS and installing the GRLDR boot record to the boot sector of the USB flash drive (for the installation method, refer to "grub4dos Beginner's Tutorial - Introduction Chapter").
First, use the built-in tools of the USB flash drive or usboot, flashboot, etc., to make the USB flash drive into a DOS bootable disk. At the same time, set the corresponding options in the computer's CMOS to see if the USB flash drive can boot into DOS. If it can, you can continue reading; if it cannot boot, you can try different modes, use other making tools, etc., and continue reading after it can boot.
In different boot modes, after the USB flash drive boots into DOS, it may be drive A or drive C on your computer.
Since the USB flash drive has a large capacity, various tools and WinPE can be stored on the USB flash drive.
When it is displayed as drive A, the usage method is similar to that of a floppy disk.
The usage of starting the img image file in the menu.lst file is as follows:
title GreenGhost (MAP-HOOK)
map --mem (fd0)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
When it is displayed as drive C, the usage method is similar to that of a hard disk.
The usage of starting the img image file in the menu.lst file is as follows:
title GreenGhost (MAP-HOOK)
map --mem (hd0,0)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
In the above example, the menu.lst uses an absolute path to reference files, that is, (fd0)/boot/grub/gghost.img and (hd0,0)/boot/grub/gghost.img. This usage is no problem for a specific machine. But when the same USB flash drive is used on different machines, it may cause a problem. That is, different menu.lst files may be needed for different machines, otherwise the tool cannot be started normally. Then, is there any way to avoid this trouble? The answer is yes, that is, use "find --set-root" and a relative path to achieve. In this way, you don't have to worry about whether the USB flash drive is recognized as fd or hd.
For example, you can create a characteristic file in the root directory of the USB flash drive, such as myudisk.txt
In this way, to start the img image file on the USB flash drive, you can use the following method:
title GreenGhost (MAP-HOOK)
find --set-root /myudisk.txt
map --mem /boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
To boot WinPE on the USB flash drive, you can use:
title Micro Windows XPE (by LaoMaotao)
find --set-root /myudisk.txt
chainloader /ldrxpe
Refer to other examples, and by editing your menu.lst, you can give full play to the performance of the USB flash drive.
******************************************************************
5 Conclusion
This article only writes about some of the most basic applications of grub4dos. More functions of Grub4dos need you to try and explore.
I hope this article will help you use grub4dos faster.
I am looking forward to sharing your achievements.
Note: My network disk:
http://lianjiang2004.ys168.com also provides the download of some grub-related files and materials.
Recommended forums:
Space Forum:
http://bbs.znpc.net
China DOS Union Forum:
http://www.cn-dos.net/forum/
Wuyou Boot Forum:
http://bbs.wuyou.com
******************************************************************
6 Acknowledgments
The completion of this article refers to and quotes from many materials, and many of them can no longer find the original source. After the first draft was completed, many netizens pointed out the shortcomings and put forward modification suggestions, and also received the support and encouragement of the software developers. Thanks are extended here.
lianjiang 2007.03.13 First Draft
2007.03.13 First Revision
2007.03.14 Second Revision
Last edited by lianjiang2004 on 2007-3-29 at 09:01 PM ]