Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 83287 - grub: "Error 15: File not found" when calling savedefault during boot
Summary: grub: "Error 15: File not found" when calling savedefault during boot
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 96508 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-25 04:13 UTC by Martin Mokrejš
Modified: 2005-08-05 05:31 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/boot/grub/menu.lst (grub.conf,7.75 KB, text/plain)
2005-02-25 04:19 UTC, Martin Mokrejš
Details
Current /boot/grub/grub.conf (grub.conf,1.72 KB, text/plain)
2005-07-01 14:57 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2005-02-25 04:13:03 UTC
I've switched from x86 to ~x86 and after sys-boot/grub-0.95.20040823 was installed, I cannot boot from xfs. I get the boot menu, but selecting any entry results in Error 15: File not found.

But, when I go into command-line, I can do

kernel /boot/vmlinuz-[tab] and it prints all files available. I type in exactly same file name as specified on resp. menu.lst line and it boots.

Basically, I cannot boot using configfile. I have to boot manually from command prompt.

I fixes itself downgrading back to sys-boot/grub-0.94-r1 withou re-installing boot block. I have no explanation how is it possible. /boot is a separate partition, and grub install into /usr etc., it was even not mounted when grub upgrade/downgrade was done!
Comment 1 Martin Mokrejš 2005-02-25 04:16:25 UTC
Portage 2.0.51-r15 (default-linux/x86/2004.0, gcc-3.3.5, glibc-2.3.4.20050125-r0, 2.6.11-rc4-bk7 i686)
=================================================================
System uname: 2.6.11-rc4-bk7 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Feb 21 2005, 21:57:42)]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.5, 1.4_p6, 1.6.3, 1.9.4, 1.8.5-r3, 1.7.9-r1
sys-devel/binutils:  2.15.92.0.2-r3
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.4.19-r1, 2.4.22-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mmmx -msse -msse2 -fomit-frame-pointer -march=pentium4 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -mmmx -msse -msse2 -fomit-frame-pointer -march=pentium4 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="ftp://ftp.muni.cz/pub/linux/gentoo http://gentoo.mirror.icd.hu/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 FFmpeg X Xaw3d aalib acpi adns afs alsa apache2 apm arts ati avcodec avi berkdb bidi bitmap-fonts bonobo caca cdparanoia cdr crypt cscope cups curl dba dga directfb divx divx4 divx4linux divx5 divx5linux doc dvb dvd dvdr dvdread emacs emacs-w3 emboss encode esd ethereal evo f77 faac faad faad2 fam fame fbcon ffmpeg flac flash font-server foomaticdb fortran fvwm fvwm2 gb gd gdbm ggi gif gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile i8x0 icc imagemagick imlib imlib2 innodb java jpeg junit lcms leim libg++ libwww live lpthread lzo lzw-tiff mad mcal mesa mikmod mmx mmx2 motif mozilla mpeg mule mysql ncurses network nls oggvorbis opengl oss pam pda pdflib perl php php4 plotutils png ppds pthread pthreads python qt qtx quicktime readline rtc ruby samba scanner sdl slang slp speex spell sse sse2 ssl svga tcltk tcpd tetex theora thread threads tiff truetype truetype-fonts type1-fonts unicode usb v4l v4l2 win32 winvidix wmf xml xml2 xmms xosd xv xvid xvmc zeo zlib video_cards_radeon linguas_cs linguas_cz linguas_en"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 2 Martin Mokrejš 2005-02-25 04:19:51 UTC
Created attachment 52110 [details]
/boot/grub/menu.lst
Comment 3 SpanKY gentoo-dev 2005-03-10 20:40:45 UTC
re-open if 0.96 doesnt work
Comment 4 Martin Mokrejš 2005-03-16 07:22:48 UTC
Still happens with 0.96. :(
Comment 5 Robert Moss (RETIRED) gentoo-dev 2005-04-24 09:08:34 UTC
It looks to me like you need to take the "/boot" off all those entries. You could also fix this by recreating the boot -> . symlink in /boot which you appear to have got rid of. Please re-open and correct me if I'm wrong.
Comment 6 Martin Mokrejš 2005-04-24 12:25:02 UTC
/boot/boot is a symlink to . Why does it happen only with 0.95 and above?
Comment 7 Martin Mokrejš 2005-04-26 00:45:16 UTC
And removing the "/boot/" from the kernel line does not help at all. I don't believe grub can accept relative path. When you open the interactive commandline, the file is /boot/vmlinuz-*. Trying to set "kernel vmlinuz-* ..." doesn't help, as the file is not found.

Try it yourself. It happens for me on two computers (both having XFS) and does not happen on computers having ext3 as /boot.
Comment 8 Martin Mokrejš 2005-06-13 02:05:35 UTC
I have installed anothe rmachine using 2005.0 and upgraded to current x86 and it
also happens there. There is one important difference - that host uses only
reiserfs, i.e. /boot is reiserfs instead of xfs. And grub also cannot find the
file. But as already described, the file is happily found from interactive console.
Comment 9 Sven Wegener gentoo-dev 2005-07-01 04:56:55 UTC
You need to put a space between root and the (hd0,0) to make grub recognize it.
Comment 10 Martin Mokrejš 2005-07-01 14:39:18 UTC
Answer to comment #9: No, the space is not the problem. I just tested and if
space is omitted I get "Error 27: unrecognized command" instead of "Error 15:
File not found" which I've reported.

And, at the moment a I have:

# grep hd0 /boot/grub/grub.conf
root (hd0,0)
root (hd0,0)
root (hd0,0)
root (hd0,0)
root (hd0,0)
root (hd0,0)
root    (hd0,0)
setup   (hd0)
#

I'm put back this into my package.mask:
>=sys-boot/grub-0.95

This test was done using 0.96-r2 on 2.6.13-rc1 kernel. ;)
Comment 11 Sven Wegener gentoo-dev 2005-07-01 14:48:04 UTC
You seem to be the only one that has these issues. I can't reproduce it and the
missing space is the only error I could find in your config. I tried with long
kernel config lines and as much kernel entries as you have.
Comment 12 Martin Mokrejš 2005-07-01 14:56:10 UTC
I have only 4 gentoo machines (all intel p4 or xeons) and it happens on all of
them. :( The last one was with reiserfs so the subject should be actually
changed. ;) I'll attach the current grub.conf file.

Do you think it might be related to a BIOS or ACPI? Hypethreading is disabled,
it just slows me down. It happens on SMP and non-SMP kernels and on HIGHMEM
and also non-HIGHMEM kernels.

Thanks for your help anyway!
Comment 13 Martin Mokrejš 2005-07-01 14:57:03 UTC
Created attachment 62434 [details]
Current /boot/grub/grub.conf

/boot/grub/menu.lst is a softlink to this file of course ;-)
Comment 14 Sven Wegener gentoo-dev 2005-07-01 15:01:43 UTC
I use grub with XFS on a celeron, pentium3, pentium4, athlon-tbird and athlon-xp
and don't experience any issues. I'm afraid but I can't help until I'm able to
reproduce this error.
Comment 15 Martin von Gagern 2005-07-15 10:05:01 UTC
The problem is savedefault.

The way grub handles management of the default boot entry has changed. Where in
0.94 the default entry was located at a fixed binary position in the stage2, it
now is in an extra file named /boot/grub/default. As grub cannot modify the
filesystem itself, this file has to exist for savedefault to succeed.

Workaround when booting:
1. Select entry
2. Select "savedefault" command
3. Press [d] to delete this command
4. Press [b] to continue booting

Fix when the system is up:
grub-set-default 0
(fix untested, but should work this way)

Maybe it would be a good idea to do this at installation time as well. The
official installation procedure seems to do "grub-set-default default". At least
Line 419 of sbin/grub-install suggests this, I have not tried this yet.

Also notice that savedefault has become more powerful, it is now possible to
save a entry different from the current one as default, thus faciliating
one-time booting of othe systems. Read the info for more details.
Comment 16 Martin von Gagern 2005-07-15 10:13:34 UTC
Suggested new Summary:
grub: "Error 15: File not found" when calling savedefault during boot
since this is not only 0.95, and this has nothing to do with xfs.
Comment 17 Paolo Ornati 2005-07-15 12:20:14 UTC
*** Bug 96508 has been marked as a duplicate of this bug. ***
Comment 18 Sven Wegener gentoo-dev 2005-07-15 17:12:11 UTC
Updating summary. OK, this explains why I wasn't able to reproduce the error.
Thanks for finding this out Martin von Gagern. I hope I have some time over
the weekend to fix this and some other grub bugs.
Comment 19 David James 2005-07-24 01:40:30 UTC
The problem is that the code in stage2.c that creates the pathname for the
default file doesn't initialise the buffer properly. This is fixed already in
the grub CVS tree. See
http://lists.gnu.org/archive/html/commit-grub/2005-03/msg00007.html for the
description of the change and links to the CVS changes made.
Comment 20 SpanKY gentoo-dev 2005-08-02 20:09:34 UTC
thanks, grabbed patch and added to grub 0.96-r3
Comment 21 Martin Mokrejš 2005-08-04 14:02:38 UTC
Well, I just emerge the 0.96-r3 version and rebooted ... still the same problem.
I had /boot mounted during the emerge process, so it should have updated the
/boot partition data.

What am I supposed to do now except removing the 'savedefault' lines? ;)
Comment 22 Martin von Gagern 2005-08-04 16:12:15 UTC
(in reply to comment #21)
I'd guess that you are still using the old stage2 file, because on some setups
grub accesses this file by its physical location, not by its name. I suggest you
reinstall grub using grub-install or whatever method you used in the first place.

Updating grub is a bit tricky, as there is probably no way portage can do the
right thing automatically. See bug #98768 for more information.

If this does not help, please state if you tried running grub-set-default
manually and if /boot/grub/default does exist and looks OK.
Comment 23 Martin Mokrejš 2005-08-04 22:14:34 UTC
So I did "setup hd(0)" and rebooted, no luck. This is what I have right now:

# cat /boot/grub/default
cat: /boot/grub/default: No such file or directory
#
Comment 24 Martin Mokrejš 2005-08-04 22:16:23 UTC
aquarius ~ # !mount
mount /dev/sda1 /boot
aquarius ~ # grub-set-default 0
aquarius ~ # cat /boot/grub/default
0
#
#
#
#
#
#
#
#
#
#
# WARNING: If you want to edit this file directly, do not remove any line
# from this file, including this warning. Using `grub-set-default\' is
# strongly recommended.
aquarius ~ # 

going to reboot now. ;)
Comment 25 Martin Mokrejš 2005-08-04 22:23:04 UTC
Yes, that has helped.

My grub.conf contains:
default 2
and grub really prefers the '2' over the '0'.

How about doing this automagically on emerge then (`grub-set-default 0')?
Comment 26 SpanKY gentoo-dev 2005-08-05 05:31:19 UTC
as Martin von Gagern pointed out, running grub for the user and getting it right
is very tricky ... i'd like to keep that code logic as minimal as possible ...