Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub Error 17
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 1:54 pm    Post subject: Grub Error 17 Reply with quote

I'm having issues with grub. Let me provide some details about my situation. I had a dual boot set up with xp & gentoo. Recently I built a new system and I went ahead and added a third drive with windows 7 on it. After putting the new box together and booting, I've had issues getting grub to boot. My current set up is as follows

/dev/hda ---xp
/dev/sda---windows 7
/dev/sdb---gentoo.

here is my grub.conf file:

title=Gentoo-Server-2.6.26
root (hd2,0) since gentoo is on drive sdb
kernel /boot/kernel-2.6.26-gentoo-r3 root=/dev/sdb3

title= windows xp
rootnoverify (hd0,0)
makeactive
chainloader (hd0,0)+1

title = windows 7
rootnoverify (hd1,0)
makeactive
chainloader(hd1,1)+1


after getting grub error 17, i went ahead and chrooted into the my system and tried to re-install grub by following these instructions:

grep -v rootfs /proc/mounts > /etc/mtab
grub-install --no-floppy /dev/sda (i assumed that sda it's actually hda)....however, i get the following error:

/dev/sdb1 (gentoo's /boot partition) does not have any corresponding BIOS drive. In my BIOS, the HDD boot order is as follows:
/dev/hda
/dev/sda
/dev/sdb

any advise is greatly appreciated? Oh yeah I also tried grub-install --no-floppy /dev/hda and get the same error.
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Sun Oct 25, 2009 1:59 pm    Post subject: Reply with quote

What does fdisk -l return?
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 2:10 pm    Post subject: Reply with quote

Hi Mike,

Thanks for replying. I'm using the gentoo minimal install cd so I can copy & paste everything, but here is the output of fdisk -l

/dev/hda ----where xp is
/dev/sda----windows 7
/dev/sdb----gentoo

for sdb

sdb1 - boot
sdb2--swap
sdb3---/root
sdb4---extended
sdb5---/home
sdb6---virtualbox

let me know if you need anything else
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 2:11 pm    Post subject: Reply with quote

Hello,

Personnaly I use grub instead of grub-install

launch grub

type :
root (hd2,0) #define hard drive sdb, partition 0 your /boot partition
setup (hd0) # install boot loader on hda

If all ok, type quit and reboot
sample ---------------
----------------------
grub> root (hd0,0)
Filesystem type unknown, partition type 0x7 # I type a wrong disk/partition

grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0x83 # ok

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 18 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+18 p (hd1,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

grub> quit

-----------------

Without a correct message when you type 'setup (hd0), your grub are not installed


sample of my grub.conf

Quote:
default 0
timeout 30
splashimage=(hd1,0)/boot/grub/splash.xpm.gz

title BB-64
root (hd1,0)
kernel /boot/vmlinuz root=/dev/sdb1 quiet vga=791 splash=silent,theme:gentoo-blue console=tty1
initrd /boot/initrd

title DD-32 KDE3
root (hd1,1)
kernel /boot/vmlinuz quiet vga=791 root=/dev/sdb2 splash=silent,theme:gentoo-blue console=tty1
initrd /boot/initrd

title DD-64 KDE4
root (hd1,2)
kernel /boot/vmlinuz quiet root=/dev/sdb3 vga=791 splash=silent,theme:gentoo-blue console=tty1
initrd /boot/initrd

title Windows Vista
root (hd0,0)
savedefault
chainloader +1


Edit : I prefer grub console, I have full message and be able to perform another action if necessary
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 2:17 pm    Post subject: Reply with quote

But more attention

Before you put Windows 7 disk, under gentoo you see 'hda and sda' disk or 'sda and sdb' ?

If you look 'hda and sda' -> gentoo disk became sdb
if you look 'sda and sdb' -> gentoo disk became sdd

Do not miss to change this under grub.conf and fstab !!!
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Sun Oct 25, 2009 2:24 pm    Post subject: Reply with quote

Yes, because in grub sda and hda are the same thing.
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 2:35 pm    Post subject: Reply with quote

USTruck,

Went ahead and fired up the grub shell and this is what I get;

root (hd0,0)
filesystem type unknown, partition type 0x7

root (hd1,0)
filesystem type unknown, partition type 0x7

root(hd2,0)
filesystem type is ext2fs, partition type ox83
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 2:51 pm    Post subject: Reply with quote

Normal

Grub base numbering of disk on BIOS settings
Your BIOS present a disk of this order
HDA - Windows XP - grub disk = 0
SDA - Windows 7 - grub disk = 1
SDB - Gentoo - grub disk = 2

Your boot partition of gentoo reside on first partition (sdb1) but for grub this is a partition 0

You have an grub error 17 because a boot loader search a file to (hd1,0) but now this is a Windows 7 disk

Under grub , use root (hd2,0) and setup (hd0)

BUT BEFORE : please what about your linux kernel config
Before you put Windows 7 disk, what you see under linux 'hda and sda' or 'sda and sdb'
Your gentoo disk became SDB or SDD depending of kernel config.
Do not miss to change fstab to (sdb to sdd or sda to sdb) .......

To be sure, remove connector of Windows 7 disk, put them to Gentoo disk and reboot
Verify by "fdisk -l' (you see hda/sda or sda/sdb)
hda-sda -> sda became sdb
sda/sdb -> sdb became sdd

Change your fstab and grub.conf . Halt system
replace connector on Windows 7 and Gentoo disk (same of previous)
reboot with livecd and re-install grub bootloader
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 3:05 pm    Post subject: Reply with quote

thanks for the suggestion.

"Under grub , use root (hd2,0) and setup (hd0) " do you mean that I should fire up the grub shell do the following:

root (hd2,0)
setup (hd0)

wait until i get a message that grub installed correctly?

You are correct, gentoo went from sda to sdb. I have made edits to my fstab to reflect the new changes. Please let me know if I'm on the right track?
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 3:13 pm    Post subject: Reply with quote

snakeo2 wrote:
thanks for the suggestion.

"Under grub , use root (hd2,0) and setup (hd0) " do you mean that I should fire up the grub shell do the following:

root (hd2,0)
setup (hd0)

wait until i get a message that grub installed correctly?

You are correct, gentoo went from sda to sdb. I have made edits to my fstab to reflect the new changes. Please let me know if I'm on the right track?


Yes about two
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 4:01 pm    Post subject: Reply with quote

USTruck,

I went ahead and installed grub on (hd0) without any error messages. I rebooted and after waiting for a while, i get an error that i cant mount a partition. I'm not getting the typical purple grub menu with the different options. It does give you the option to press any key to continue which i did. When you do this, it takes you to the grub menu, but it's black & white and fuzzy. I tried booting into xp and it worked. Then, because over time I've compiled a few kernels, some of them which dont work, I selected the one that was working and it booted into gentoo. Of course since my new system now has an ATI card and the old one had an Nvidia, xorg failed. I'm in the process of fixing that problem. However, I didnt not see windows 7 as one the options in the menu? any ideas as to why? also, how can fix the grub menu being fuzzy and in black & white? Thansk for all your help.
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 4:14 pm    Post subject: Reply with quote

About color and image : verify splashimage= for you it's (hd2,0)

About windows 7 : replace chainloader(hd1,1) by chainloader(hd1,0)

Whate about fdisk -l /dev/sda
Two solution for me : you have one partition / two partition
One partition -> (hd1,0)
Two partition -> windows 7 create one small partititon for 'restore system' utilities, he use this partition to boot (hd1,0)
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 4:26 pm    Post subject: Reply with quote

I went ahead and made changes to splashimage. Windows 7 indeed created two partitions. Here is the section for windows 7 in my grub.conf

I'm not sure if you know the answer to this question, but would you happen to know which drivers i need to emerge for ati R4650 video card?
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 4:29 pm    Post subject: Reply with quote

editing the flashimage did the trick. Im still not seeing windows 7 as a boot option on the grub menu. here is the section i created for windows 7 on my grub.conf file:

Title= Windows 7
rootnoverify (hd1,0)
makeactive
chainloader (hd1,0)+1
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 4:56 pm    Post subject: Reply with quote

About your ATI card, search on forums (ATI ; fglx) you fin lot of topics about ATI Card

About Windows 7 ...

First , for title a '=' are not require by grub (look at my grub.conf)

I suppose that = preceded or followed by a space miss a grub to display it correctly

Second : change 'Title' to 'title'
All option/command of grub are in lower case
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 5:06 pm    Post subject: Reply with quote

will make changes you suggested and try again. Im looking into ati drivers but my eth0 is not being detected during boot which is weird because when i used the livecd it did. i ran "ifconfig eth0" and get this:

eth0: error fetching interface information: device not found.

i also tried "dhcpcd eth0" and get the following:

eth0: dhcpcd 4.0.13 starting
eth0: read_interface: no such device. I'm guessing i need to find what module it uses when booting off the livecd and load it?
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 5:10 pm    Post subject: Reply with quote

your suggestion about the changes to grub.conf regarding windows 7 worked. windows 7 is now an option in grub menu. However, when i select windows 7, screens goes blank and it returns to grub menu. Do you think I may need to change the partition setup in grub.conf

from

(hd1,0)

to (hd1,1)
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 5:11 pm    Post subject: Reply with quote

Under lived sessions type

lspci

note all PCI device (sound card, network, graphics, ......)
When you modify your kernel it's easy for you to find a modules (use help under make menuconfig)
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 5:17 pm    Post subject: Reply with quote

I was expecting a few things to break during this migration....so I guess I have more work to do. Apparently my symlink is broken. Whenever I cd to /usr/src/linux, and try to run menuconfig i get:

make:*** no rule to make target 'menuconfig' stop. However if i run ls -l /usr/src/linux

it points to linux-2.6.26.gentoo-r3

how can i fix the symlink so that I'm able to run make menuconfig?
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 5:20 pm    Post subject: Reply with quote

snakeo2 wrote:
your suggestion about the changes to grub.conf regarding windows 7 worked. windows 7 is now an option in grub menu. However, when i select windows 7, screens goes blank and it returns to grub menu. Do you think I may need to change the partition setup in grub.conf

from

(hd1,0)

to (hd1,1)



Try it no promise,

Remember Windows NEEDS to be on drive C: to boot but you have another Windows install !!
Three Solution :
1)
under bios reverse disk order (sda/hda/sdb) install grub bootloader on disk 0 (remember it's installed on hda)
use Windows XP menu to launch windows 7

2) Launch Windows XP and re-install Windows 7 on sda disk, after that you have one windows boot menu : windows xp , windows 7

3) Search on forum or google to find application to 'cache' a disk hda when you choose sda and sda when you choose hda (lilo ?)
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 5:27 pm    Post subject: Reply with quote

snakeo2 wrote:
I was expecting a few things to break during this migration....so I guess I have more work to do. Apparently my symlink is broken. Whenever I cd to /usr/src/linux, and try to run menuconfig i get:

make:*** no rule to make target 'menuconfig' stop. However if i run ls -l /usr/src/linux

it points to linux-2.6.26.gentoo-r3

how can i fix the symlink so that I'm able to run make menuconfig?


This symlink are on livecd ?????????

under grub menu
select your gentoo
logon as root

eselect kernel list , note desired kernel
eselect kernel set xx (xx = number of desired kernel)

cd /usr/src/linux
make menuconfig
after modification and saving config

make all && make modules_install

verify that /dev/sdb1 are mounted to /boot

make install # install kernel to /boot and kernel driver to appropriate place

reboot
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 5:50 pm    Post subject: Reply with quote

"eselect kernel list , note desired kernel
eselect kernel set xx (xx = number of desired kernel) "

I did that already which is odd as to why I cant run make menuconfig.

"under bios reverse disk order (sda/hda/sdb) install grub bootloader on disk 0 (remember it's installed on hda)
use Windows XP menu to launch windows 7 "

Out of the options you proposed I think I'll try this one as it appears to be the less difficult. Just to confirm, after switching the bios disk boot order, I need to install grub on disk 0 which will now be sda correct?
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 5:55 pm    Post subject: Reply with quote

snakeo2 wrote:

"under bios reverse disk order (sda/hda/sdb) install grub bootloader on disk 0 (remember it's installed on hda)

use Windows XP menu to launch windows 7 "

Just to confirm, after switching the bios disk boot order, I need to install grub on disk 0 which will now be sda correct?


Yes it's correct

After that, remember that you need to change bios disk order to boot specific windows

Use only one entry under grub.conf for windows (always disk 0)
Back to top
View user's profile Send private message
snakeo2
Veteran
Veteran


Joined: 01 Jan 2006
Posts: 1237

PostPosted: Sun Oct 25, 2009 6:05 pm    Post subject: Reply with quote

"After that, remember that you need to change bios disk order to boot specific windows"....not sure I follow what you mean by this statement. I thought that by changing the bios disk boot order to

sda
hda
sdb

and installing grub on /dev/sda, it would allow me to boot into any of the three OS? I will go ahead and create one entry in grub.conf. Also, I found this on google and maybe it can work for my situation. Below is the link:

http://www.tomshardware.com/forum/236459-50-triple-boot-gentoo-vista-solved
_________________
Gigabyte MA790X-UD4P Motherboard
AMD Phenom II X4 940 Black Edition
MSI ATI R4650 PCIe2
250GB SATA Drive
4GB Corsair DDR2
Back to top
View user's profile Send private message
USTruck
Guru
Guru


Joined: 21 Aug 2005
Posts: 374
Location: La Louviere (Belgique)

PostPosted: Sun Oct 25, 2009 6:11 pm    Post subject: Reply with quote

Yeah ...; Another great solution ........ I LEARN THANKS

reverse your bios order disk has original (hda/sda/sdb)

reboot under gentoo and change grub conf
About windows 7

map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0) (try with 1 if necessary)
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies.    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum