Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] noob grub question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
willsmithbelair
n00b
n00b


Joined: 13 Oct 2011
Posts: 6
Location: Tulsa, OK

PostPosted: Thu Oct 13, 2011 9:02 am    Post subject: [solved] noob grub question Reply with quote

My installation has gone fine until this point.
I'm following the amd64 handbook for installation and getting error 22 no partition exists for grub.

my partitions are on sdb3 for /boot and sdb4 for /
with windows 7 using sdb1 and sdb2

here's my grub.conf
Code:

title gentoo
root (hd1,2)
kernel /boot/kernel-2.6.39-r3 root=/dev/sdb4

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


(the windows 7 one just plain doesn't do anything) :?

Also, wondering how to go about getting back into my system through the live cd. I'm guessing I have to re-mount and re-chroot? I had to use windows disc and bootrec /fixmbr just to post this kind of annoying not too sure what I'm doing with grub maybe I should try manually configuring it this time rather than grub-install?

Thanks.


Last edited by willsmithbelair on Sun Oct 16, 2011 2:14 am; edited 3 times in total
Back to top
View user's profile Send private message
DawgG
l33t
l33t


Joined: 17 Sep 2003
Posts: 866

PostPosted: Thu Oct 13, 2011 9:58 am    Post subject: Reply with quote

where did you install grub? if it's not installed to the mbr of the disk the bios boots from with these comands inside the grub-shell (grub 0.97):
Code:
root (hd1,2)
setup (hd0)

it is installed somewhere else (mbr of sdb?) and needs to be loaded with some other software before an actual os (eg the braindead windoze bootloader) and a correspondig entry in its boot.ini-file.
i think both methods are quite safe nowadays - either install grub to the mbr with the above command and your existing config (i prefer this)
or:

load grub with the windoze-bootloader like this:
(run these commands as root from your linux-installation:)
install grub to the mbr of sdb: start the grub-shell (grub) and inside it type the followiong commands:
Code:
root (hd1,2)
setup (hd1)
exit
everything should run w/out errors
make a copy of the second hard disk's mbr like this:
Code:
dd if=/dev/sdb of=mbr-sdb.bs bs=512 count=1

the file mbr-sdb.bs contains the executable grub-code.
copy this file to your windoze-C or save it somewhere yopu can copy it to windoze-C from later.
boot windoze and add an entry to its boot.ini-file
Code:
c:\mbr-sdb.bs="Linux"

i've done this a lot of times with older windoze-versions, but it should work with the later ones, too.
(you find a lot of stuff about this on the web)
GOOD LUCK!
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
b0nafide
Apprentice
Apprentice


Joined: 17 Feb 2008
Posts: 171
Location: ~/

PostPosted: Thu Oct 13, 2011 4:02 pm    Post subject: Re: noob grub question Reply with quote

willsmithbelair wrote:
with windows 7 using sdb1 and sdb2 ... (the windows 7 one just plain doesn't do anything) ...


If you got the system from a major manufacturer, there's a pretty good chance that sdb1 is the system recovery partition. the windows partition you're used to booting into is often the second partition. Just throwing that out there.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21605

PostPosted: Fri Oct 14, 2011 1:41 am    Post subject: Reply with quote

While at the GRUB prompt from a failed boot, please run these two commands, then provide their output to us.
Code:
find /boot/kernel-2.6.39-r3
find /kernel-2.6.39-r3
Back to top
View user's profile Send private message
willsmithbelair
n00b
n00b


Joined: 13 Oct 2011
Posts: 6
Location: Tulsa, OK

PostPosted: Fri Oct 14, 2011 2:14 am    Post subject: Reply with quote

Thanks guys I'm just about to load the livecd up again and give it another go.

Do I just need to redo the "#mount" sequence and then redo the chroot cmds? is that sufficient enough? I'm going to --unmerge grub and redo the whole thing.

could it possibly be that I have an old IDE drive that's also plugged in? I noticed the gentoo wiki said that could mess up the map.



Hu wrote:
While at the GRUB prompt from a failed boot, please run these two commands, then provide their output to us.
Code:
find /boot/kernel-2.6.39-r3
find /kernel-2.6.39-r3


I will include this in my next post thanks.
Back to top
View user's profile Send private message
willsmithbelair
n00b
n00b


Joined: 13 Oct 2011
Posts: 6
Location: Tulsa, OK

PostPosted: Fri Oct 14, 2011 3:41 am    Post subject: Reply with quote

OK. I believe I've got it sorted out. It's very strange the way grub maps things (I'm using legacy I believe)
I'll try to explain here what I did in case someone stumbles upon this in the future.

First I used Hu's suggestion and inside grub asked it to find my kernel
to my surprise it said (hd0,2) rather than (hd1,2) which should be sdb4

So I went into grub
Code:
grub> root (hd1,2) # my boot is in sdb3
grub> setup (hd1) # adding to mbr of sdb


So, I find it odd that in order to put grub into the mbr of my hard drive (sdb) I have to tell it (hd1)
but, when telling it what to boot in grub.config I have to tell it (hd0,2) which according to grub is the location of my gentoo kernel

grub.conf:
Code:
default 0
timeout 30

title Gentoo Linux
root (hd0,2)
kernel /boot/linux-2.6.39-gentoo-r3 real_root=/dev/sdb4

title Windows 7
rootnoverify (hd0,0)
makeactive
chainloader +1


So this works, I just used grub to boot into windows, but I'm getting a kernel panic when trying gentoo. looks like it has something to do with where I'm specifying "real_root"
link to pic -->http://gyazo.com/89ebe31ab18fd9ccc7b5ef6ea6e53a6c

Thanks again for the help.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Oct 14, 2011 5:10 am    Post subject: Reply with quote

if you used genkernel:

Code:

kernel /boot/linux-2.6.39-gentoo-r3 root=/dev/ram0 real_root=/dev/sdb4


if you configured/installed your kernel manually

Code:

kernel /boot/linux-2.6.39-gentoo-r3 root=/dev/sdb4

_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
willsmithbelair
n00b
n00b


Joined: 13 Oct 2011
Posts: 6
Location: Tulsa, OK

PostPosted: Fri Oct 14, 2011 6:49 am    Post subject: Reply with quote

Thanks cach0rr0

and thanks everyone else.
Back to top
View user's profile Send private message
willsmithbelair
n00b
n00b


Joined: 13 Oct 2011
Posts: 6
Location: Tulsa, OK

PostPosted: Fri Oct 14, 2011 9:02 pm    Post subject: Reply with quote

Update. still getting kernel panic.
after reading around here I'm pretty sure it's related to a hd driver, but none of the solutions have worked.
I'm going to just try genkernel later tonight and see if it can sort it out.

but, until then here's roughly the error I'm getting
Code:

NFS cannot open root device "sdb4"
unable to mount root fs on unknown block (2,0)

# then it attempts to list the partitions, but lists nothing


grub shell lists the partitions correctly, grub .conf is correct
Code:

title Gentoo Linux
root (0,2)
kernel /boot/linux-2.6.39-gentoo-r3 root=/dev/sdb4


when I list my loaded hardware it shoes ATI SATA driver [IDE mode] and ATI pata driver
and looking through posts here it said to use the generic Intel pata/sata combo drivers for ATI
but that didn't change anything.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Fri Oct 14, 2011 10:38 pm    Post subject: Reply with quote

can you pastebin your latest kernel .config (emerge wgetpaste if need be, and 'wgetpaste /usr/src/linux/.config'), and post your lspci -n output?

ALSO: do you have an option in the bios to enable ahci mode for your SATA drive, instead of IDE mode? Note that if Windows barfs on this you can always change it back, but that legacy IDE mode shouldn't be necessary
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sat Oct 15, 2011 12:37 am    Post subject: Reply with quote

willsmithbelair wrote:

So, I find it odd that in order to put grub into the mbr of my hard drive (sdb) I have to tell it (hd1)
but, when telling it what to boot in grub.config I have to tell it (hd0,2) which according to grub is the location of my gentoo kernel


Because it's just a common mistake many does :
hd0 is first disk and hd1 the 2nd disk, and the disk order depend on the boot order, so if you use a livecd, your first booting device will be the cdrom. Ohoh now what will be the first disk and the 2nd disk ? It then depend on the controller driver boot order. Say you have a PATA and SATA disk (to ease the example)
if you ask your bios to boot SATA disk first : sata disk will be hd0 and pata disk will be hd1
but if you ask to boot from a livecd :
if livecd load SATA driver first : sata disk will be hd0, pata disk will be hd1
if livecd load PATA driver fisrt: pata disk will be hd0, sata disk will be hd1

That's why in livecd you could ask grub to install itself in hd1, because it's your sata drive, but still in grub.conf you will ask grub to boot from hd0 because this time when your bios boot, it will boot your sata disk first and so sata will be hd0

Does this make it clearer ?
Back to top
View user's profile Send private message
willsmithbelair
n00b
n00b


Joined: 13 Oct 2011
Posts: 6
Location: Tulsa, OK

PostPosted: Sun Oct 16, 2011 2:13 am    Post subject: Reply with quote

krinn wrote:
willsmithbelair wrote:

So, I find it odd that in order to put grub into the mbr of my hard drive (sdb) I have to tell it (hd1)
but, when telling it what to boot in grub.config I have to tell it (hd0,2) which according to grub is the location of my gentoo kernel


...

Does this make it clearer ?


Yeah, that's the conclusion I came to as well.

I installed arch linux on the first go around in about 15 minutes, so it's clearly my kernel configuration that's the problem. Just in theory I prefer the portage design better than pacman so I'm going to pick up a new hard drive and run genkernel this time until I'm a little more comfortable with configuring my own kernel. I'm missing a driver somewhere.

I'll just mark this as solved, since technically my grub issue is solved. thanks guys.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
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