How to Create a grub boot Disc

Source: Internet
Author: User

Http://whiteyes.blog.hexun.com/9723224_d.html

 

Rename the downloaded grldr directly to grldr. BIF, use ultraiso to create an ISO image, and select "Boot disc-load boot information" to load grldr. BIF.
This is because the newly created ISO image already has the CD boot function. The GRUB menu file menu. lst should be placed in the root directory of the CD; otherwise, the grldr cannot be found after it is started.

Many websites Article It describes how to install grub on a floppy disk. This floppy disk can be used when the boot information of the hard disk is damaged. However, it is much more convenient for users who do not have a software drive or who are not convenient to use a software drive. This article describes how to create a CD.
First, let's assume that we have a good Linux release (including the cdrtools Software Package), CD or DVD recorder (which has been configured and can work properly in Linux. For how to set it, many articles on the Internet), grub software package.
My system is RedHat Linux 9.0, but the grub package of this release does not contain the stage2_eltorito file we need most (this file is the most important file for creating the grub boot disc) so I downloaded grub of version 0.95. Address: Ftp://alpha.gnu.org/gnu/grub/grub-0.95.tar.gz
Next we will install grub in the same way as most source code packages. We need:
Tar zxvf grub-0.95.tar.gz
CDS grub-0.95
./Configure
Make
Make install
Okay, grub is installed. (stage2_eltorito is obtained. To save your time, I extracted this file. If anyone can upload the file for download, mail it to me)
Now, we can get our grub image:
Mkdir ISO
Mkdir-p iso/boot/GRUB
CP/stage2_eltorito path/stage2_eltorito ISO/boot/GRUB
CP/boot/GRUB/menu. lst iso/boot/GRUB
Mkisofs-r-B boot/GRUB/stage2_eltorito-no-emul-boot-load-size 4-boot-Info-table-O grub. ISO
Now grub. ISO is the image you need.
Then, use cdrecord or the front-end to engrave the image in CDR/RW.
Cdrecord-V Dev = 0, 0/grub. ISO path/grub. ISO speed = 8
Modify the preceding command according to your own situation.
Now we get a grub boot disc.
Of course, since creating a grub boot disc only requires more than 200 K bytes, you can put some other useful things in the ISO folder to create an image when creating the ISO.
Thanks to the original address provided by linuxaid's netizen ":
Http://www.gnu.org/software/grub/manual/html_node/Making-a-GRUB-bootable-CD-ROM.html

 

How does grub go to the CD? What is written into MBR?
Use ezboot to call the grub production method on the CD!
1. Put the "isogrub. bin" file to the "ezboot" directory on the CD.
2. Put the "stage2" file in the root directory of the CD.
3. Then set grubProgramFiles, IMG files, and zip files are stored in the CD directory.
4. Use "ezboot" to call "isogrub. bin" to start it.

The traditional grub is started with the stage2_eltorito file, but mkisofs is required. You can use isogrub. bin to get rid of this restriction, but you must put the stage2 file in the root directory of the CD. The version of this stage2 file is not required. For example, you can use the once famous blue dot stage2 file...

On a floppy disk, you have to do this:
Create directory A: \ Boot \ grub \ on a floppy disk \
Then place stage1 and stage2 in the file. (Note that you cannot use the stage1 file that supports one-click recovery)
Start a grub command line and run:
Grub> root (fd0) Description: Location of stage1, stage2, menu. lst
Grub> setup (fd0) install it
You can test now:
Grub> chainload (fd0) + 1
Grub> boot
You can.

 

Create a grub with splash to boot an ISO image without a soft drive

It is best to have a ready-made floppy disk image that can be extracted from the RedHat installation disc boot. IMG.

Rename or delete the/dev/fd0 file (if you do not have a soft drive, this device is useless, and the udev system will automatically create this file when the system starts ). Rename boot. IMG to/dev/fd0.

Format the image: mkfs. ext2/dev/fd0 Mount/dev/fd0. Unlike mounting a device file, you need to add the loop parameter (-o loop ). Copy the/boot/GRUB/directory of your existing Linux operating system to the mounted directory. Note that the path to the root directory should also be boot/grub.

Run the grub program and run the following command:
Root (fd0)
Setup (fd0)

Now, you can use qemu to test the boot floppy disk image:
Qemu-FDA/dev/fd0-boot

This image can be used to burn bootable CD. K3b has this function.

It's splash's turn. Our boot CD naturally hopes to be colorful. I won't talk about how to patch and compile grub to support splash.

Make sure that the grub you are using has a splash patch, and then find a picture you like, preferably 640xlarge. Use gimp to edit it slightly, and then use the following command to convert the color depth:
Convert splash.jpg-colors 14 splash. XPM gzip splash. XPM

Edit/boot/GRUB/menu. lst in your disk image and add the following sentence:
Splashimage/boot/GRUB/splash.xpm.gz

Then run GRUB:
Root (fd0) setup (fd0)

OK! The following is to save/dev/fd0 to the place where you want it to exist for future use.

Tips 1: You can edit your/dev/fd0 file, for example, add a small Linux -- oh, of course, you can add a large Linux

Tips 2: What is the use of this ISO? Haha, for me, the main purpose of doing it is to let it guide the Linux installed on my mobile hard disk, where the same operating system can be used everywhere. Another role is to use Windows to easily restore your boot zone when it is damaged. I used knoppix to recover it, which is troublesome!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.