View previous topic :: View next topic |
Author |
Message |
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Wed Jun 12, 2013 12:17 am Post subject: GRUB's th' RUB. |
|
|
11/Jun/2013 18:38
Hi,
Did another install of Gentoo, via the Gentoo 20121221 liveDVD... (I am a Gentoo novice (!)), but have been using Linux Debian (various "flavors") for about 4 years, & using Grub; so finally think I have problem solved my way through some issues I had previously erred on, in trying to install Gentoo successfully. I have now, some kind of install of Gentoo... on my 500 GiB SATA, second hard drive, with functioning Windows XP (sp3) (such as it may be...) on the first hd.
What follows just below, is some background, & below that, I will try to pose this GRUB PROBLEM (not booting anything) as (more or less) logical questions:
As it was very early in the morning (way past my bedtime), so I just TRIED 'grub-install,' as that seemed a short cut, but also to experience if, & how it may (or may not) work, & then tried to reboot... (as per handbook), though grub was loaded (w/o graphic, or GUI interface)... It gave me some error messages (which I failed to note down... too exhausted). So the next day, I went back, & tried to configure grub through the /boot/grub/grub.conf file...
I basically copied the handbook EXAMPLE version, & tried, best I could (con)figure & tailored as seemed relevant to my system, hardware, etc. (not good enough, as you will see). I did a '^x' double checking that it was indeed saved, & found this too did not work (wouldn't boot), the listing below, is a rough recreation (the commented sections, a generalization of the actual):
- - - - - - - - - - - - - - - - -
Code: | /boot/grub/grub.conf
# listing (boot 1st)
default 0
# seconds to boot
timeout 60
# splash
splashimage (hd1,1)/boot/grub/splash.xpm.gz
title Gentoo Linux 3.8.18
# partition Kernelimage (or OS) location
root (hd1,3)
kernel /boot/kernel-3.8.18-gentoo root-/dev/sdb3
title Gentoo Linux 3.8.18
root (hd1,3)
kernel /boot/3.8.18 real_root=/dev/sdb3
initrd /boot/initramfs-genkernel-x86-3.8.18-gentoo
|
| >[rescue data]
|
|
# windows
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
video=uvesafb:mtrr:3,ywrap,1024x768-32@60
- - - - - - - - - - - - - - - - -
|
So, being late again, went to bed, got up next day, went to copy my grub.conf file down, to post for problem solving, but INSTEAD FOUND (as the 'grub.conf' file... & this is an EXACT quote) :
Code: | - - - - - - - - - - - - - - - - - - -
# This is a sample grub.conf for use with Genkernel, per $
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?$
# If you are not using Genkernel and you need help creati$
# should consult the handbook. Alternatively, consult the$
# is included with the Grub documentation.
default 0
timeout 30
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz
#title Gentoo Linux 2.6.24-r5
#root (hd0,0)
#kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=$
#initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5
# vim:ft=conf:
- - - - - - - - - - - - - - -- - - -
|
So something has overwritten my file, & yes, I did save it (to repeat, I had double checked).
I think at least two questions arise:
1.) What over wrote the grub.conf file I wrote, & how do I get rid of it (& or change it)?
2.) # With my Gentoo install & MBR (& desired location for Grub on that MBR, & though not really functioning properly, is apparently correctly PLACED, where it now resides, on the second hd. My Windows XP MBR, now functions when I turn off '/dev/sdb' the second hard drive, (from my bios). The terminal command 'fdisk /dev/sdb -l' gives:
Code: | Disk /dev/sdb: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007a483
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 67583 32768 83 Linux
/dev/sdb2 67584 1116159 524288 82 Linux swap / Solaris
/dev/sdb3 1116160 976773167 487828504 83 Linux
|
So to get at this question: once the overwrite problem is solved, what should my 'grub.conf' file look like..? I get very baffled, as the seeming simplicity of the language around Grub, seems often quite ambiguous, & I think I do now understand, for Grub, in (say) '(hd1,1)', the 'hd1' is the second hd (counts from 0), & the '1' the first partition, but if I am not correct here... correction is due...
Thanks kindly for any help here.
Henry |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Wed Jun 12, 2013 3:50 am Post subject: |
|
|
setup grub as follows:
boot cd , mount gentoo partitions, enter chroot:
Code: | grub
find /boot/grub/stage1 | return will look like (hdx,y) substitute returned values in the following
Code: | root (hdx,y)
setup (hdx)
quit | this will setup the gentoo drive's mbr. the x and y may not be 0 - grub guesses but does not know what names bios will use
if the gentoo drive is selected in bios as the primary (first) boot drive, almost every bios will call it hd0 and call its first partition hd0,0 Legacy grub uses Bios names. Assuming that when you wish to boot gentoo, you select the gentoo drive as primary, the grub.conf should be looking at root (hd0,0) as in:
Quote: | default 0
timeout 60
#splashimage (hd0,0)/boot/grub/splash.xpm.gz
# Use this option if file system and hard drive drivers are built in to the kernel
title Gentoo Linux 3.8.13
root (hd0,0)
kernel /boot/kernel-3.8.13-gentoo root=/dev/sdb3
#use this option if the kernel was produced using genkernel all
title Gentoo Linux 3.8.13
root (hd0,0)
kernel /boot/kernel-genkernel-x86-3.8.13-gentoo real_root=/dev/sdb3
initrd /boot/initramfs-genkernel-x86-3.8.13-gentoo |
splash removed to eliminate a problem source, feel free to put it back after a successful boot
check that the spelling of kernel and initramfs match letter for letter the spelling in /boot; I've corrected what I thought were typos _________________ Defund the FCC. |
|
Back to top |
|
|
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Wed Jun 12, 2013 5:13 am Post subject: GRUB's th' RUB. |
|
|
Quote: | splash removed to eliminate a problem source, feel free to put it back after a successful boot
check that the spelling of kernel and initramfs match letter for letter the spelling in /boot; I've corrected what I thought were typos... |
THANKS much DONAHUE!
Indeed, will try this out... & also thanks for noticing the misspelling of kernel... I had a strange feeling when I typed those! How easy it is to goof here! & will for sure put splash back in when I get the desired results of this effort.
Will let you know of outcome (probably not until tomorrow, Wed.).
Henry |
|
Back to top |
|
|
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Wed Jun 12, 2013 8:56 pm Post subject: Re: GRUB's th' RUB. |
|
|
Quote: | Will let you know of outcome (probably not until tomorrow, Wed.).
Henry |
Hi Donahue (& or anyone checking this situ out),
It's Wed. & back at it as promised.
I tried what you suggested... the Code: | 'grub> find /boot/grub/stage1' | returned
I did the 'root' & 'setup' accordingly... Then did the '/boot/grub/conf' file... made sure it actually got saved (& checked the installed kernel version number to make sure it was correct, it was). Then rebooted (changed the bios to make second hd the first there, & the first hd the second).
Sure enough, got the grub window (minus splash), with the kernel listings; kernel-3.8.13-gentoo, wouldn't boot: 'file not found'
I tried (in the grub window) to edit the (hdx,y) to all the different permutations I could think of... nothing worked. I did find out, through the use of the tab completion utility... '/dev/sdb' was being seen as '(hd0,0)' that is, when I did '(hd0, 'tab,' it came up with 3 partitions... (& some ext2 & ext3 file systems).
So for what ever this might be worth, on the trail of problem solving, that was my little adventure into same, this morning.
Two thoughts, possibly not really relevant;
1.) perhaps doing the 'root' as '(hd1,0)' & 'setup' in grub as '(hd1,2)' & then not changing this after trying to edit in the grub boot window... is problematic &
2.) perhaps something is messed up in my install (or both)?
Anyway, I'll look forward to any comments on this matter.
In appreciation.
Henry
- - - - - - - - - - - - - - -
"How can you learn less..?" R.Buckminster Fuller |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Wed Jun 12, 2013 9:57 pm Post subject: |
|
|
if a handbook install (hd1,2) should not have existed
when find returns '(hd1,0) (hd1,2)' the obvious conclusion is that at some time the /boot partition was mounted and emerge grub was run and that at some other time the /boot partition was not mounted and emerge grub was run. thus grub files have been installed on partition /dev/sdb1 and on /dev/sdb3. either set will work. having both causes confusion.
boot the cd, Code: | mount /dev/sdb3 /mnt/gentoo
rm -rf /mnt/gentoo/boot
mkdir /mnt/gentoo/boot
mount /dev/sdb1 /mnt/gentoo/boot |
enter the chroot
Code: | emerge grub
genkernel all
nano /boot/grub/grub.conf |
Quote: | default 0
timeout 60
#splashimage (hd0,0)/boot/grub/splash.xpm.gz
title Gentoo Linux 3.8.13
root (hd0,0)
kernel /boot/kernel-genkernel-x86-3.8.13-gentoo real_root=/dev/sdb3
initrd /boot/initramfs-genkernel-x86-3.8.13-gentoo |
again check spelling of kernel and initramfs agains
as before:
Code: | grub
find /boot/grub/stage1 #check my guess below
root (hd1,0)
setup (hd1)
quit
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -l /mnt/gentoo{/boot,/proc,}
reboot |
_________________ Defund the FCC. |
|
Back to top |
|
|
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Wed Jun 12, 2013 10:36 pm Post subject: GRUB's th' RUB. |
|
|
DONAHUE wrote: | if a handbook install (hd1,2) should not have existed
when find returns '(hd1,0) (hd1,2)' the obvious conclusion is that at some time the /boot partition was mounted and emerge grub was run and that at some other time the /boot partition was not mounted and emerge grub was run. thus grub files have been installed on partition /dev/sdb1 and on /dev/sdb3. either set will work. having both causes confusion. |
Sounds correct to me... Thank you, & will persist... As usual, will let the outcome be known...
Henry
P.s., I take it that upon successful booting of gentoo ---> <--- I would modify 'grub.conf' with the rescue version of kernel, as well as the splash?
- - - - - - - - - - - -
"How can you learn less?" R. Buckminster Fuller |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Wed Jun 12, 2013 11:21 pm Post subject: |
|
|
if you want the rescue entry, now or later is fine. _________________ Defund the FCC. |
|
Back to top |
|
|
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Thu Jun 13, 2013 3:15 am Post subject: |
|
|
DONAHUE wrote: | if you want the rescue entry, now or later is fine. |
Well, the boot is now ---> <--- It was indeed, exactly as you said.
BUT, have now a local login:, & password: problem. I did rename my 'localhost' & that shows at boot at the 'mynamelocalhost login:'. I did create a password (& definitely know it)... I did emerge & start DHCP, but I'm not so sure I configured (correctly?) the get net domain address automatically at boot... Would this loging name/password happen if my DHCP retrieved my IP address automatically (perhaps it has not to do with it, I'm assuming relevancy as if memory serves, I think localhost usually implies internet domains, though I definitely could be wrong). I could just experiment by chrooting (by the way, what does the 'ch' stand for in 'chroot' if you wouldn't mind a short explanation at some point?)... & go thru the handbook, but... I am rather worried I do not understand clearly the nature of this problem...
I believe I did this (from handbook):
Quote: | Automatically Start Networking at Boot
To have your network interfaces activated at boot, you need to add them to the default runlevel.
|
Code: | # cd /etc/init.d
# ln -s net.lo net.eth0
# rc-update add net.eth0 default |
I did not think of it when trying different names, & my password at boot local login:, but could it be ethO (I'm assuming this is a alphabet capital O, not a zero)...
One more little issue, when I add my Windows XP OS to grub.conf, can you tell me how to find the correct (hdx,y) address to use?
So, seems like this should be simple... but not really knowing, breeds confusions...
Thanks much Donahue.
Regards,
Henry
P.s., the rather troubling thought just occurred to me: As I did not really understand WHAT the password was for, at install time, I just gave a password made up by me... could it be this is the password for my internet access? If so, can I change it? & how? |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Thu Jun 13, 2013 4:24 am Post subject: |
|
|
login: at the first successful reboot expects you to enter root and then the password you created earlier.
then enter to see what interface names udev has assigned. you can elect to use the udev assigned names or you can run Code: | touch /etc/udev/rules.d/80-net-name-slot.rules | and revert to using kernel assigned names such as eth0 and wlan0. reboot if you go with eth0, will tell you which interfaces drivers have drivers and firmware and are up.
for the moment use the primary boot disk choice in bios to select between gentoo and windows.
ch is for change in chroot
hostname is the arbitrary name you assign to your computer. if you have a bunch of them it becomes important. _________________ Defund the FCC. |
|
Back to top |
|
|
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Thu Jun 13, 2013 9:38 pm Post subject: |
|
|
DONAHUE wrote: | login: at the first successful reboot expects you to enter root and then the password you created earlier.
|
Ok Donahue, that did the trick... Thanks much.
I see my next set of problems will revolve around getting a desktop... It's not to clear to me on how to proceed here... as I thought that in choosing a 'genkernel' would more or less, for the moment, avoid having to recompile the kernel... (& perhaps I do not understand correctly (I'm hoping))... The Gentoo handbook gives (for example) the statement, re the xfce desktop environment, in discussing the matter, refers to the kernel configuration manual... but that manual, in turn, directs you to the genkernel manual (if you use that kernel, as I do). Also, X.org configuration, & what else?
Anyway, I should probably bring those issues to another topic area... (if necessary).
More germane to the topic originally raised here, for me now, is to figure the proper name for the hd that houses my Windows XP, to list in the grub.conf file, to be able to do dual boot from Grub (again). I got the splash screen splashing.
Henry |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Thu Jun 13, 2013 9:57 pm Post subject: |
|
|
add to grub.conf
Quote: | title Windows
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1 |
this assumes that the first partition on the windows hard drive is bootable, if not rootnoverify (hd1,1) or rootnoverify (hd1,2)
should show the windows boot flag with an asterisk
http://www.gentoo.org/doc/en/xorg-config.xml
if you Code: | emerge twm xterm xclock | before running startx you will have a rudimentary gui to test X with that you can escape by entering exit _________________ Defund the FCC. |
|
Back to top |
|
|
HenryPeters n00b
Joined: 20 Mar 2011 Posts: 51 Location: Michigan, U.S.A.
|
Posted: Fri Jun 14, 2013 5:28 pm Post subject: |
|
|
DONAHUE wrote: | http://www.gentoo.org/doc/en/xorg-config.xml
if you Code: | emerge twm xterm xclock | before running startx you will have a rudimentary gui to test X with that you can escape by entering exit |
Ok, got the Windows booting from Grub.
emerged the above, but can't quite figure out how to start it. Apparently (from something I read) you cannot (with out additional code) run a program in 'root' & since I am booting Gentoo from the install, apparently cannot do an 'exit' as one can from 'chroot.' (?)
Perhaps the program/s twm xterm xclock were supposed to run automatically after install????? (sorry, really am novice at this OS)
Thanks.
Henry |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Fri Jun 14, 2013 5:52 pm Post subject: |
|
|
following http://www.gentoo.org/doc/en/xorg-config.xml results in installing an appropriately configured (for your video card) xorg-server. if you have done that and a blank screen results that can only be escaped by power off, reset button, alt-o-sysrequest, or starting another terminal. if you have emerged twm xterm xclock and installed xserver; startx will result in a black screen with 3 white windows. typing exit in the leftmost will stop xorg-server and return to the console. After you emerge your choice of display manager/window manager/desktop you will Code: | ls /etc/X11/Sessions | and find the exact spelling for the xsession you want to run. You will then edit /etc/env.d/90xsession to specify XSESSION="your choice" . The next reboot and startx should bring up your gui. _________________ Defund the FCC. |
|
Back to top |
|
|
|
|
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
|
|