Experiencing the Grub Error 17

Mike Wright mike.wright at mailinator.com
Mon Oct 22 17:51:00 UTC 2007


Paul Smith wrote:
> On 10/22/07, Michael Schwendt <mschwendt at gmail.com> wrote:
> 
>>>>Yes, Mikkel, the disk from which I want to boot has the highest
>>>>priority in BIOS..
>>>>
>>>>
>>>
>>>OK - this gets a bit tricky, because when you boot from this drive,
>>>it is no longer hd2 - it is hd0. So Grub will be looking for its
>>>files in the wrong place. What I would do is edit your Grub
>>>configuration file to reflect this.
>>
>>    map (hd0) (hd2)
>>    map (hd2) (hd0)
>>
>> in the grub.conf boot entry would achieve that. However, before that
>>I would really suggest giving the "find /grub/grub.conf" command a
>>try, to see on which mountable partition it finds the file.
> 
> 
> We are getting close to it! Mikkel is right. Inside the grub prompt, I
> run, as suggested, the command 'find /grub/grub.conf' and I get
> (h0,1). Then I run
> 
> configfile /grub/grub.conf
> 
> and I get the correct dialog panel to choose the kernel to boot, and
> it goes though until a kernel panic emerges. My grub.conf file is now:
> 
> # more /mnt/sdc2/grub/grub.conf
> default=0
> timeout=5
> splashimage=(hd0,1)/grub/splash.xpm.gz
> hiddenmenu
> title Fedora (2.6.22.9-91.fc7)
>         root (hd2,1)
>         kernel /vmlinuz-2.6.22.9-91.fc7 ro root=/dev/sdc2 rhgb
>         initrd /initrd-2.6.22.9-91.fc7.img
> title Fedora (2.6.22.7-85.fc7)
>         root (hd2,1)
>         kernel /vmlinuz-2.6.22.7-85.fc7 ro root=/dev/sdc2 rhgb
>         initrd /initrd-2.6.22.7-85.fc7.img
> 
> where should I insert
> 
> map (hd0) (hd2)
> map (hd2) (hd0)
> 
> and what should I do to avoid the kernel panic? I suspect that
> something is wrong with 'root=/dev/sdc2'.

You are close.  The problem may be in understanding just what root () 
is.  Unless you have multiple boot partitions or are doing something 
really tricky there isn't a need for multiple root commands.

root specifies the drive and partition where /boot resides.  /boot 
contains your kernels, ramdisks, and the various loaders (in /boot/grub) 
  and your boot menu, (in /boot/grub/menu.lst).

the kernel command line also uses "root".  They are different.  kernel 
root refers to the root of your o/s' filesystem.  It tells the kernel 
where / starts.

Therefore you must find and load your kernel first.  To eliminate 
inconsistencies you may want to have only one grub root command outside 
of the individual stanzas.  That way it becomes the single point of 
reference for grub.

default=0
timeout=5

# all grub commands are relative to /boot, so...
# on which drive/partition is /boot located?
root (hd0,1)
# ok, it's on hard drive 0's second partition

splashimage=/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.22.9-91.fc7)
         kernel /vmlinuz-2.6.22.9-91.fc7 ro root=/dev/sdc2 rhgb
         initrd /initrd-2.6.22.9-91.fc7.img

The grub docs are actually pretty good.  "info grub" is your friend 
here.  Previous advice to become familiar with cli grub is also good.

hth,
Mike Wright :m)




More information about the users mailing list