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

From: R S Prigan (NO-SPAM-TO-rprigan_at_insight.rr.com)
Date: 01/30/05


Date: Sun, 30 Jan 2005 01:34:19 GMT

ANTant@zimage.com 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. 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.
>
>
> mkboot and lilo didn't work for me:
> # mkboot
>
> Insert a floppy diskette into your boot drive, and press <Return>.
>
> Creating a lilo bootdisk...
> Kernel is at /boot/vmlinuz-2.6.8-1-k7 in /boot
> Matching initrd image is /boot/initrd.img-2.6.8-1-k7
> usr/sbin/mkboot: line 93: /etc/lilo.conf: No such file or directory
> Could not find the requested kernel in your
> current /etc/lilo.conf .
> The mkboot script can probably do better.
>
> Here is the proposed lilo.conf:
>
> # floppy lilo.conf
> boot = /dev/fd0
> install = boot.b
> map = map
> root = /dev/hda1
>
> You can install the boot-loader from this best guess,
> or you can try to install from a `vanilla\' lilo.conf .
>
> Which do you choose? (Enter B for best, V for vanilla): B
> Installing the best-guess lilo.conf...
> /usr/sbin/mkboot: line 261: lilo: command not found
>
> I was worried so I rebooted the box to see if it even works. Nope, I got
> "DISK BOOT FAILURE. INSERT SYSTEM DISK AND PRESS ENTER."
>
> I can confirm that same boot disk failed in VMware v4.5.1's Windows 2000
> SP4 guest image on a Windows XP Pro SP2 host machine.
>
>
> 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
>
>
> a...@ANTian-AXP ~ =) $ df
>
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/hda1 135468 93213 35028 73% /
> tmpfs 518288 0 518288 0% /dev/shm
> /dev/hda8 20121812 2726656 16373024 15% /home
> /dev/hda7 369000 8244 341096 3% /tmp
> /dev/hda5 4807056 1871480 2691392 42% /usr
> /dev/hda6 2885780 475916 2263276 18% /var
> /dev/hdb1 861728 16432 801524 3% /stuff
> /dev/hdb5 5336664 558388 4507184 12% /storage
>
> ANTian-AXP:/home/ant# /sbin/fdisk /dev/hda
>
> The number of cylinders for this disk is set to 3647.
> There is nothing wrong with that, but this is larger than 1024,
> and could in certain setups cause problems with:
> 1) software that runs at boot time (e.g., old versions of LILO)
> 2) booting and partitioning software from other OSs
> (e.g., DOS FDISK, OS/2 FDISK)
>
> Command (m for help): p
>
> Disk /dev/hda: 30.0 GB, 30003240960 bytes
> 255 heads, 63 sectors/track, 3647 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hda1 * 1 18 144553+ 83 Linux
> /dev/hda2 19 3647 29149942+ 5 Extended
> /dev/hda5 19 626 4883728+ 83 Linux
> /dev/hda6 627 991 2931831 83 Linux
> /dev/hda7 992 1040 393561 83 Linux
> /dev/hda8 1041 3585 20442681 83 Linux
> /dev/hda9 3586 3647 497983+ 82 Linux swap /
> Solaris
>
> ANTian-AXP:/home/ant# /sbin/fdisk /dev/hdb
>
> Command (m for help): p
>
> Disk /dev/hdb: 6448 MB, 6448619520 bytes
> 255 heads, 63 sectors/track, 784 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
>
> Device Boot Start End Blocks Id System
> /dev/hdb1 1 109 875511 83 Linux
> /dev/hdb2 110 784 5421937+ 5 Extended
> /dev/hdb5 110 784 5421906 83 Linux
>
>
> Please note that I am not a Linux/UNIX expert. Debian's Sarge installer
> set up these partitions for me back in October 2004 since I had no ideas
> how to configure my partitions. I am still learning my ways in it. Thank
> you in advance. :)

make a *standard* GRUB disk (a good thing to have anyway!). Test it before
you fool with windows. Then you can use it to get GRUB shell to boot into
Sarge, then reinstall GRUB to hda

Read the GRUB docs for particulars: man grub & info grub
you can get these in konqueror as well
man:/grub
man:/grub-install
info:/grub

Sometimes getting windoze to cooperate with not being on the first drive
requires a little finagling in your final grub setup

e.g. here's W98 on hdb1 in /boot/grub/menu.lst

title Windoze 98
    map (hd1) (hd0)
        map (hd0) (hd1)
    root (hd1,0)
    chainloader +1

You could always "trick" windows during install if you have a BIOS that can
switch disks order -- set it up to control hdb boot sectot, and then
configure grub set ... but be careful

NT/2000/XP is suposed to have it's own boot loader -- but i woul;dn't want
it to control hda boot sector!

good luck!



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: *** STOP: (0x0000007B,0XF85438D0,0XC000009C,0X00000000,0x00000
    ... To start the Recovery Console, start the computer from the Windows XP CD-Rom ... and fixmbr for limited disk repairs. ... | Dave I could not create a boot disk at home, but I had created one at work ...
    (microsoft.public.win2000.general)
  • Re: CHKDSK repeatedly runs.
    ... How do I change the registry so this doesn't keep happening? ... There are times when the disk checking utility needs to ... run before you boot into Windows. ... I have a two year old laptop running Windows XP. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Install FC2 in external HD + boot via floppy
    ... a external HD and keep the XP on the internal disk. ... that my laptop does not boot from the usb... ... An alternative way of creating a cd that will boot grub is shown below. ... Making a GRUB bootable CD-ROM ...
    (Fedora)
  • 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)