[PLUG] how to re-install GRUb

Russell Senior seniorr at aracnet.com
Sat Aug 2 00:26:02 UTC 2003


>>>>> "Jerry" == Jerry Lake <upstarter at msn.com> writes:

Jerry> Hello, I was away for the weekend and when I returned, my
Jerry> primary drive was clicking and dead. Fortunatley most of my
Jerry> stuff is on my slave drive including my Linux
Jerry> partition. However, now my MBR is missing the linux info and my
Jerry> boot floppy is nowhere to be found. How do I resetup GRUB so I
Jerry> can dual boot again? btw I'm running RedHat 9

I did this for someone at the last clinic.  What I did was make a grub
floppy[1] and used that to boot the existing intact linux installation
from grubs command-line[2].  Once booted, I did a grub-install /dev/hda
(or whatever) and everything was golden[3].

[1] from, perhaps, another working system or some other source:

    # cd /boot/grub
    # dd if=stage1 of=/dev/fd0 bs=512 count=1
    1+0 records in
    1+0 records out
    # dd if=stage2 of=/dev/fd0 bs=512 seek=1
    153+1 records in
    153+1 records out

    there are rawrite equivalents for doing this from lesser operating
    systems, e.g.:

    > copy /b stage1 + stage2 boot
    > rawrite boot a:

[2] from the grub prompt:

    > root (hd0,0)
    > kernel /boot/vmlinuz root=/dev/hda1
    > boot
  
    salt to taste.  The first line should indicate the partition where
    linux is installed.  I've assumed /dev/hda1 here.  One of the nice
    things about grub is that you have filename completion, which can
    help you find the version of the kernel you want, e.g.:

      /boot/vmlinuz-X.Y.Z-foo 

    The tab key will show you what is available.

[3] actually, in my case it was slightly more complex in that the
    /boot directory was on a separate filesystem, so that certain grub
    "tricks" were required for grub-install to work correctly, I think
    in this case I created a symbol link in /boot from boot -> .,
    i.e.:

    # cd /boot
    # ln -s . boot


-- 
Russell Senior         ``shtal latta wos ba padre u prett tu nashtonfi
seniorr at aracnet.com      mrlosh''  -- Bashgali Kafir for ``If you have
                         had diarrhoea many days you will surely die.''




More information about the PLUG mailing list