LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB installed on wrong hard drive? How do I fix it? (https://www.linuxquestions.org/questions/linux-newbie-8/grub-installed-on-wrong-hard-drive-how-do-i-fix-it-782775/)

Rashkavar 01-17-2010 11:22 AM

GRUB installed on wrong hard drive? How do I fix it?
 
First of all, I'm pretty much a total newbie for Linux - I haven't touched it since 2006, and even then only for a couple of high school IT courses and not as my own PC.

I installed kubuntu 9.10 yesterday, and was somewhat confused by the fact that the hard drives listed in the partition management segment did not match up with the physical layout. SATA1 on the motherboard is labelled as sdb and SATA3 is labelled as sda (with SATA2 left empty since it's a dead port, even the bios can't detect a hard drive plugged into SATA2, and SATA4 reserved for my eSATA connection once I get the proper cables). The motherboard is an ASUS A8N-E, if you need it.

Table below shows physical location on motherboard - partition label in Linux - mount point
SATA1 - /dev/sdb1 - /
SATA1 - /dev/sdb5 - swap
SATA3 - /dev/sda1 - /home

I was mildly concerned, but then decided to blame my slowly-dying motherboard, and figured Linux would be able to sort things out properly. Unfortunately (and perhaps predictably to those more knowledgeable about how Linux works), it installed GRUB on sda. Since this is connected to SATA3 and there is also a SATA1 connection, my BIOS doesn't search in that drive for a boot program, it just stops searching after not finding one in the SATA1 drive. It's not hard to boot - I just go into the boot manager and manually select the other drive, but I'd prefer to have a completely automatic bootup like most computers do.

Any suggestions for how to fix this? 3 possibilities I can think of are
-switching the cables so sda is in SATA1 and sdb is in SATA3
-moving or copying grub over to sdb where it can be accessed automatically
-changing bios settings to make it check either both hard drives or just SATA3 for a boot program

The problem I have with the first one is that Linux may not be sufficiently adaptable to hardware changes (I've yet to see an OS that is). Mounting /home as / and / as /home is likely not a good idea, and I'm concerned that is what would happen if I switched SATA ports like that. As for bios settings, I don't see any options like that, though I could be missing something. And as for moving grub, like I said, I'm a newbie, and thus need help with such things (though this is the option I favour). Any suggestions?

racepres 01-17-2010 12:54 PM

If you are able to "fix it" and therefor Boot, Just go to "boot/grub" and edit the menu.lst to reflect the change you are making to get booted. Save changes, and ... no more troubles!!
HTH
RP
I am Assuming [love that word] that you are using Grub... but maybe you have to edit LILO!!

Rashkavar 01-17-2010 02:38 PM

That only works if it actually initializes Grub automatically in the first place. It doesn't - the problem isn't within Grub.

The problem is that the Grub MBR itself is on the wrong hard drive - my bios assumes that the MBR will be connected to SATA1 unless I go into the boot menu and specify another drive. There doesn't seem to be a method of changing that in the bios settings, and swapping the physical connections on the board might cause interesting problems with drive mapping. What I'm asking is how I can transfer (move or copy) the entire Grub MBR from the SATA3 hard drive to the SATA1 hard drive, not simply edit Grub itself.

sysfce2 01-17-2010 06:32 PM

You could try Super Grub Disk.

It's been a while since I've done this, but IIRC,

run find /boot/grub/stage1 (or where you have the grub files)

then run root (hd0,0) (use the result from find)

finally setup (hd0) assuming hd0 is the first boot drive (it should be)


All times are GMT -5. The time now is 12:49 AM.