Re: Grub boots from command line but not menu



On Sat, 25 Feb 2006 21:43:58 -0800, iforone wrote:


Douglas Mayne wrote:

WAG: root is the magic word which causes the grub to "forget"
anything it knows about filesystems, and also reinitialize where it looks
for _its_ files. This is what I was speculating about before.

BTW, I am planning on doing some more tests with grub. I'd like to know
what exactly is required for it to be able to read from different types of
filesystems on different partitions. I think that an appropriate stage2
needs to be pre-installed on the BPB of a target partition before it can
read it (unless the target partition and last specified root partition
are using the same filesystem type.) I am not sure, but some simple tests
will tell.

I'm going to add some info that may or may not help....
(BTW - what does WAG mean ? Wagers A Guess?)

That's a nice variant, kind of like, "read the _fine_ manual."
WAG and SWAG:
http://www.ceri.com/q_v6n5q4.htm



Ok..here's distro/kernel info;
$ uname -a
Linux 2.6.8-2-386 #1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU/Linux
Debian 3.1r1

Here's my relevant /boot/grub/menu.lst info
~$ sudo cat /boot/grub/menu.lst

title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd0,6)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda7 ro acpi=force
apm=force
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
root (hd0,6)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda7 ro single
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot

# This entry automatically added by the Debian installer for a
non-linux OS
# on /dev/hda1
title Windows 95/98/Me
root (hd0,0)
savedefault
makeactive
chainloader +1

Notes;
I have no kernel image or "real" Kernel .....Nothing in /usr/src DIR --
not even a /linux Directory present. I think I'm booting from a
mini-kernel - I notice 'cramfs' in dmesg at boot time (whatever that's
worth);

~$ dmesg | grep -i cram
RAMDISK: cramfs filesystem found at block 0
VFS: Mounted root (cramfs filesystem) readonly.

Note: comment inline.

I did some testing, with results which confirm your experience. grub
could read all of the known filesystems on the disc as soon as stage2 was
loaded. The results of my tests show that if grub menu is displayed, then
it doesn't require anything else to read the filesystems for which it has
been compiled. Also, it doesn't appear to reload stage2 when root
is issued within a grub menu.lst stanza. It appears that stage2 is the
superset of all the filesystems it knows how to read, established when
stage2 is compiled. As you thought, grub proved to be even more flexible
than I had guessed. But it was also more limited with chainloader than I
thought.

More Information

I could not duplicate the experience of the OP. grub would not
"forget" how to load a filesystem once stage2 is loaded. I tested
grub, version 0.97. The only error I could generate was if stage2
could not be loaded at all. That is, if I removed stage2 from the
grub directory, "grub error 15" is reported.

Specific Test Information

Several tests were performed separately using separate filesystems and
modes of operation. I tested ext2, XFS, JFS, and ReiserFS with Grub being
loaded directly from a hard disk and from a CD-R with the grub loader.

1. A Basic boot test: this is what grub should do as a
minimum.

Grub's
stage files were present (when grub was setup)
at /boot/grubI tested the
basic setup of grub at the MBR linking to . In
all cases, once the menu is displayed, grub can read files on any
partition on the disctesteperformed several tests (independantly with
ext2, XFS, ReiserFS, JFS). I

I setup a test platform with grub booting to stage2 on hda3 using xfs. I
tested with this menu.lst:

title Slackware 10.2+ xfs
root (hd0,2)
kernel /boot/vmlinuz ro root=/dev/hda3
initrd /boot/initrd

title Slackware 10.2+ ext2 w-root
root (hd0,0)
kernel /boot/vmlinuz ro root=/dev/hda1

title Slackware 10.2+ ext2 direct
kernel (hd0,0)/boot/vmlinuz ro root=/dev/hda1

All three entries boot, and there is no difference for me with the
second and third menu options. grub was not installed at all on hda1
(either in /boot/grub nor the boot sector.)

Thanks for your input. Your "reported working" experience was helpful for
me to investigate further and learn more about grub.

--
Douglas Mayne
.



Relevant Pages

  • Re: Double checking grub-install ??
    ... you keep your mbr on sda. ... However, you have another boot ... As I understand it, and have used it for over two years, grub has three ... The grub program is in stage2. ...
    (Fedora)
  • Re: 2.6.24-4 kernel not booting
    ... On Tue, Aug 5, 2008 at 10:57 PM, Andrew Sackville-West ... device..but i still not able to boot. ... as I was saying, within grub, you can edit the boot commands. ... It never mounts any of the filesystems. ...
    (Debian-User)
  • Re: GRUB failure
    ... It appears that stage2 never gets called nor stage1_5 ... definitely prints a message GRUB is loading). ... Stage1 is called with the boot, ... removing hdb) but there is a wild possibility that it was never correct ...
    (RedHat)
  • Re: Grub boots from command line but not menu
    ... I am planning on doing some more tests with grub. ... filesystems on different partitions. ... needs to be pre-installed on the BPB of a target partition before it can ... But it was also more limited with chainloader than I ...
    (comp.os.linux.setup)
  • Re: What causes bad inodes?
    ... See the grub book for details. ... Basically, with grub password protected, a user can boot any of the menu ... run so only the root fs will be mounted ro, the other filesystems will ... with Knoppix and WinXP (for encrypted DVDs. ...
    (Debian-User)