Click to See Complete Forum and Search --> : Can't reinstall GRUB


cypherzero
05-03-2007, 06:45 PM
I have GRUB set up to boot from my internal disk (Windows) but it is looking for files on my external disk (Linux)- this means I can't boot up Windows without my external disk always attached, this makes my laptop very un-portable!

I have a small ext3 partition on my internal disk that I have used in the past to get around this problem, but now when I try:
$ sudo grub-install /dev/sda --root-directory=/media/g/
I get the error:
/dev/sda does not have any corresponding BIOS drive.

Also, in the past my internal disk has always been /dev/hda.

Anyone have any ideas on how to get GRUB to recognise that it can install to my internal disk?

jaygee432
05-03-2007, 08:40 PM
Two suggestions: First, use a live cd such as ubuntu's to install grub where you want it, or, install grub for dos as described in my post http://www.justlinux.com/forum/showthread.php?t=148110
Your situation as I understand it seems like that.

knute
05-04-2007, 01:49 PM
I suppose that you could go thru the configuration of grub and see what is being referenced for /dev/sda.

Also, the command that you are using to install grub NEEDS to have the external drive to be able to get the files that it needs to install grub, so I don't see the connection.

Now, in order to get grub set up you would actually need to have your /boot partition on your internal drive (/dev/hda in linuxspeak and hd(0,x) in grubspeak (the x is the partition number btw)). After you have it set up like that you shouldn't have any other issues unless you try to boot into linux without having the external drive connected.

Have you gone thru the grub manual and done the grub setup manually (http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively)?

saikee
05-04-2007, 03:44 PM
I think the problem could be more than skin deep depending how one wants to tackle it.

The problem would have gone away if the OP poster arranges Grub in the MBR of the external disk and tells the Bios to boot the external disk before the internal disk. No external disk connected Windows boots. External disk connected Linux boots.

Alternatively go with Knute suggestion of having /boot in the internal disk.

Either way to advise further we need to see the output of

(1) fdisk -l
(2) /boot/grub.device.map
(3) /boot/grub/menu.lst
(4) /etc/fstab

There is a 3rd method too. Grub can be installed unattached to Linux in the spare partition so it boot Windows without the need of a Linux from the external drive.

cypherzero
05-04-2007, 07:39 PM
Thanks for all your help, but I've got the problem sorted (kind of) - I had recently reordered my boot BIOS options and it seems GRUB doesn't like me having put 'CD' above 'removable devices'. No idea why.
I tried Grub4DOS and it wiped my MBR (no idea why, but I'm not trying again!)
The Ubutnu Linux installer kept crashing if I changed the grub options, which is why I'm not booting from the external drive - mind you I'm a Linux newbie and I probably got something wrong :)

stumbles
05-05-2007, 06:57 AM
From a terminal as root just "mv /boot/grub/device.map /boot/grub/device.map.orig" "and then "grub-install hd0"