LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-26-2006, 04:25 PM   #1
snowsquirrel
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Rep: Reputation: 0
Question The file /boot/grub/stage1 not read correctly.


Distro Kubuntu.
somehow my mbr got borked. So I booted up knoppix, and did the following:
# mount /dev/hda1 /mnt/hda1
# mount /dev/hda2 mnt/hda1/var
# mount /dev/hda5 mnt/hda1/tmp
# chroot /mnt/hda1 bash
# grub-install /dev/hda

But I get this error message: The file /boot/grub/stage1 not read correctly.

Any ideas?

Thanks,

~S
 
Old 02-26-2006, 05:28 PM   #2
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
assuming
/dev/hda1 is / including /boot and everything which belongs there (kernel-image, directory "grub" with grub's files and menu.lst)
/dev/hda2 contains everything from /var (it is mounted to /var)
/dev/hda5 contains everything from /tmp
Is the file /boot/grub/stage1 there?
if yes ->
it should go like this:
mount -t proc none /mnt/hda1/proc -> mount /proc to /mnt/hda1/proc - which is going to be /proc when chroot is done
mount -o bind /dev /mnt/hda1/dev -> mount the /dev directory to /mnt/hda1/dev - which is otherwise empty
chroot /mnt/hda1 /bin/bash
cp /proc/mounts /etc/mtab -> adjust the list of mounted filesystems - because it is needed for grub-install to find the right devices
grub-install /dev/hda
 
Old 02-26-2006, 05:41 PM   #3
snowsquirrel
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Everything you say makes sense now that I read it. But I still get the same error.

mount now gives:
Code:
rootfs on / type rootfs (rw)
/dev/root.old on / type ext2 (rw)
/proc on /proc type proc (rw)
/dev/pts on /dev/pts type devpts (rw)
/dev/scd0 on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw)
/proc/bus/usb on /proc/bus/usb type usbdevfs (rw)
automount(pid863) on /mnt/auto type autofs (rw)
/dev/hda1 on / type ext3 (rw)
/dev/hda2 on /var type ext3 (rw)
/dev/hda5 on /tmp type ext2 (rw)
none on /proc type proc (rw)
/dev/root.old on /dev type ext2 (rw)
I still get "The file /boot/grub/stage1 not read correctly."

Upon further investigation:
Code:
# grub
grub >
   root (hd0,0)
Error 21: Selected disk does not exist
I notice in the output of 'mount' that I have '/' used as a mount point twice. Would this be my problem? I wonder if I can unmount '/' first? I doubt Knoppix would let me... hmmm. Maybe a different boot disk is in order....

Any thoughts jomen?

~S
 
Old 02-26-2006, 06:28 PM   #4
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
instead of cp /proc/mounts /etc/mtab
do:
grep -v rootfs /proc/mounts > /etc/mtab
this will eliminate the line:
rootfs on / type rootfs (rw)
I don't think that this a problem though...
maybe this is:
Quote:
Is the file /boot/grub/stage1 there?
if yes ->
If it's not there - or anyway - because the error says so - reinstall grub
(however this is done in kubuntu - probably apt-get -install ?)
 
Old 02-26-2006, 07:39 PM   #5
snowsquirrel
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Exclamation

yes, of course I check that the file existed. Ok, breifly looking at the script '/sbin/grub-install' shows that it creates a log, then greps the log for errors. So I looked that the log. The error it is getting, is the same one I am getting, when I do "root (hd0,0)" --> "The selected disk does not exist". So once I fix this error, grub-install should work. (not that much of a suprise really). But atleast I know that the problem really isn't with /boot/grub/stage1, but with not being able to see /dev/hda, and that I should be googling for "The selected disk does not exist", instead of "stage1 not read properly." Talk about shoddy error reporting...

It is interesting to note that running grub from knoppix (outside my chroot), the root (hd0,0) command does not fail, and gives this:
Code:
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
can I use my /boot/grub/menu.lst outside of my chroot? outside of my chroot, "grub-install --root-directory=/mnt/hda1 /dev/hda" seems to work. Booting now does bring up the grub menu. But I am unable to boot back into (k)ubuntu. But it seems that this may be the topic for another thread.

Thanks,

~S

Last edited by snowsquirrel; 02-26-2006 at 08:30 PM.
 
Old 02-27-2006, 02:10 AM   #6
jomen
Senior Member
 
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684

Rep: Reputation: 54
Quote:
can I use my /boot/grub/menu.lst outside of my chroot
You can run grub also directly from the boot-screen it is showing you.
Press "c" for ("command-line") to get to a command-line-interface, when you see the screen.
There you enter:

root (hd0,0)
setup (hd0)
then eighter:
configfile (hd0,0)/boot/grub/menu.lst -> which gets you to your boot-menu
or
kernel (hd0,0)/the_name_or_press_TAB_for_autocompletion
boot
which you can always use as long as you see a grub-screen...even without any working setup (wrong config-file for example)
 
Old 02-27-2006, 07:18 AM   #7
snowsquirrel
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Original Poster
Rep: Reputation: 0
thanks, I tried that out to test a few different settings. Turned out the reason I couldn't boot was because RESUME= was pointing to the wrong partition in my /etc/mkinitrd/mkinitrd.conf file. Generating a new mkinitrd file fixed that. So now I am booting.

Thanks for all the help.

~S
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gentoo... grub problems... "/boot/grub/stage1" exists... no halo14 Gentoo 5 02-06-2011 04:50 PM
gentoo : grub: The file /boot/boot/grub/stage1 not read correctly Boudewijn Linux - Software 3 05-21-2008 03:13 AM
Grub install error 31 while setting up stage1.5 netadptr0719 Linux - Software 1 01-21-2006 03:51 PM
grub error 21 stage1.5 wxman2 Suse/Novell 2 08-27-2005 10:45 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM


All times are GMT -5. The time now is 10:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration