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

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


Date: Tue, 25 Jan 2005 15:13:31 -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).
> 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. Windows is evil, Gates assumes the whole computer belongs to
him, so no need to accommodate anyone wanting to run non-MS software.

 I was told that
> I need to make a boot disk so I can restore MBR after Windows
> installation.

Or there are various tricks you can play to hide the drive from windoze
during the install. You could try disconnecting the cable for example, but
there can be glitches.

 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.
>

You use the setup command within Grub.

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

NO... You said you were using Grub, not Lilo. Lilo is a different
bootloader. None of the lilo stuff applies.

> Here's my current disk setup:
> a...@ANTian-AXP ~ =) $ more /etc/fstab
>
> # /etc/fstab: static file system information.
>
> #
>
> # <file system> <mount point> <type> <options> <dump> <pass>
>
> proc /proc proc defaults 0 0
> /dev/hda1 / ext3 defaults,errors=remount-ro 0 1
> /dev/hda8 /home ext3 defaults 0 2
> /dev/hda7 /tmp ext3 defaults 0 2
> /dev/hda5 /usr ext3 defaults 0 2
> /dev/hda6 /var ext3 defaults 0 2
> /dev/hda9 none swap sw 0 0
> /dev/hdb1 /stuff ext3 defaults 0 2
> /dev/hdb5 /storage ext3 defaults 0 2
> /dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
> /dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
>
>

First, read the Grub info documentation. Then, consider adding something
like this to your Grub configuration file (/boot/grub/grub.conf or
/boot/grub/menu.lst, typically).

title Install Grub onto the MBR of the first hard drive (experts only)
        root (hd0,0)/boot
        setup (hd0)

title Make boot floppy (insert blank floppy first)
        root (hd0,0)/boot
        setup (fd0)

Make sure your config file does not disable the boot menu. Re-boot and
when you get to the boot menu, select the entry that says "Make boot
floppy...." Put a blank floppy in the drive and launch the menu entry.

Test this to make sure you can boot from the floppy, as my instructions
may not be perfect. After you infect your computer with windoze, you can
boot from the floppy and select the menu entry that says "Install Grub
onto the MBR of the first hard drive..." to recover the bootloader.

You will also need to consult the documentation to see how to configure
grub to boot windoze.

It is a good idea to print out the Grub documentation and practice
recovering your system by using grub commands to "discover" where your
kernel is and booting it manually. This is a really useful skill.

-- 
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

  • 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: remove partaion
    ... The most interesting hurdle will be what the Master Boot Record ... thus kill GRUB. ... I would copy your MBR and first 63 sectors (see the MBR Copy Appendix ... GUI or command line commands to accomplish that. ...
    (Fedora)
  • Re: How do I make a boot disk so I can restore Grub?
    ... I read that Windows will overwrite the MBR. ... > need to make a boot disk so I can restore MBR after Windows ... How do I make a boot disk and be able to restore Grub on ... with the designation for wherever your boot partition is. ...
    (comp.os.linux.setup)
  • Re: GRUB Problems with Dell Optiplex GX1
    ... inappropriate boot image when they turn it on... ... It will boot from a floppy, but installing it to ... FreeBSD folks tend not to use Grub, ...
    (freebsd-questions)
  • Re: GRUB, MBR and NTLDR confusion
    ... that GRUB can be loaded on to the boot partition instead of the MBR ... What you want is to install it to the MBR of /dev/hda. ...
    (Ubuntu)