Linux hard disk installation using Grub for DOS

Source: Internet
Author: User
Tags ide hard drive

GRUB. EXE is completely GRUB, but it is repackaged so that it can run in DOS. Therefore, GRUB. EXE has all the excellent features of GRUB that you are familiar with before. Currently, grub_for_dos's latest stable version 0.0.8 can be obtained from:

Ftp://ftp.cosoft.org.cn/incoming/grub_for_dos-0.0.8.tar.gz or go to the directory to view: ftp://ftp.cosoft.org.cn/incoming/

Version 0.0.8 can be nested multiple times under the drive ing) to run GRUB. EXE securely. When GRUB. EXE is run, the previous drive ing is automatically uninstalled to restore the old BIOS int13 interrupt vector. Development series such as version 0.1.4) of course also has this function.

After decompression, copy the grub.exe file to the hard disk partition of DOS or the DOS floppy disk. Usage:

Grub -- config-file = (hd0, 0)/boot/grub/menu. lst

Or do not include the following parameters:

Grub

The default configuration file is (hd0, 0)/boot/grub/menu. lst.

If Linux cannot be started after installation, the possible cause is Lilo failure. At this time, you can use a grub boot floppy disk to boot successfully. If you do not have a grub boot floppy disk, you can use a DOS boot floppy disk and add a grub.exe file to easily obtain grub's powerful multi-boot functions.

By the way, a floppy disk created using the "DOS boot disk + GRUB. EXE" method can be used to start DOS and other operating systems. It is a truly "omnipotent boot floppy disk ". This floppy disk can also boot DOS when the hard disk cannot boot DOS/Windows. The GRUB floppy disk created using other methods cannot be used as the DOS boot disk again. Here the "DOS boot disk" can be a MS-DOS, also can be FreeDOS By The Way, FreeDOS build 2029 has supported Win98 FAT32 large partition format ).

Another scenario: When you reinstall Windows, Windows will rewrite MBR to erase the startup code of LILO or GRUB. With GRUB. EXE, you can start other operating systems without a floppy disk. Assume that your Windows OS is 9x or your hard disk is installed with DOS ).

Loadlin.exe can also be used to start Linux, but loadlin requires a kernel file vmlinuz). The kernel file must be in the DOS/Windows partition, sometimes this kernel file is not suitable for your recently installed Linux system kernel. GRUB. EXE does not have such restrictions. It can give you great freedom. It starts from DOS, and can find any file including kernel file from Linux partition ), it is easy to know that this kernel matches with the system to be booted, so as to guide the Linux system.

Loadlin.exe is also a Linux boot tool that can be used without installation. Grub.exe is different in that it is a boot manager that can guide other operating systems.

Search for GRUB details in the search engine http://www.google.com. Here is just a very common simple example, the command line operation:

Grub> find/boot/vmlinuz

(Hd0, 7)

Grub> root (hd0, 7)

Grub> kernel/boot/vmlinuz root =/dev/hda8

Grub> boot

A few simple grub commands can be used to start Linux. Is it very convenient? By the way, grub's find command is good. grub even has a cat command to display the content of a file. Run the help command at the grub prompt to obtain online help. The Partition Number (hd0, N) of grub is generally Linux/dev/hda (N + 1). For example, (hd0, 7) is/dev/hda8, if you are using a SCSI hard disk, It is/dev/sda8. In a special case, grub displays (hd0, 7) it will be Linux/dev/hdb8, that is, the first BIOS hard disk (hd0) found by GRUB is/dev/hdb in the system. A complex example:

Find the location of the kernel file in the system:

Grub> find/boot/vmlinuz

(Hd0, 7)

// If you use a separate boot partition, use

Grub> find/vmlinuz

. Assume that the result is

(Hd0, 6)

// Find the root partitions in the system:

Grub> find/sbin/init

(Hd0, 7)

// The command to start the kernel is:

Grub> kernel (hd0, 6)/vmlinuz root =/dev/hda8

Grub> boot

If your (hd0, 7) is not/dev/hda8 but/dev/hdb8, try it:

Grub> kernel (hd0, 6)/vmlinuz root =/dev/hdb8

Grub> boot

The partition number is accurate, and only the hard disk number may change. there are only four changes to the IDE Hard Drive: hda, hdb, hdc, hdd, one by one test, which can always be successful. of course, if you are using a SCSI hard disk, You need to test sda, sdb, sdc, sdd, etc.

GRUB also supports menu operations. GRUB. the default menu configuration file of EXE is (hd0, 0)/boot/grub/menu. as mentioned earlier, the location of this configuration file can be re-specified by the DOS command line parameter. The default partition of this file is (hd0, 0). It can be DOS/Windows FAT12, FAT16, FAT32, or Linux ext2, it can also be another partition type supported by GRUB. By the way, the new version of GRUB will support the ISO optical disc format, NTFS file system, and the img file with a floppy disk image to guide the machine. This is especially suitable for users who want to start the machine without a floppy disk ).

To remind you, google is powerful: typing grub.exe in the search box of the http://www.google.com/can quickly find the page of this article.

Attachment: RedHat and Mandrake hard disk installation method

Assume that your (hd0, 0), or/dev/hda1 partition, is a DOS partition, and all your ISO files are already in this partition. You have created a boot subdirectory under the root directory of the DOS partition, created a grub subdirectory under the boot directory, and added a name named menu in the grub directory. the content of the lst file is as follows:

Default = 0
Timeout = 30

Title Red Hat 9 hard disk install

Root (hd0, 0)
Kernel/boot/vmlinuz-redhat9
Initrd/boot/initrd-redhat9.img
Title Mandrake 9.1 hard disk install

Root (hd0, 0)
Kernel/boot/vmlinuz-mdk9.1 ramdisk_size = 128000 root =/dev/ram3 automatic = method: disk acpi = off vga = 788
Initrd/boot/hd-mdk9.1.rdz
Title Mandrake 9.1 network install

Root (hd0, 0)
Kernel/boot/vmlinuz-mdk9.1 ramdisk_size = 128000 root =/dev/ram3 acpi = off vga = 788
Initrd/boot/network-mdk9.1.rdz
Title Mandrake 9.1 hdcdrom_usb install

Root (hd0, 0)
Kernel/boot/vmlinuz-mdk9.1 ramdisk_size = 128000 root =/dev/ram3 acpi = off vga = 788
Initrd/boot/hdcdrom_usb-mdk9.1.rdz
Title Mandrake 9.1 cdrom install

Root (hd0, 0)
Kernel/boot/vmlinuz-mdk9.1 ramdisk_size = 128000 root =/dev/ram3 automatic = method: cdrom acpi = off vga = 788
Initrd/boot/cdrom-mdk9.1.rdz
Title Windows

Rootnoverify (hd0, 0)
Chainloader + 1
Title Chainload the Old MBR, that is, the original MBR
Rootnoverify (hd0, 0)
Chainloader (hd0, 7)/boot/boot0000300

Haha, an episode: the last section (hd0, 7) is assumed to be your Linux Root partition. In Linux, the MBR is usually stored in the/boot/boot0000300 file of the Linux Root partition. We can use it to guide the original operating system. This may be useful for systems that are incompatible with Windows XP. If you use this method to guide Win XP, you should be sure that the boot0000300 file is a copy of the MBR primary boot sector that was used to guide WinXP, And the WinXP partition is not changed during Linux installation, for example, add a new Linux partition to the free space at the end of the hard disk ).

Note:The boot Directory should contain the vmlinuz and initrd files of redhat and mandrake. Their names can be arbitrary, as long as the names of redhat and mandrake do not conflict with each other and do not overlap. These files can be found in the first disc of redhat and mandrake. On the CD, redhat is called vmlinuz and initrd. img, while mandrake is called vmlinuz, hd. img, network. img, and so on. You need to continue to retrieve vmlinuz, hd. rdz, and network. rdz files from hd. img or network. img. Redhat does not need to be so troublesome. The initrd. img file is directly stored on the CD ].

Run grub.exe from DOS, and the installation menu should be displayed on the screen. Nice, right?

Since the installation program of Mandrake cannot automatically search for CD2 and CD3, it is a little more complicated to install with the ISO file. I like to solve this problem as follows:

First install a basic system with cd1. If the "file not found" error occurs, press "continue installation ". After the installation is complete, enter a terminal and enter the command Description: rc3 is exactly the same as the official version ):

Mkdir/mnt/cd1;

Mkdir/mnt/cd2;

Mkdir/mnt/cd3;

Mount-o loop MandrakeLinux-9.1-rc3-CD1.i586.iso/mnt/cd1;

Mount-o loop MandrakeLinux-9.1-rc3-CD2.i586.iso/mnt/cd2;

Mount-o loop MandrakeLinux-9.1-rc3-CD3.i586.iso/mnt/cd3;

Go to the "KDE menu"> "Settings"> "Mandrake control center", and enter the root password. Click "software management" in the left column, and then click the icon marked with "software source Manager helps you define where to download software packages" in the right column. Click "add" in the "Configure source" dialog box that appears. In the "add a source" dialog box that appears, there is a "name" column, you enter "cd1 ", in the "path" column, enter "/mnt/cd1". The default source type is "local file". Do not change it. There is also a "relative synthesis/hdlist path" column, so that it is empty, do not fill in anything. OK. Click "OK ".

Similar processing is performed for cd2 and cd3.

Click "Save and exit ". Go to the Mandrake control center and click the "RpmDrake help you install software packages" icon in "software management". Wait a minute to see the software packages in the three ISO files, you can choose to install it.

Related Articles]

  • Download graphic installation tutorials for various Linux operating system versions
  • MD5 encryption method of GRUB in Linux
  • Hard Disk partitioning and Grub boot settings for multiple operating systems

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.