Re: How do I make a boot disk so I can restore Grub?

From: Thomas D. Shepard (ImaSpammer_at_spam.sux)
Date: 01/25/05


Date: Tue, 25 Jan 2005 02:58:42 -0800

On Mon, 24 Jan 2005 15:33:28 -0600, ANTant wrote:

> Hello. I need to install Windows 2000 SP4 on a second IDE HDD (hdb).

One of my favorite sayings (inspired by Python): "You don't *need*
windoze."

> Debian (Kernel v2.6.8) and its Grub is already installed on the first
> HDD (hda). I read that Windows will overwrite the MBR.

Yes it does. Billy Gates likes to assume that there is no operating system
in the universe other than his piece of crap.

 I was told that I
> need to make a boot disk so I can restore MBR after Windows
> installation. How do I make a boot disk and be able to restore Grub on
> MBR. I hope I am saying this right since it is a bit technical for me.
>

Looking at what you wrote below, you seem to be off track a bit. Since you
already said you are using Grub (which is excellent), you should not be
talking about lilo at all. Lilo and Grub are two different bootloaders,
and all that lilo stuff is irrelevant to Grub. I prefer Grub and feel that
you should stick with it.

The documentation in the Grub info (not man) documentation explains
everything very well. Read it thoroughly before messing with any of this,
because you may very well find yourself manually issuing commands to Grub
to get back on line after you infect your system with windoze. Pay close
attention to the parts about chainloading.

The command for making a Grub boot floppy is simply "setup (fd0)" assuming
fd0 is your floppy drive and you are in grub and have already told grub
where your boot partition is. You should be running grub in standalone
mode (booting from it rather than launching it from the linux command
line) when you do this.

One very cool trick (documented in the latest
version of Grub) is to set up a menu option to make boot disks from the
Grub boot-up screen. Below is my /boot/grub/menu.lst file. It allows me to
select from two different linux kernels or to setup a boot floppy. The
entry that makes the boot floppy is entry number 2. Also note entry number
1, which installs the grub bootloader onto my "first" hard drive. This is
EXACTLY what you need except that you need to replace the "hd0,0" part
with the designation for wherever your boot partition is. This entry
number 1 is there for precisely the situation where the MBR gets clobbered
(which really isn't likely for me since my computer is not infested with
windoze). If I try to boot and see that my MBR is clobbered, I simply
ctl-alt-delete to start over and select this entry to restore the MBR. No
need to hunt for documentation or anything!

I have a separate partition for /boot. If your /boot directory is
actually on your root partition, and if your root partition is the first
one on the drive, then I *think* this becomes "root (hd0,0)/boot" But,
like I said, read the documentation really well before you mess with this.

(In my case, my boot partition is the first one on the drive, and the root
partition is the second one.)

Here is my Grub setup file (/boot/grub/menu.lst):

# This is the Grub (Grand Unified BootLoader) configuration file.
# See info grub for documentation.
# Thomas D. Shepard, 28 August 2004

# By default, boot this entry (counting from 0).
default 0

# Boot automatically after this many seconds.
timeout 10

# This is entry number 0.
# Boots kernel in file lfskernel in top directory of first partition
# in first hard drive.
# (hd0) means first hard drive. (hd0,0) means the first partition.
# The kernel is passed the command-line arguments "ro root=/dev/hda2"
# Which means to mount /dev/hda2 (the second partition of the first hard
# drive) read-only as the root partition.
#
title Boot Linux from the first hard drive
        root (hd0,0)
        kernel /lfskernel ro root=/dev/hda2

# This is entry number 1. It installs or re-installs Grub onto the boot
# sector of the first hard drive.
#
title Install Grub onto the MBR of the first hard drive (experts only)
        root (hd0,0)
        setup (hd0)

# This is entry number 2. It makes a Grub boot floppy.
#
title Make boot floppy (insert blank floppy first)
        root (hd0,0)
        setup (fd0)

# This is entry number 3. It boots vmlinuz-2.6.10.
#
title Boot Linux 2.6 from the first hard drive
        root (hd0,0)
        kernel /vmlinuz-2.6.10 ro root=/dev/hda2

>
> mkboot and lilo didn't work for me:
> # mkboot
>
[...]

-- 
Thomas D. Shepard
I am sorry, but you can't email me.
ImaSpammer@spam.sux is not a real email address. I figure if someone wants to
harvest an email address to use for sending spam, they may as well use this one.


Relevant Pages

  • fixing grub : mbr fix when windows install after linux
    ... "There is not a boot manager screen at all, ... windows but GRUB boot window does not appear. ... "I forgot to install GRUB, I didn't install GRUB in the MBR, I chose ... Fedora but that was not an active primary partition". ...
    (comp.os.linux.misc)
  • Re: OT File recovery Software
    ... > I guess some of you never used the fix MBR command? ... > The Master Boot Record will be created when you create the first ... > partition on the hard disk. ... > first sector on the disk. ...
    (alt.med.fibromyalgia)
  • Re: Fedora Core 2/Windows XP dual boot: selecting Linux doesnt work
    ... grub is installed on the /root partition, which is the first partition on hdc: hdc1, or in grub notation. ... Stage1 is the unpatched 512-byte file, that is patched and copied to the boot record during setup. ... This byte is initialized to 0xff in the stage1 file, but patched to 0x81 in your setup, to say "we are booting from disk." ...
    (comp.os.linux.setup)
  • Re: Please Help: system keeps rebooting after installing FC3
    ... writing to the MBR even when i opt not too. ... F8 everytime i boot to toggle BIOS to boot from my hdb. ... get hold of various other boot loaders, grub fail the same way as yours. ... The installation went smooth and at the end I needed ...
    (linux.redhat)
  • Re: [opensuse] Yast & Grub bootloader different.
    ... My Grub bootup menu is different than the bootloader ... that shows up on the logon screen aat boot time. ... any boot loader for that matter, can only operate on one /boot partition at ... Grub doesn't scour the all hard drives on each install ...
    (SuSE)