GRUB help
C M Reinehr
cmr
Thu Feb 8 10:05:04 PST 2007
On Thursday 08 February 2007 10:45, Rick Bowers wrote:
> At 2/7/2007 06:40 PM, you wrote:
> >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.
>
> Yes, that is correct
>
> > >> 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)
>
> I still don't understand how to set this up. I have three boot-able
> partitions; /dev/sda1, /dev/sda2 and /dev/hdb3
>
> /dev/hdb is my USB drive. When the USB drive is not connected, I get
> an error in GRUB and the system won't bootl
>
> I get this:
>
> ----------
> GRUB Loading stage1.5.
>
> GRUB Loading, please wait...
>
> Error21
>
> ----------
>
> Is there a way to setup GRUB so it will boot WITHOUT the USB drive
> attached?
Yes!
1) Boot into Linux using your USB drive.
2) Login as root.
3) Type `grub-install /dev/sdb`
Please read: 3.3 Installing GRUB using grub-install
http://www.gnu.org/software/grub/manual/grub.html#Installing-GRUB-using-grub_002dinstall
for detailed instructions & examples.
Please read: the GNU GRUB Manual
http://www.gnu.org/software/grub/manual/grub.html
for general instructions.
cmr
> > >> 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
> >_______________________________________________
> >Linux-users mailing list ( Linux-users at linux-sxs.org )
> >Unsub/Password/Etc:
> >http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
> >
> >Need to chat further on this subject? Check out #linux-users on
> >irc.linux-sxs.org !
--
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC
More information about the Linux-users
mailing list