[lfs-support] Grub 2.0 problem

Tobias Gasser lfs at ebp-gasser.ch
Tue Nov 13 15:00:38 PST 2012

Am 13.11.2012 20:26, schrieb Bruce Dubbs:

> OK, so I now understand that both sda2 and sda3 are lfs systems.
sorry for not being clear...

and sda1 is /boot for both systems

> What I suggest doing is
> mount -v /dev/sda1    $LFS/boot
> mount -v --bind /dev  $LFS/dev
as mentionned, that is what i did.
proc and sys are bind-mounted too

> It would probably be best to also mount /sys, /proc, /dev/pts, and
> /dev/shm as in Section 6.2.

/dev/pts and /dev/shm i did not mount.
i now just mounted them too.

going into chroot

now i remove the stuff from ubuntu with rm -r /boot/grub

> Then run 'grub-install /dev/sda'

as usual:
Installation finished. no error reported

> Make sure the kernel is in /boot and /boot/grub has grub.cfg and the
> i386-pc directory with the modules.
looks good. as usual.
i copy my grub.cfg (the one inlined in my first message) into /boot, 
/boot/grub and /boot/grub/i386-pc

> Then exit chroot, umount the file systems and reboot.
> GRUB should see your disk.
as usual.

GRUB boots into the rescue shell.

ls => empty
ls (hd0,1) => error: disk 'hd0,1' not found
ls (hd0,msdos1) => error: disk 'hd0,msdos1' not found

and once again, booting the ubuntu live-cd.
mounting /dev/sda1 to /mnt
grub-install --boot-directory=/mnt /dev/sda

now i copy my same grub.cfg into /boot/grub

grub runs as expected.
but it's not the bootloader i compiled, its the bootloader and all the 
modules from ubuntu.

i made 2 more experiment:

instead of ubuntu i started parted magic and used its grub. i used the 
32bit version and mounted my 32bit partition and the 64bit parted magic 
with my 64bit partition. both boot as expected.

one mor thing to mention:
i tried grub 1.99 (just applied the same sed as in the book for grub 
2.0). almost the same result as with grub 2.0.:

GRUB loading.
Welcome to GRUB!

error: disk not found.
Entering rescue mode...

grub 2.0 says: "error: disk 'hd0,msdos1' not found."
where as grub 1.99 says: "error: disk not found."

"ls" from the grub-rescue-console is empty
"ls (hd0,1)" differs a little:

grub 2.0 says: "error: disk 'hd0,msdos1' not found."
where as grub 1.99 says: "error: disk not found."

i can reproduce the problem on 3 different systems:

- intel i7
- intel atom
- intel core2duo

i connected the disk to each sata-connector on each board.
i even tried to connect the boot disk on the first sata and some more 
disks to other ports to see what ls tells me. always the same, the 
bootloader wont find any disk, cd or floppy (the core2duo has a floppy) 
where as the ubuntu-grub lists all connected disk (going to the shell 
and use "ls").

i'd say it can't be a bios problem.
i don't see any reason to blame my toolchain.
i build grub to the letter of the book.

it seems i'm the only one having problems with building grub 2.0. thus i 
guess the problem must be somwhere in my setup. i have no other package 
with problems. x11 with xfce, firefox, thunderbird, qemu/kvm, 
libreoffice all run fine. the grub tools seem to be ok as far i can see, 
it is just the bootloader which fails to find any disk.

i probably have to live without a self-compiled grub for a while...


More information about the lfs-support mailing list