[lfs-support] Grub 2.0 problem

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


Am 13.11.2012 03:20, schrieb Bruce Dubbs:

what i missed in my original message:
/sda1 is ext2
/sda2 and /sda3 are ext3 (first attempt was with ext4, but as grub 
didn't work i made backups, reformatted with ext3 and restored).



> If /boot is a separate partition, then the linux lines should look like:
>
> linux /kernel-3.4.18-t64 root=/dev/sda3 ro
>
> note the you don't specify /boot there.  From the viewpoint of grub,
> there is no /boot directory.

there is, as i have a symlink.

i've removed the /boot and added the ro, but as expected no change.
grub does not find the disk.


> I suspect that you installed grub from ubuntu without /boot mounted as a
> separate partition.
from the live-cd i mounted /dev/sda2 (or sda3) to /mnt and then 
/dev/sda1 to /mnt/boot.

grub-install --boot-directory=/mnt/boot /dev/sda
installs ubuntus grub with success - and the boot-loader starts my kernel(s)

from within on of my systems (32 or 64bit), i use
grub-install /dev/sda
( i even tried with --boot-direcory=/boot with /boot mounted, but as 
expected no change as /boot is default for --boot-directory)



> One thing to do is to drop to the grub command line and do:
>
> grub>  ls (hd0,1)
just empty.

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

hitting TAB after typing "ls (" does nothing. i guess the disk can't be 
found at all.

with ubuntus grub i get what i expect: hd0,msdos{1,2,3}


the main problem is, the boot-loader does not see the disk!




> For the ubuntu instances, try:
i don't have any intalled ubuntu, i just use the livecd to get grub 
installed.

> linux (hd0,2)/boot/kernel-3.4.18-t32 root=/dev/sda2
> linux (hd0,3)/boot/kernel-3.4.18-t64 root=/dev/sda3
no. there are just empty (hd0,x)/boot as /dev/sda1 will be mounted 
later. the kernels are at (hd0,1)/ (or as i have a symlink) (hd0,1)/boot


> The trick is to know which version of the grub configuration file is
> being used.  A simple 'grub install /dev/sda' will assume that it is
> using /boot/grub/grub.cfg from where /boot is located when the install
> is run.

i have grub.cfg in (hd0,1)/ (hd0,1)/grub and (hd0,1)/grub/i386-pc
no symlinks but copies.

as grub does not see the disk, the question where grub.cfg should be 
found is not yet of interest ;) - first grub has to find the disk.

first thing to solve is to make the disk available to the boot-loader, i 
don't want to see the grub-console rescue mode:

GRUB loading.
Welcome to GRUB!

error: disk 'hd0,msdos1' not found.
Entering rescue mode...



tobias




More information about the lfs-support mailing list