Re: GRUB Problem: Can't Boot off my USB Disk
- From: Allen Kistler <ackistler@xxxxxxxxx>
- Date: Thu, 10 Aug 2006 04:09:10 GMT
Noelle wrote:
Hello:
My PC BIOS supports booting from USB devices, so I decided to load FC5
on one of my USB attached disks (300GB Seagate).
I successfully did so, but I can't get GRUB to work right (i.e. to
complete the boot). I may be experiencing a syntax or GRUB
usage problem
Problem description:
/dev/sda (internal SATA Drive - Windows XP)
/dev/sdb (internal SATA Drive - for Backups)
/dev/sdc (external USB Drive - Fedora Core 5)
/dev/sdc1 (hd2,0) = /boot
/dev/sdc2 (hd2,1) = /
/dev/sdc3 (hd2,2) = swap
During the install, I specified that "stage1" of GRUB
was to be put on the first sector of /dev/sdc1 (and it was).
Do you mean you ran "find /grub/stage1" from the grub prompt or that you
specified "setup (hd2,0)" at the grub prompt? Or did you really mean to
put grub in the mbr of sdc? The questions are mostly rhetorical, since
the last is what you should do.
As Unruh said in another post, a lot will depend on how your BIOS treats
the USB drive before the kernel loads. Like does it really see the USB
drive as the third drive (hd2)? I have little experience there, but I
can tell you how grub works and what it expects to see.
But when I boot the PC using the USB device, all I get is:
GRUB
(Literally, that's all I see). This tells me that the PC finds "stage1"
on the disk, but "stage1" cannot find "stage2" (I think that's what
happening). So I booted to rescue mode off a CD-ROM and used
grub(8) and grub-install(8) in various ways to modify the "stage1"
grub image.
For example:
root# mount -t ext3 -o rw /dev/sdc1 /boot
root# grub-install --root-directory=/boot /dev/sdc1
root# umount /boot
root# grub
install (hd2,0)/boot/grub/stage1 d (hd2) \
(hd2,0)/boot/grub/stage2 p (hd2,0)/boot/grub/menu.lst
You want to make sure the grub you're installing in the mbr is the same
version that exists in /boot/grub, so (generally) you don't want to run
grub from the CD, but from the / mount itself. So I'd suggest something
like...
When booting into rescue mode, let it try to find the installed FC5. It
should mount it at /mnt/sysimage, /mnt/sysimage/boot, and (also
important) /mnt/sysimage/dev. YMMV with the USB device, though.
# chroot /mnt/sysimage
# grub
grub> find /grub/stage1 [should return (hd2,0); feel comfort if it does]
grub> root (hd2,0) [where to find the rest of grub while booting]
grub> setup (hd2) [put grub in the mbr]
grub> quit
Because you have a /boot partition, all the references in grub.conf
should NOT contain /boot in the path. Something like
splashimage=(hd2,0)/grub/splash.xpm.gz
title Fedora Core (2.6.17-1.2157_FC5)
root (hd2,0)
kernel /vmlinuz-2.6.17-1.2157_FC5 ro root=LABEL=/
initrd /initrd-2.6.17-1.2157_FC5.img
The root command in the conf file tells grub where to look for the
kernel and initrd files. They should also be in the /boot partition.
The kernel and initrd text should match the kernel version you've
actually got installed, of course.
I also tried the above 'install' grub sub-command by omitting
the '/boot' part in various parts of it.
HELP -- I did my homework and tried what I found all over. But no
success here. And its probably something simple.
Basically here is what I have and need (a review):
- I have FC5 installed on the device slices shown above (/dev/sdc).
- I can select to boot off that device when I turn on my PC (by
pressing F8).
- I have a Knoppix and FC5 rescue CD's that I can boot off to work on
my GRUB issues. Now...
Tell me what GRUB commands to run (or re-run correctly)
the get the system to complete the boot to that USB disk.
(Note: I don't want nor need to mess with the MBR on /dev/sd*a*, which
holds Windows XP, because my PC can boot USB devices; in this
case it is /dev/sdc).
BTW... the 'menu.lst' has an entry for Windows XP
and one for the FC5 (default is FC5).
You can toast the entry for XP from grub.conf (aka menu.lst), although
it doesn't hurt anything to keep it around. Let your sense of esthetics
guide you.
I suspect there could be difficulty with the BIOS probably seeing your
chosen boot device as the first drive, so grub probably ends up looking
for the rest of itself on your second internal drive, which your BIOS
treats as the third drive only if you try to boot from USB. Like I
said, I'm not familiar with booting from USB, so I'm guessing there.
There is another way if my above suggestion doesn't work....
You said you don't want to mess with the sda mbr, but you can chain to
grub from the XP boot loader, again assuming the BIOS would see the USB
drive as (hd2) when you boot to XP but before XP loads.
After grub is installed on your sdc, copy the first sector of sdc to
some medium XP can read, e.g., a mounted floppy.
dd if=/dev/sdc of=/mnt/floppy/bootsect.lnx bs=512 count=1
Boot XP.
Put the file bootsect.lnx (nothing special about the name BTW) in the
root of the C: drive.
Edit boot.ini to contain a line like
C:\BOOTSECT.LNX="Fedora Core 5"
Reboot.
Choose the line "Fedora Core 5" from the XP boot menu. Grub should run,
letting you start your Linux installation from the (hopefully now
undisputed) third drive.
The last hurdle could be that when init in the initrd tries to
switchroot into the USB drive, it panics because there's a module
missing from initrd. There's probably a tweak you can do to the initrd
in that case, but I'd say to worry about it only if there is a panic
(and you get that far).
My last word is to make sure /etc/fstab is sensible. anaconda usually
does a pretty good job, and since you probably haven't messed with it,
it's probably OK. Take a peek anyway to satisfy the sense of paranoia
you should have by now.
HTH
.
- Follow-Ups:
- Re: GRUB Problem: Can't Boot off my USB Disk
- From: Noelle
- Re: GRUB Problem: Can't Boot off my USB Disk
- References:
- GRUB Problem: Can't Boot off my USB Disk
- From: Noelle
- GRUB Problem: Can't Boot off my USB Disk
- Prev by Date: Re: Linux is getting easier to install?
- Next by Date: A newbie try to install a PCMCIA wireless card
- Previous by thread: Re: GRUB Problem: Can't Boot off my USB Disk
- Next by thread: Re: GRUB Problem: Can't Boot off my USB Disk
- Index(es):
Relevant Pages
|