GRUB help
Alma J Wetzker
almaw
Wed Feb 7 15:40:07 PST 2007
Rick Bowers wrote:
> At 2/6/2007 07:29 AM, you wrote:
>> What hard drive and partition do / and /boot live on? (/dev/sda1?)
>
> / /dev/sdb3
> /boot /dev/sdb3
I think the second line is superfluous, boot just needs to be a
directory off root.
>
>> Basically, you'll boot however you can (USB or live-CD) and reinstall the
>> bootloader on the hard drive.
>
> I'm not sure how to do this. I read the document at the link you
> supplied (below) but it isn't completely clear.
> When I connect the USB drive, I get the GRUB boot menu. It looks like this:
>
> Startup Options
>
> openSUSE 10.2 /*
> this is on /dev/hdb3 */
> openSUSE 10.2 (/dev/sda) /*
> An earlier attempt at loading openSuSE on /dev/sda2*/
> Windows /* My
> "production" setup on /dev/sda1 */
> openSUSE 10.2 (Failsafe) /*
> Not sure who loaded this */
>
> I need to be able to boot windows (/dev/sda1) when the USB drive
> (/dev/sdb) is unplugged. Perhaps this is not possible?
>
>
>> Grub has a special way of looking at hard drives. (look
>> in /boot/grub/device.map for the actual specific mappings)
>> /dev/sda1 == (hd0,0) (assuming no hda's exist)
>> /dev/sda2 == (hd0,1)
>> .....
>> /dev/sdb1 == (hd1,0)
>> /dev/sdb2 == (hd1,1)
>> .....
>> /dev/sda == (hd0)
>> /dev/sdb == (hd1)
>>
>> do you see the pattern?
>
> Um, no?
The grub system uses a zero based numbering system.
hd0 == /dev/hda (or /dev/sda if hda is not present)
The partition table starts with zero instead of one, so subtract one
from the partition number that the partitioning software reports. The
number after the comma is the partition number. that means:
(hd0,0) is /dev/hda1
(hd1,1) would be /dev/hdb2
Yes it would be easier if grub started with one like the rest of the
hard drive partitioning world, but there you have it.
>> Assuming /boot lives on /dev/sda1:
>>
>> $ sudo grub
>>
>> grub> root (hd0,0)
>> grub> setup (hd0)
>>
>> This will set up your MBR on the first hard drive, and the grub will look for
>> the "second stage" of the loader on /dev/sda1.
>>
>> If you aren't sure where the grub files live, use
>> grub> find /boot/grub/stage1
>
> My output: (hd0,1) and (hd1,2)
> I also did a "find /boot/grub/stage2" and got (hd0,1) and (hd1,2)
>
>
>> The way grub works, if you know what's where, you can do a whole lot
>>from that
>> errored boot screen.
>>
>> For more info:
>> http://orgs.man.ac.uk/documentation/grub/grub_3.html
>>
>> On Monday 05 February 2007 22:12, Rick Bowers wrote:
>>> I just installed OpenSuSE on my USB drive from my laptop. It boots
>>> fine -- iff the USB drive is connected. But if I try to boot with the
>>> drive NOT connected, I get a GRUB error.
>>>
>>> The install never asked me where to put the boot record, so I"m
>>> guessing it got put in the MBR of the internal drive.
>>>
>>> How can I fix this so my laptop boots from the internal drive when
>>> the USB drive is not connected?
-- Alma
More information about the Linux-users
mailing list