GRUB4DOS Beginner's Tutorial
CHM graphic version download:
http://lianjiang2007.ys168.com
http://lianjiang2004.ys168.com
===============================================
GRUB4DOS Beginner's Tutorial
Lianjiang April 2009
Foreword: Why write this beginner's tutorial?
If you're hearing about GRUB for the first time, you might say you don't need GRUB. But have you ever used "One-Click Ghost" or "矮人DOS Toolkit"? If you have, then you've actually been using GRUB. Most one-click recovery tools and other DOS-based maintenance tool collections installed under Windows, including my "GGhost One-Click Recovery", are based on GRUB.
There are quite a few materials related to GRUB4DOS on the Internet, and there are also instructions in the GRUB4DOS software package. However, most of these materials are not suitable for those new to GRUB. After downloading the GRUB4DOS software package, even if you roughly read the readme.txt file, you are likely still confused and don't know where to start. One of the main reasons for this situation is that the software is developed by the author in his spare time. The developer focuses on fixing software bugs in a limited time, so there isn't much remaining energy to write documentation.
In fact, using this software initially isn't difficult; it can be said to be very simple. The following content refers to relevant materials and combines my own usage experience, for the reference of beginners. I hope it can help you get started with GRUB. I myself have only been in contact with GRUB for a short time, and my understanding of GRUB is still very superficial. There are bound to be errors, and I hope you will point them out.
--------------------------------------------------------------------------------
Thanks
The completion of this article refers to and quotes from many materials, and many of them can't find the original source. After the initial draft was completed, netizens put forward many opinions and suggestions, and they also received support and encouragement from the software developers. Thanks are expressed here.
Lianjiang March 2007 First draft
April 2009 Final modification
【Note: My cloud disk: http://lianjiang2007.ys168.com http://lianjiang2004.ys168.com also provides downloads of some GRUB-related files and materials.】
Table of Contents
1 GRUB4DOS Beginner's Tutorial - Introduction
1.1 Introduction to GRUB
1.2 How to obtain the latest version of GRUB4DOS
1.3 How to install GRUB4DOS
1.3.1 Enter GRUB4DOS through the boot menu of Windows NT
1.3.2 Start GRUB through DOS
1.3.3 Start GRUB through MBR
1.3.4 Enter GRUB4DOS through the boot menu of Windows VISTA/Window 7
1.4 How to use GRUB4DOS
1.5 Conclusion
2 GRUB4DOS Beginner's Tutorial - Application
2.1 Applications on the hard disk
2.1.1 Loading floppy disk images
2.1.2 Starting WinPE
2.1.3 Starting the system
2.1.4 Booting CD-ROM images (ISO emulation)
2.2 Applications on the CD-ROM
2.2.1 Bootable CD-ROM guided by GRUB
2.2.2 Bootable CD-ROM with BCDW guiding GRUB
2.3 Applications on the floppy disk
2.3.1 Floppy disk application of starting GRUB through DOS
2.3.2 Floppy disk application with GRLDR boot record installed in the boot sector
2.4 Applications on the USB flash drive
2.5 Conclusion
3 GRUB4DOS Beginner's Tutorial - Advanced
3.1 Setting passwords
3.2 Menu built-in
3.3a Using personalized GRUB4DOS file name (grubinst)
3.3b Automatically renaming grldr with batch processing (applicable to the latest version of grldr)NEW!
3.4 Installing Windows XPE to a logical partition
3.5 Method and application of passing parameters using the savedefault command
3.6 Method and application of passing parameters using the dd command NEW!
4 Appendix
Grub legacy
4.01 GRUB command index
4.02 Usage method of the simplified Chinese version of GRUB
4.03 Summary of GRUB installation, configuration and usage
4.04 Detailed explanation of GRUB commands
4.05 GRUB three-step pass
4.06 Summary and analysis of GRUB-related installation, configuration and usage examples
Grub2 materials
4.07 Introduction to GRUB2 usage by bean NEW!
4.08 Advanced tutorial on GRUB2 by bean NEW!
Grub4dos materials
4.09 Advanced tutorial on gfxmenu customization (new customizable menu) by bean NEW!
4.10 How to use grubinst_gui by bean
GRUB4DOS official documents
4.11 Grub4dos_tutorial (English)
4.12 Introduction to GRUB4DOS
4.13 Installation and startup of GRUB4DOS
4.14 Newcomer's guide to GRUB4DOS
4.15 Advanced functions of GRUB4DOS
4.16 GRUB4DOS command index
4.17 Introduction to Grubinst usage
4.18 Grub4dos readme (English)
4.19 Grub4dos readme (Chinese)
--------------------------------------------------------------------------------
Text:
1 GRUB4DOS Beginner's Tutorial - Introduction
1.1 Introduction to GRUB
GRUB is a boot manager that complies with the Multiboot specification. There are 3 types currently, namely GNU Grub Legacy, GNU Grub2 and Grub for dos (grub4dos).
GNU GRUB Legacy is actually the original GNU GRUB 0.xx, and the latest version is GNU GRUB 0.97 released in 2005. Currently, development has stopped and it has been renamed GNU GRUB Legacy.
GNU GRUB2 is the second generation of GRUB, which will replace the original GNU GRUB (such as version 0.9x), but it is still in the development stage and has not been released as an official version.
GNU GRUB Legacy and GNU GRUB2 are both projects of the GNU organization.
GRUB for DOS (GRUB4DOS) is a powerful bootloader based on GNU GRUB. It can run under DOS and LINUX, can also run through other bootloaders, and can also act as an MBR. GRUB4DOS has a fully functional BIOS-level disk emulation built-in.
The following is explained based on the widely used GRUB4DOS. For the differences between GNU GRUB and GRUB4DOS, please refer to the relevant instructions.
1.2 How to obtain the latest version of GRUB4DOS
You can download the latest and earlier versions of GRUB4DOS from the following URLs.
http://download.gna.org/grub4dos/
http://download.gna.org/grubutil/
http://grub4dos.jot.com/WikiHome
https://gna.org/projects/grub4dos/
http://grub4dos.sourceforge.net/wiki (official documentation)
1.3 How to install GRUB4DOS?
After downloading GRUB4DOS, just unzip it. The core files are the following: grldr and grub.exe, and menu.lst (this is a sample and needs to be modified). If you need Chinese support, use the files in the chinese directory.
There are usually 3 common installation methods.
1.3.1 Enter GRUB4DOS through the boot menu of Windows NT
Copy the grldr file to c:\, remove the read-only attribute of boot.ini, then modify the c:\boot.ini file, add a line at the end of boot.ini:
c:\grldr="Start GRUB4DOS"
And set the timeout value in boot.ini to a number greater than 0, such as:timeout=5, then save boot.ini and change it back to the read-only attribute.
Before editing boot.ini, you can enter in cmd:
attrib -s -r -h c:\boot.ini
To remove the read-only attribute of boot.ini, after editing, enter:
attrib +s +r +h c:\boot.ini
To restore the original attributes of boot.ini.
In this way, after editing, restart the computer, and "Start GRUB4DOS" will appear in the NT boot menu. Select this item to enter the GRUB4DOS environment. 【Figure 1】
The advantage of this method is: no need to modify the MBR.
Beginners generally need a GRUB menu when using GRUB. Put the prepared menu.lst file in C:\ (it can also be placed in the root directory of other partitions or other specified directories). The writing method of menu.lst can refer to readme.txt or menu.lst provided by others. A simple introduction will be made in the following "1.4 How to use GRUB4DOS".
1.3.2 Start GRUB through DOS
Boot the machine to the DOS environment through any possible way (floppy disk, USB flash drive, CD-ROM, etc.) (preferably a pure DOS environment, that is, a DOS environment without loading any drivers and TSR programs), then run grub.exe under DOS or in AUTOEXEC.BAT to enter GRUB4DOS.
You can also use any of the following methods to start GRUB in CONFIG.SYS of DOS/Windows9x.
DEVICE=GRUB.EXE
INSTALL=GRUB.EXE
SHELL=GRUB.EXE
The advantage of this method is: no need to modify the MBR; GRUB4DOS can be started in scripts or other DOS programs as needed.
The menu file menu.lst can be saved in the directory where the GRUB file is located or other specified paths.
1.3.3 Start GRUB through MBR
Install the GRLDR boot record to the master boot record of the hard disk or hard disk image file through bootlace.com in the software package (runnable under DOS/Win9x), or install it to the boot sector of the floppy disk or floppy disk image. When the computer starts, press the hot key (default is the space bar, which can be customized) to start GRUB.
For example:
Install the GRLDR code to the master boot record under DOS:
bootlace.com 0x80
Install the GRLDR code to the floppy disk under DOS:
bootlace.com --floppy --chs 0x00
Install the GRLDR code to the floppy disk image under DOS:
bootlace.com --floppy --chs floppy.img
The command I use is:
bootlace --force-backup-mbr --boot-prevmbr-first --time-out=3 --hot-key=0x3920 --mbr-disable-floppy 0x80
It means that when installing the GRLDR code to the MBR, back up the original MBR (--force-backup-mbr), start the original MBR by default, that is, start the original Windows XP system (--boot-prevmbr-first), wait for 3 seconds (--time-out=3), the hot key is the space bar (--hot-key=0x3920), and do not search for GRLDR on the floppy disk (--mbr-disable-floppy).
That is, wait for 3 seconds when starting. If you don't press the hot key within 3 seconds, start Windows XP; if you press the hot key within 3 seconds, start GRUB4DOS.
For other parameters of bootlace and the usage of custom hot keys, please refer to the readme.txt file.
After loading the MBR, copy the grldr and menu.lst files to the root directory of a partition (now supported file systems are FAT12, FAT16, FAT32, NTFS, EXT2 or EXT3 partitions. For Windows users, it is best to be a fat partition), and menu.lst can also be saved to other specified locations.
The advantage of this method is: not dependent on the operating system; can automatically search for grldr files on each partition of the hard disk.
In addition, in the 2000/xp/2003/vista environment, another software grubinst can be used to install the GRLDR boot record to the MBR of the hard disk. grubinst has two working modes: graphical interface and command line for selection, and comes with relatively detailed usage instructions, which is very easy to use.
1.4 How to use GRUB4DOS
For most Windows users who have no or little contact with Linux, the menu is indispensable when they first use GRUB. That is to say, before using GRUB, we need to prepare the menu.lst file.
The following is an example of menu.lst. (Lines starting with # are comments and are not executed)
# Default delay time (seconds)
timeout 30
# The first item is the default value
default 0
# Set the graphic background file
splashimage (hd0,0)/boot/grub/xp2008.gz
# Set the font file for Chinese support
fontfile (hd0,0)/boot/grub/fonts
title Start the瑞星 anti-virus floppy disk image file on the local hard disk using map
map (hd0,0)/boot/grub/rav.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title Start the local Win98 floppy disk image file using memdisk
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/win98.img
title Start the瑞星 anti-virus floppy disk compressed image file on the local hard disk using memdisk
root (hd0,0)
kernel /boot/grub/memdisk.gz c=80 h=12 s=36 floppy
initrd /boot/rav.zip
title Start the operating system on the first primary partition (hd0,0)
rootnoverify (hd0,0)
makeactive
chainloader +1
title Start the operating system on the second primary partition (hd0,1)
rootnoverify (hd0,1)
makeactive
chainloader +1
title Reboot
reboot
title Shutdown
halt
The running effect of this menu file is shown in the following figure. 【Figure 2】
Refer to this example, and you can modify the menu according to your needs.
For example, if you download the efficiency source image file from the Internet with the file name XLY.IMG. You only need to change
title Start the local Win98 floppy disk image file using memdisk
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/win98.img
to
title Hard disk detection and repair tool Efficiency Source (memdisk)
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/xly.img
Or change it to
title Hard disk detection and repair tool Efficiency Source (map)
map (hd0,0)/boot/grub/xly.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
At the same time, save the xly.img file in the boot\grub directory of the first primary partition (usually C:).
Of course, it can also be saved in other paths.
For example, if the xly.img file is saved in C:\boot, then the menu.lst file should be changed accordingly:
map (hd0,0)/boot/xly.img (fd0)
If the xly.img file is saved in D:\test, then the menu.lst file should be changed accordingly:
map (hd0,4)/test/xly.img (fd0)
(Refer to note d below)
As can be seen from the above example, there are two ways to start the floppy disk image, namely using memdisk or map.
When using memdisk, the img file can be compressed; when the size of the img file is not a standard image of 1.44MB or 2.88MB, the CHS parameters need to be specified. The CHS parameters of the img file can be obtained with winimage.
That is, in the example:
title Start the瑞星 anti-virus floppy disk compressed image file on the local hard disk using memdisk
root (hd0,0)
kernel /boot/grub/memdisk.gz c=80 h=12 s=36 floppy
initrd /boot/rav.zip
In addition, the file path in the menu file can be expressed in relative path (such as: /boot/rav.zip) or absolute path (such as: (hd0,0)/boot/grub/xly.img).
The map method has no limit on the size of the floppy disk image, but it is required to be stored continuously. The improved map --mem has no such limit.
For example:
map --mem /boot/xxx.ima (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
Notes:
a, The memdisk.gz file used in the menu file is not included in the GRUB4DOS release package and needs to be prepared by yourself. It can be obtained from the GNU GRUB software package or from other GRUB-based tools (such as One-Click Ghost, my gghost).
b, Other files used in the menu, such as xp2008.gz (background file), fonts (Chinese font file) and various image files, etc., need to be copied to the path specified in the file. The fontfile command cannot be used alone and needs to be used together with splashimage.
c, All commands in the menu file are in lowercase.
d, Beginners should pay attention to the device naming method of GRUB when using the absolute path. The first hard disk drive of the system is represented as (hd0), and the first partition on it is represented as (hd0,0), that is, for the hard disk, it is represented in the form of (hdx,y), where x and y are both counted from 0, x represents the hard disk number, and y represents the partition number.
Since there can be only four primary partitions, the four primary partitions of the first hard disk are respectively represented by (hd0,0)~(hd0,3); logical partitions start from (hd0,4), that is, the first logical partition is represented by (hd0,4), the second logical partition is represented by (hd0,5), and so on.
Generally, the hard disk of most computers has one primary partition, and the rest are logical partitions. Therefore, the C drive is represented by (hd0,0), and the D drive is represented by (hd0,4). The CD-ROM is represented by (cd), and the first floppy drive is represented by (fd0).
For example, my hard disk has two primary partitions, and the rest are logical partitions. The method of representing with (hdx,y) is shown in the following figure:
The following is the menu effect diagram and menu.lst file I am currently using for reference. 【Figure 3】
color white/green yellow/green
default 1
timeout 3
#fontfile /boot/grub/fonts
#splashimage /boot/grub/bg.xpm.gz
#password --md5 $1$8$D0mfzTIQXv2Ma2b5bWH0b.
title 0, Boot from Hard Drive (hd0,0)
root (hd0,0)
chainloader +1
title 1, GreenGhost (MAP-HOOK)
map --mem /boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title 2, GreenGhost (MEMDISK)
kernel /boot/grub/memdisk.gz c=200 h=2 s=36 floppy
initrd /boot/grub/gghost.img
title 3, GreenGhost (MAP-HOOK)
map --mem /boot/grub/gghost.img (fd0)
map --hook
chainloader --disable-a20 (fd0)+1
rootnoverify (fd0)
title 4, Microsoft Windows NT/2K/XP
find --set-root /ntldr
chainloader /ntldr
title 5, Microsoft Windows Vista
find --set-root /bootmgr
chainloader /bootmgr
title 6, Boot from Hard Drive (hd0,1)
root (hd0,1)
chainloader +1
title 7, Reboot
reboot
title 8, Shutdown
halt
1.5 Conclusion
GRUB4DOS has powerful functions. The above introduction is only some of the most basic usages of GRUB4DOS. More usages can be understood by referring to materials on the basis of mastering the basic usages.
--------------------------------------------------------------------------------
2 GRUB4DOS Beginner's Tutorial - Application
2.1 Applications on the hard disk
When applying GRUB on the hard disk, you first need to install it. The installation/boot methods are mainly 3 types, namely entering GRUB4DOS through the boot menu of Windows NT; starting GRUB through DOS; starting GRUB through MBR. 【Refer to 1.3 How to install GRUB4DOS】
After installing GRUB, you need to prepare the menu file menu.lst.
2.1.1 Loading floppy disk images
For Windows users, using GRUB to load floppy disk images is one of the most commonly used functions. Since Windows 2k/xp has been separated from DOS, it has become a problem for beginners to perform some DOS operations such as system backup/restoration. In the past, we might need to use a boot CD-ROM to enter DOS, and the characteristics of the CD-ROM determine that it is difficult to update the tools on the CD-ROM 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 system maintenance tools downloaded from the Internet are in img format. Without extracting the files, you can use them by slightly modifying menu.lst. Various tools can coexist harmoniously and are very convenient to use.
How to add the downloaded xxx.img to the GRUB boot menu?
You only need to save xxx.img in 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)
Notes:
a, These lines of content cannot be added at the front, because the front are some settings that are effective for the whole.
b, All the tools you need can be added in this way.
c, 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, the following method can be adopted. 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)
After starting GRUB and entering the menu, select "Boot from Floppy image XXX", press "e" to enter the editing state, move the direction key, 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 other paths, change it to the corresponding path.)
2.1.2 Starting WinPE
Some system maintenance operations are not easy or even impossible to perform under DOS. The appearance of WinPE has brought us a lot of convenience.
Take the widely praised "Lao Jiu WinPE Lao Maotao Modified Version_1111 Edition" as an example to introduce how to start WinPE with GRUB. (The ISO already has an installation program. Here, I will introduce how to add a general winpe option in menu.lst.)
Steps:
1, Download "Lao Jiu WinPE Lao Maotao Modified Version_1111 Edition", unzip it to get BootCD.ISO.
2, Use a virtual CD-ROM or UltraISO to extract WINPE.IS_, WINNT.XPE and WXPE\SETUPLDR.BIN in 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. 【Figure 4】【Figure 5】
3, Add the following in menu.lst
title Micro Windows XPE (by LaoMaotao)
chainloader /ldrxpe
Select "Micro Windows XPE (by LaoMaotao)" when starting GRUB to start WinPE. In this way, you can perform system maintenance, installation and other operations under the Windows interface. 【Figure 6】【Figure 7】【Figure 8】
2.1.3 Starting the system
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 boot of each system.
For example, the following options can be added in menu.lst:
title Start the operating system on the first primary partition (hd0,0) of the first hard disk
rootnoverify (hd0,0)
makeactive
chainloader +1
title Start the operating system on the second primary partition (hd0,1) of the first hard disk
rootnoverify (hd0,1)
makeactive
chainloader +1
title Start Windows NT/2000/XP/2003
find --set-root /ntldr
chainloader /ntldr
title Start Microsoft Windows Vista
find --set-root /bootmgr
chainloader /bootmgr
title Start DOS/Windows 95/98/Me
find --set-root /io.sys
chainloader /io.sys
2.2 Applications on the CD-ROM
The following introduces two methods of applying GRUB on the CD-ROM.
2.2.1 Bootable CD-ROM guided by GRUB
Use grldr as the boot file of the CD-ROM to guide the CD-ROM, 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 and other files as needed).
2) Edit menu.lst. The format for guiding the img file on the CD-ROM is as follows:
title GreenGhost (MAP-HOOK)
map --mem (cd)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
The menu can also guide the img file on the hard disk, such as:
title GreenGhost (MEMDISK)
kernel (hd0,4)/boot/grub/memdisk.gz c=200 h=2 s=36 floppy
initrd (hd0,4)/boot/grub/gghost.img
3) Organize files. For example, create a grubcd directory under E:\3333, copy menu.lst to this directory, and the menu.lst file will be in the root directory of the CD-ROM. Create a boot\grub directory under the grubcd directory, and save various img, fonts and other files (it can also be saved in other paths, and the path specified in menu.lst should be consistent). Note: The file names of all files referenced in the menu.lst file that are displayed on the hard disk need to be in lowercase, and uppercase ones need to be changed to lowercase. 【Figure 9】
4) Make ISO. Use UltraISO to create a new ISO file, add all files in the E:\3333\grubcd directory to the ISO file; perform "Bootable CD-ROM" - "Load boot file", select the grldr file (need to rename grldr to grldr.bin or grldr.bif, etc.). Then perform "File" - "Properties", select the "Allow lowercase letters" option, and save the ISO file. 【Figure 10】【Figure 11】【Figure 12】
It can also use tools such as mkisofs.exe or CDIMAGE.EXE to make a bootable ISO (grldr does not need to be renamed).
For example, the batch processing I use to make ISO with CDIMAGE is:
cdimage -lgrubcd -t01/01/2007,00:00:00 -h -n -o -d -m -bgrldr grubcd grubcd.iso
5) Burn the made bootable ISO with Nero and other software. It is better to test it in a virtual machine first before burning it, or use CD-RW/DVD+RW to burn it.
2.2.2 Bootable CD-ROM with BCDW guiding GRUB
This method is to use BCDW to make a bootable CD-ROM, and execute grldr through BCDW to load the menu.lst menu.
Steps:
1) First download the BCDW software package, unzip it to get the required files.
2) Organize files. For example, create a bcdwcd directory under E:\3333. The files in this directory will be in the root directory of the CD-ROM. Create a boot\grub directory and a bcdw directory under it. Copy bcdw.bin, bcdw.ini and loader.bin in the bcdw directory of the software package to the created bcdwcd\bcdw directory; copy grldr, various img, fonts and other files to the bcdwcd\boot\grub directory. The editing method of the menu.lst file is the same as that introduced in 2.1 above.
3) Edit the bcdw.ini file. Open bcdw.ini, find the part, for example:
C:\ ; Boot from drive C:
\I386\setupldr.bin ; Microsoft Windows XP Setup
The above is an example of the BCDW boot menu. Add items such as GRUB here to become:
\images\gghost.img ; GGhost v6.0 (Ghost8.3/11)
\images\mynet.img ; My net (Ghost8.3)(tcp/ip,cd/usb)
\boot\grub\grldr ; Grub4dos
\WXPE\SETUPLDR.BIN ; Micro Windows XPE (by LaoMaotao)
C:\ ; Boot from drive C:
\I386\setupldr.bin ; Microsoft Windows XP Setup
4) The method of making the ISO file and burning the ISO is basically the same as in 2.1. The only difference is that when making the ISO file, loader.bin (or bcdw.bin) should be used as the boot file of the ISO. 【Figure 13】
It can also use tools such as mkisofs.exe or CDIMAGE.EXE to make a bootable ISO.
For example, the batch processing I use to make ISO with CDIMAGE is:
cdimage -lbcdwcd -t01/01/2007,00:00:00 -h -n -d -o -m -bload.bin bcdwcd bcdwcd.iso
After running, the effects of the BCDW interface and the GRUB interface are shown in the following figures. 【Figure 14】【Figure 15】
2.3 Applications on the floppy disk
There are mainly two ways to apply GRUB on the floppy disk, namely starting GRUB through DOS and installing the GRLDR boot record in the boot sector of the floppy disk. 【Refer to 1.3 How to install GRUB4DOS】
2.3.1 Floppy disk application of starting GRUB through DOS
First, make the floppy disk into a bootable disk. The simplest one, 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 four 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 start the img file on the hard disk, and can also be used to manage the boot of each system. The files specified in the menu file (such as font, img file, 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 Start the operating system on the first primary partition (hd0,0) of the first hard disk
rootnoverify (hd0,0)
makeactive
chainloader +1
title Start the operating system on the second primary partition (hd0,1) of the first hard disk
rootnoverify (hd0,1)
makeactive
chainloader +1
title Reboot
reboot
title Shutdown
halt
2.3.2 Floppy disk application with GRLDR boot record installed in the boot sector
After the GRLDR boot record is installed, only grldr, menu.lst and the files referenced in menu.lst need to be retained on the floppy disk. The menu.lst file is the same as that used in "2.3
CHM graphic version download:
http://lianjiang2007.ys168.com
http://lianjiang2004.ys168.com
===============================================
GRUB4DOS Beginner's Tutorial
Lianjiang April 2009
Foreword: Why write this beginner's tutorial?
If you're hearing about GRUB for the first time, you might say you don't need GRUB. But have you ever used "One-Click Ghost" or "矮人DOS Toolkit"? If you have, then you've actually been using GRUB. Most one-click recovery tools and other DOS-based maintenance tool collections installed under Windows, including my "GGhost One-Click Recovery", are based on GRUB.
There are quite a few materials related to GRUB4DOS on the Internet, and there are also instructions in the GRUB4DOS software package. However, most of these materials are not suitable for those new to GRUB. After downloading the GRUB4DOS software package, even if you roughly read the readme.txt file, you are likely still confused and don't know where to start. One of the main reasons for this situation is that the software is developed by the author in his spare time. The developer focuses on fixing software bugs in a limited time, so there isn't much remaining energy to write documentation.
In fact, using this software initially isn't difficult; it can be said to be very simple. The following content refers to relevant materials and combines my own usage experience, for the reference of beginners. I hope it can help you get started with GRUB. I myself have only been in contact with GRUB for a short time, and my understanding of GRUB is still very superficial. There are bound to be errors, and I hope you will point them out.
--------------------------------------------------------------------------------
Thanks
The completion of this article refers to and quotes from many materials, and many of them can't find the original source. After the initial draft was completed, netizens put forward many opinions and suggestions, and they also received support and encouragement from the software developers. Thanks are expressed here.
Lianjiang March 2007 First draft
April 2009 Final modification
【Note: My cloud disk: http://lianjiang2007.ys168.com http://lianjiang2004.ys168.com also provides downloads of some GRUB-related files and materials.】
Table of Contents
1 GRUB4DOS Beginner's Tutorial - Introduction
1.1 Introduction to GRUB
1.2 How to obtain the latest version of GRUB4DOS
1.3 How to install GRUB4DOS
1.3.1 Enter GRUB4DOS through the boot menu of Windows NT
1.3.2 Start GRUB through DOS
1.3.3 Start GRUB through MBR
1.3.4 Enter GRUB4DOS through the boot menu of Windows VISTA/Window 7
1.4 How to use GRUB4DOS
1.5 Conclusion
2 GRUB4DOS Beginner's Tutorial - Application
2.1 Applications on the hard disk
2.1.1 Loading floppy disk images
2.1.2 Starting WinPE
2.1.3 Starting the system
2.1.4 Booting CD-ROM images (ISO emulation)
2.2 Applications on the CD-ROM
2.2.1 Bootable CD-ROM guided by GRUB
2.2.2 Bootable CD-ROM with BCDW guiding GRUB
2.3 Applications on the floppy disk
2.3.1 Floppy disk application of starting GRUB through DOS
2.3.2 Floppy disk application with GRLDR boot record installed in the boot sector
2.4 Applications on the USB flash drive
2.5 Conclusion
3 GRUB4DOS Beginner's Tutorial - Advanced
3.1 Setting passwords
3.2 Menu built-in
3.3a Using personalized GRUB4DOS file name (grubinst)
3.3b Automatically renaming grldr with batch processing (applicable to the latest version of grldr)NEW!
3.4 Installing Windows XPE to a logical partition
3.5 Method and application of passing parameters using the savedefault command
3.6 Method and application of passing parameters using the dd command NEW!
4 Appendix
Grub legacy
4.01 GRUB command index
4.02 Usage method of the simplified Chinese version of GRUB
4.03 Summary of GRUB installation, configuration and usage
4.04 Detailed explanation of GRUB commands
4.05 GRUB three-step pass
4.06 Summary and analysis of GRUB-related installation, configuration and usage examples
Grub2 materials
4.07 Introduction to GRUB2 usage by bean NEW!
4.08 Advanced tutorial on GRUB2 by bean NEW!
Grub4dos materials
4.09 Advanced tutorial on gfxmenu customization (new customizable menu) by bean NEW!
4.10 How to use grubinst_gui by bean
GRUB4DOS official documents
4.11 Grub4dos_tutorial (English)
4.12 Introduction to GRUB4DOS
4.13 Installation and startup of GRUB4DOS
4.14 Newcomer's guide to GRUB4DOS
4.15 Advanced functions of GRUB4DOS
4.16 GRUB4DOS command index
4.17 Introduction to Grubinst usage
4.18 Grub4dos readme (English)
4.19 Grub4dos readme (Chinese)
--------------------------------------------------------------------------------
Text:
1 GRUB4DOS Beginner's Tutorial - Introduction
1.1 Introduction to GRUB
GRUB is a boot manager that complies with the Multiboot specification. There are 3 types currently, namely GNU Grub Legacy, GNU Grub2 and Grub for dos (grub4dos).
GNU GRUB Legacy is actually the original GNU GRUB 0.xx, and the latest version is GNU GRUB 0.97 released in 2005. Currently, development has stopped and it has been renamed GNU GRUB Legacy.
GNU GRUB2 is the second generation of GRUB, which will replace the original GNU GRUB (such as version 0.9x), but it is still in the development stage and has not been released as an official version.
GNU GRUB Legacy and GNU GRUB2 are both projects of the GNU organization.
GRUB for DOS (GRUB4DOS) is a powerful bootloader based on GNU GRUB. It can run under DOS and LINUX, can also run through other bootloaders, and can also act as an MBR. GRUB4DOS has a fully functional BIOS-level disk emulation built-in.
The following is explained based on the widely used GRUB4DOS. For the differences between GNU GRUB and GRUB4DOS, please refer to the relevant instructions.
1.2 How to obtain the latest version of GRUB4DOS
You can download the latest and earlier versions of GRUB4DOS from the following URLs.
http://download.gna.org/grub4dos/
http://download.gna.org/grubutil/
http://grub4dos.jot.com/WikiHome
https://gna.org/projects/grub4dos/
http://grub4dos.sourceforge.net/wiki (official documentation)
1.3 How to install GRUB4DOS?
After downloading GRUB4DOS, just unzip it. The core files are the following: grldr and grub.exe, and menu.lst (this is a sample and needs to be modified). If you need Chinese support, use the files in the chinese directory.
There are usually 3 common installation methods.
1.3.1 Enter GRUB4DOS through the boot menu of Windows NT
Copy the grldr file to c:\, remove the read-only attribute of boot.ini, then modify the c:\boot.ini file, add a line at the end of boot.ini:
c:\grldr="Start GRUB4DOS"
And set the timeout value in boot.ini to a number greater than 0, such as:timeout=5, then save boot.ini and change it back to the read-only attribute.
Before editing boot.ini, you can enter in cmd:
attrib -s -r -h c:\boot.ini
To remove the read-only attribute of boot.ini, after editing, enter:
attrib +s +r +h c:\boot.ini
To restore the original attributes of boot.ini.
In this way, after editing, restart the computer, and "Start GRUB4DOS" will appear in the NT boot menu. Select this item to enter the GRUB4DOS environment. 【Figure 1】
The advantage of this method is: no need to modify the MBR.
Beginners generally need a GRUB menu when using GRUB. Put the prepared menu.lst file in C:\ (it can also be placed in the root directory of other partitions or other specified directories). The writing method of menu.lst can refer to readme.txt or menu.lst provided by others. A simple introduction will be made in the following "1.4 How to use GRUB4DOS".
1.3.2 Start GRUB through DOS
Boot the machine to the DOS environment through any possible way (floppy disk, USB flash drive, CD-ROM, etc.) (preferably a pure DOS environment, that is, a DOS environment without loading any drivers and TSR programs), then run grub.exe under DOS or in AUTOEXEC.BAT to enter GRUB4DOS.
You can also use any of the following methods to start GRUB in CONFIG.SYS of DOS/Windows9x.
DEVICE=GRUB.EXE
INSTALL=GRUB.EXE
SHELL=GRUB.EXE
The advantage of this method is: no need to modify the MBR; GRUB4DOS can be started in scripts or other DOS programs as needed.
The menu file menu.lst can be saved in the directory where the GRUB file is located or other specified paths.
1.3.3 Start GRUB through MBR
Install the GRLDR boot record to the master boot record of the hard disk or hard disk image file through bootlace.com in the software package (runnable under DOS/Win9x), or install it to the boot sector of the floppy disk or floppy disk image. When the computer starts, press the hot key (default is the space bar, which can be customized) to start GRUB.
For example:
Install the GRLDR code to the master boot record under DOS:
bootlace.com 0x80
Install the GRLDR code to the floppy disk under DOS:
bootlace.com --floppy --chs 0x00
Install the GRLDR code to the floppy disk image under DOS:
bootlace.com --floppy --chs floppy.img
The command I use is:
bootlace --force-backup-mbr --boot-prevmbr-first --time-out=3 --hot-key=0x3920 --mbr-disable-floppy 0x80
It means that when installing the GRLDR code to the MBR, back up the original MBR (--force-backup-mbr), start the original MBR by default, that is, start the original Windows XP system (--boot-prevmbr-first), wait for 3 seconds (--time-out=3), the hot key is the space bar (--hot-key=0x3920), and do not search for GRLDR on the floppy disk (--mbr-disable-floppy).
That is, wait for 3 seconds when starting. If you don't press the hot key within 3 seconds, start Windows XP; if you press the hot key within 3 seconds, start GRUB4DOS.
For other parameters of bootlace and the usage of custom hot keys, please refer to the readme.txt file.
After loading the MBR, copy the grldr and menu.lst files to the root directory of a partition (now supported file systems are FAT12, FAT16, FAT32, NTFS, EXT2 or EXT3 partitions. For Windows users, it is best to be a fat partition), and menu.lst can also be saved to other specified locations.
The advantage of this method is: not dependent on the operating system; can automatically search for grldr files on each partition of the hard disk.
In addition, in the 2000/xp/2003/vista environment, another software grubinst can be used to install the GRLDR boot record to the MBR of the hard disk. grubinst has two working modes: graphical interface and command line for selection, and comes with relatively detailed usage instructions, which is very easy to use.
1.4 How to use GRUB4DOS
For most Windows users who have no or little contact with Linux, the menu is indispensable when they first use GRUB. That is to say, before using GRUB, we need to prepare the menu.lst file.
The following is an example of menu.lst. (Lines starting with # are comments and are not executed)
# Default delay time (seconds)
timeout 30
# The first item is the default value
default 0
# Set the graphic background file
splashimage (hd0,0)/boot/grub/xp2008.gz
# Set the font file for Chinese support
fontfile (hd0,0)/boot/grub/fonts
title Start the瑞星 anti-virus floppy disk image file on the local hard disk using map
map (hd0,0)/boot/grub/rav.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title Start the local Win98 floppy disk image file using memdisk
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/win98.img
title Start the瑞星 anti-virus floppy disk compressed image file on the local hard disk using memdisk
root (hd0,0)
kernel /boot/grub/memdisk.gz c=80 h=12 s=36 floppy
initrd /boot/rav.zip
title Start the operating system on the first primary partition (hd0,0)
rootnoverify (hd0,0)
makeactive
chainloader +1
title Start the operating system on the second primary partition (hd0,1)
rootnoverify (hd0,1)
makeactive
chainloader +1
title Reboot
reboot
title Shutdown
halt
The running effect of this menu file is shown in the following figure. 【Figure 2】
Refer to this example, and you can modify the menu according to your needs.
For example, if you download the efficiency source image file from the Internet with the file name XLY.IMG. You only need to change
title Start the local Win98 floppy disk image file using memdisk
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/win98.img
to
title Hard disk detection and repair tool Efficiency Source (memdisk)
kernel (hd0,0)/boot/grub/memdisk.gz
initrd (hd0,0)/boot/grub/xly.img
Or change it to
title Hard disk detection and repair tool Efficiency Source (map)
map (hd0,0)/boot/grub/xly.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
At the same time, save the xly.img file in the boot\grub directory of the first primary partition (usually C:).
Of course, it can also be saved in other paths.
For example, if the xly.img file is saved in C:\boot, then the menu.lst file should be changed accordingly:
map (hd0,0)/boot/xly.img (fd0)
If the xly.img file is saved in D:\test, then the menu.lst file should be changed accordingly:
map (hd0,4)/test/xly.img (fd0)
(Refer to note d below)
As can be seen from the above example, there are two ways to start the floppy disk image, namely using memdisk or map.
When using memdisk, the img file can be compressed; when the size of the img file is not a standard image of 1.44MB or 2.88MB, the CHS parameters need to be specified. The CHS parameters of the img file can be obtained with winimage.
That is, in the example:
title Start the瑞星 anti-virus floppy disk compressed image file on the local hard disk using memdisk
root (hd0,0)
kernel /boot/grub/memdisk.gz c=80 h=12 s=36 floppy
initrd /boot/rav.zip
In addition, the file path in the menu file can be expressed in relative path (such as: /boot/rav.zip) or absolute path (such as: (hd0,0)/boot/grub/xly.img).
The map method has no limit on the size of the floppy disk image, but it is required to be stored continuously. The improved map --mem has no such limit.
For example:
map --mem /boot/xxx.ima (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
Notes:
a, The memdisk.gz file used in the menu file is not included in the GRUB4DOS release package and needs to be prepared by yourself. It can be obtained from the GNU GRUB software package or from other GRUB-based tools (such as One-Click Ghost, my gghost).
b, Other files used in the menu, such as xp2008.gz (background file), fonts (Chinese font file) and various image files, etc., need to be copied to the path specified in the file. The fontfile command cannot be used alone and needs to be used together with splashimage.
c, All commands in the menu file are in lowercase.
d, Beginners should pay attention to the device naming method of GRUB when using the absolute path. The first hard disk drive of the system is represented as (hd0), and the first partition on it is represented as (hd0,0), that is, for the hard disk, it is represented in the form of (hdx,y), where x and y are both counted from 0, x represents the hard disk number, and y represents the partition number.
Since there can be only four primary partitions, the four primary partitions of the first hard disk are respectively represented by (hd0,0)~(hd0,3); logical partitions start from (hd0,4), that is, the first logical partition is represented by (hd0,4), the second logical partition is represented by (hd0,5), and so on.
Generally, the hard disk of most computers has one primary partition, and the rest are logical partitions. Therefore, the C drive is represented by (hd0,0), and the D drive is represented by (hd0,4). The CD-ROM is represented by (cd), and the first floppy drive is represented by (fd0).
For example, my hard disk has two primary partitions, and the rest are logical partitions. The method of representing with (hdx,y) is shown in the following figure:
The following is the menu effect diagram and menu.lst file I am currently using for reference. 【Figure 3】
color white/green yellow/green
default 1
timeout 3
#fontfile /boot/grub/fonts
#splashimage /boot/grub/bg.xpm.gz
#password --md5 $1$8$D0mfzTIQXv2Ma2b5bWH0b.
title 0, Boot from Hard Drive (hd0,0)
root (hd0,0)
chainloader +1
title 1, GreenGhost (MAP-HOOK)
map --mem /boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title 2, GreenGhost (MEMDISK)
kernel /boot/grub/memdisk.gz c=200 h=2 s=36 floppy
initrd /boot/grub/gghost.img
title 3, GreenGhost (MAP-HOOK)
map --mem /boot/grub/gghost.img (fd0)
map --hook
chainloader --disable-a20 (fd0)+1
rootnoverify (fd0)
title 4, Microsoft Windows NT/2K/XP
find --set-root /ntldr
chainloader /ntldr
title 5, Microsoft Windows Vista
find --set-root /bootmgr
chainloader /bootmgr
title 6, Boot from Hard Drive (hd0,1)
root (hd0,1)
chainloader +1
title 7, Reboot
reboot
title 8, Shutdown
halt
1.5 Conclusion
GRUB4DOS has powerful functions. The above introduction is only some of the most basic usages of GRUB4DOS. More usages can be understood by referring to materials on the basis of mastering the basic usages.
--------------------------------------------------------------------------------
2 GRUB4DOS Beginner's Tutorial - Application
2.1 Applications on the hard disk
When applying GRUB on the hard disk, you first need to install it. The installation/boot methods are mainly 3 types, namely entering GRUB4DOS through the boot menu of Windows NT; starting GRUB through DOS; starting GRUB through MBR. 【Refer to 1.3 How to install GRUB4DOS】
After installing GRUB, you need to prepare the menu file menu.lst.
2.1.1 Loading floppy disk images
For Windows users, using GRUB to load floppy disk images is one of the most commonly used functions. Since Windows 2k/xp has been separated from DOS, it has become a problem for beginners to perform some DOS operations such as system backup/restoration. In the past, we might need to use a boot CD-ROM to enter DOS, and the characteristics of the CD-ROM determine that it is difficult to update the tools on the CD-ROM 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 system maintenance tools downloaded from the Internet are in img format. Without extracting the files, you can use them by slightly modifying menu.lst. Various tools can coexist harmoniously and are very convenient to use.
How to add the downloaded xxx.img to the GRUB boot menu?
You only need to save xxx.img in 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)
Notes:
a, These lines of content cannot be added at the front, because the front are some settings that are effective for the whole.
b, All the tools you need can be added in this way.
c, 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, the following method can be adopted. 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)
After starting GRUB and entering the menu, select "Boot from Floppy image XXX", press "e" to enter the editing state, move the direction key, 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 other paths, change it to the corresponding path.)
2.1.2 Starting WinPE
Some system maintenance operations are not easy or even impossible to perform under DOS. The appearance of WinPE has brought us a lot of convenience.
Take the widely praised "Lao Jiu WinPE Lao Maotao Modified Version_1111 Edition" as an example to introduce how to start WinPE with GRUB. (The ISO already has an installation program. Here, I will introduce how to add a general winpe option in menu.lst.)
Steps:
1, Download "Lao Jiu WinPE Lao Maotao Modified Version_1111 Edition", unzip it to get BootCD.ISO.
2, Use a virtual CD-ROM or UltraISO to extract WINPE.IS_, WINNT.XPE and WXPE\SETUPLDR.BIN in 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. 【Figure 4】【Figure 5】
3, Add the following in menu.lst
title Micro Windows XPE (by LaoMaotao)
chainloader /ldrxpe
Select "Micro Windows XPE (by LaoMaotao)" when starting GRUB to start WinPE. In this way, you can perform system maintenance, installation and other operations under the Windows interface. 【Figure 6】【Figure 7】【Figure 8】
2.1.3 Starting the system
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 boot of each system.
For example, the following options can be added in menu.lst:
title Start the operating system on the first primary partition (hd0,0) of the first hard disk
rootnoverify (hd0,0)
makeactive
chainloader +1
title Start the operating system on the second primary partition (hd0,1) of the first hard disk
rootnoverify (hd0,1)
makeactive
chainloader +1
title Start Windows NT/2000/XP/2003
find --set-root /ntldr
chainloader /ntldr
title Start Microsoft Windows Vista
find --set-root /bootmgr
chainloader /bootmgr
title Start DOS/Windows 95/98/Me
find --set-root /io.sys
chainloader /io.sys
2.2 Applications on the CD-ROM
The following introduces two methods of applying GRUB on the CD-ROM.
2.2.1 Bootable CD-ROM guided by GRUB
Use grldr as the boot file of the CD-ROM to guide the CD-ROM, 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 and other files as needed).
2) Edit menu.lst. The format for guiding the img file on the CD-ROM is as follows:
title GreenGhost (MAP-HOOK)
map --mem (cd)/boot/grub/gghost.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
The menu can also guide the img file on the hard disk, such as:
title GreenGhost (MEMDISK)
kernel (hd0,4)/boot/grub/memdisk.gz c=200 h=2 s=36 floppy
initrd (hd0,4)/boot/grub/gghost.img
3) Organize files. For example, create a grubcd directory under E:\3333, copy menu.lst to this directory, and the menu.lst file will be in the root directory of the CD-ROM. Create a boot\grub directory under the grubcd directory, and save various img, fonts and other files (it can also be saved in other paths, and the path specified in menu.lst should be consistent). Note: The file names of all files referenced in the menu.lst file that are displayed on the hard disk need to be in lowercase, and uppercase ones need to be changed to lowercase. 【Figure 9】
4) Make ISO. Use UltraISO to create a new ISO file, add all files in the E:\3333\grubcd directory to the ISO file; perform "Bootable CD-ROM" - "Load boot file", select the grldr file (need to rename grldr to grldr.bin or grldr.bif, etc.). Then perform "File" - "Properties", select the "Allow lowercase letters" option, and save the ISO file. 【Figure 10】【Figure 11】【Figure 12】
It can also use tools such as mkisofs.exe or CDIMAGE.EXE to make a bootable ISO (grldr does not need to be renamed).
For example, the batch processing I use to make ISO with CDIMAGE is:
cdimage -lgrubcd -t01/01/2007,00:00:00 -h -n -o -d -m -bgrldr grubcd grubcd.iso
5) Burn the made bootable ISO with Nero and other software. It is better to test it in a virtual machine first before burning it, or use CD-RW/DVD+RW to burn it.
2.2.2 Bootable CD-ROM with BCDW guiding GRUB
This method is to use BCDW to make a bootable CD-ROM, and execute grldr through BCDW to load the menu.lst menu.
Steps:
1) First download the BCDW software package, unzip it to get the required files.
2) Organize files. For example, create a bcdwcd directory under E:\3333. The files in this directory will be in the root directory of the CD-ROM. Create a boot\grub directory and a bcdw directory under it. Copy bcdw.bin, bcdw.ini and loader.bin in the bcdw directory of the software package to the created bcdwcd\bcdw directory; copy grldr, various img, fonts and other files to the bcdwcd\boot\grub directory. The editing method of the menu.lst file is the same as that introduced in 2.1 above.
3) Edit the bcdw.ini file. Open bcdw.ini, find the part, for example:
C:\ ; Boot from drive C:
\I386\setupldr.bin ; Microsoft Windows XP Setup
The above is an example of the BCDW boot menu. Add items such as GRUB here to become:
\images\gghost.img ; GGhost v6.0 (Ghost8.3/11)
\images\mynet.img ; My net (Ghost8.3)(tcp/ip,cd/usb)
\boot\grub\grldr ; Grub4dos
\WXPE\SETUPLDR.BIN ; Micro Windows XPE (by LaoMaotao)
C:\ ; Boot from drive C:
\I386\setupldr.bin ; Microsoft Windows XP Setup
4) The method of making the ISO file and burning the ISO is basically the same as in 2.1. The only difference is that when making the ISO file, loader.bin (or bcdw.bin) should be used as the boot file of the ISO. 【Figure 13】
It can also use tools such as mkisofs.exe or CDIMAGE.EXE to make a bootable ISO.
For example, the batch processing I use to make ISO with CDIMAGE is:
cdimage -lbcdwcd -t01/01/2007,00:00:00 -h -n -d -o -m -bload.bin bcdwcd bcdwcd.iso
After running, the effects of the BCDW interface and the GRUB interface are shown in the following figures. 【Figure 14】【Figure 15】
2.3 Applications on the floppy disk
There are mainly two ways to apply GRUB on the floppy disk, namely starting GRUB through DOS and installing the GRLDR boot record in the boot sector of the floppy disk. 【Refer to 1.3 How to install GRUB4DOS】
2.3.1 Floppy disk application of starting GRUB through DOS
First, make the floppy disk into a bootable disk. The simplest one, 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 four 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 start the img file on the hard disk, and can also be used to manage the boot of each system. The files specified in the menu file (such as font, img file, 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 Start the operating system on the first primary partition (hd0,0) of the first hard disk
rootnoverify (hd0,0)
makeactive
chainloader +1
title Start the operating system on the second primary partition (hd0,1) of the first hard disk
rootnoverify (hd0,1)
makeactive
chainloader +1
title Reboot
reboot
title Shutdown
halt
2.3.2 Floppy disk application with GRLDR boot record installed in the boot sector
After the GRLDR boot record is installed, only grldr, menu.lst and the files referenced in menu.lst need to be retained on the floppy disk. The menu.lst file is the same as that used in "2.3
Recent Ratings for This Post
( 2 in total)
Click for details
Windows 一键还原
http://www.yjhy.com
http://www.yjhy.com

DigestIII
StickyII