On Thu, Oct 22, 2009 at 1:05 AM, kevin631012 <[email protected]> wrote:
> Hi Nathan , Bruce
> thanks you all , grub seems to be working now . It is able to grub-install 
> and grub-mkconfig what I do is
>
> 1) having a file under /boot/grub/device.map as Bruce mentioned .
> (hd0) /dev/sda
> (hd1) /dev/sdb
> sdb which has two partitions and I develop my LFS on it .
>
> 2) grub-install --grub-setup=/bin/true /dev/sdb
> 3) grub-mkconfig -o /boot/grub/grub.cfg
>
>
> I check grub.cfg file as following
>
> ============== grub.cfg begin ========================
> root:/boot/grub# cat grub.cfg
> #
> # DO NOT EDIT THIS FILE
> #
> # It is automatically generated by /usr/sbin/grub-mkconfig using templates
> # from /etc/grub.d and settings from /etc/default/grub
> #
>
> ### BEGIN /etc/grub.d/00_header ###
> set default=0
> set timeout=5
> ### END /etc/grub.d/00_header ###
>
> ### BEGIN /etc/grub.d/10_linux ###
> menuentry "GNU/Linux, Linux 2.6.30.5" {
>     insmod ext2
>     set root=(hd1,2)
>     search --no-floppy --fs-uuid --set e4adbac2-a338-4305-bafe-73f2adb307da
>     linux    /boot/lfskernel-2.6.30.5 root=/dev/sdb2 ro
> }
> menuentry "GNU/Linux, Linux 2.6.30.5 (recovery mode)" {
>     insmod ext2
>     set root=(hd1,2)
>     search --no-floppy --fs-uuid --set e4adbac2-a338-4305-bafe-73f2adb307da
>     linux    /boot/lfskernel-2.6.30.5 root=/dev/sdb2 ro single
> }
> ### END /etc/grub.d/10_linux ###
>
> ### BEGIN /etc/grub.d/30_os-prober ###
> ### END /etc/grub.d/30_os-prober ###
>
> ### BEGIN /etc/grub.d/40_custom ###
> # This file provides an easy way to add custom menu entries.  Simply type the
> # menu entries you want to add after this comment.  Be careful not to change
> # the 'exec tail' line above.
> ### END /etc/grub.d/40_custom ###
> =============== grub.cfg end =======================
>
> refer "root=" in grub.cfg , I change my /etc/fstab as following
>
> =============== /etc/fstab begin ===================
> root:/boot/grub# cat /etc/fstab
> # Begin /etc/fstab
> # file system  mount-point type   options        dump fsck
> #                                                     order
> /dev/sdb2       /           ext3  defaults       1    1
> #/dev/<yyy>     swap        swap   pri=1          0    0
> proc           /proc       proc   defaults       0    0
> sysfs          /sys        sysfs  defaults       0    0
> devpts         /dev/pts    devpts gid=4,mode=620 0    0
> tmpfs          /dev/shm    tmpfs  defaults       0    0
> # End /etc/fstab
> =============== /etc/fstab end ======================
>
>
>
> but when I reboot , I got " kernel panic , not syncing:VFS:unable to mount 
> root fs on unknown-block(2,0)" , actually I try many different combinations 
> just wouldn't boot and got kernel panic every time .
> @_@
>
> BTW , I didn't change any things when I compile kernel .

# Start of  /boot/grub/grub.cfg
set timeout=10

menuentry LinuxFromScratch {
  linux (hd0,2)/lfskernel-2.6.32-rc3 root=/dev/md5 fastboot bootwait
}
# End of /boot/grub/grub.cfg

(Just a comparison of a handbuild one, if you are interested)

What you need to find out, is which devices the kernel finds.  To do
that, you can hold down shift, and use Page Up/Down to scroll through
the kernel output code. (Which will stop working when the kernel
panic's)

You can tell it to wait until the device appears (It wont, but it'll
keep it from panicing) by adding bootwait to the end of the line [see
linux-2.6.??/Documentation/kernel-parameters.txt for information on
this flag if you like].


Most likely, your kernel is either missing drivers for your kernel
(not compiled in), or it swapped sda/sdb.  Keep in mind that if you
compiled it as a module,  then the code to recognize the harddrive
controller is stored on the harddrive.

-- 
Nathan Coulson (conathan)
------
Location: Brittish Columbia, Canada
Timezone: PST (-8)
Webpage: http://www.nathancoulson.com
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to