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 . --- 09/10/21 (三),Bruce Dubbs <bruce.du...@gmail.com> : > > > /boot/device.map should contains a listing of all > drives, and the > > partition they map to. > > > > ex:/ if you have 2 drives, and one floppy disk, it > could contain. > > (hd0) /dev/sda > > (hd1) /dev/sdb > > (fd0) /dev/floppy > > > > > > I apologize, but I never did test to see if device.map > is > > automatically generated, or if I created it when I > setup my grub2 > > system. Either way, echo "(hd0) /dev/sda" > > /boot/device.map should > > fix it > > I think that should be /boot/grub/device.map. At > least that is how it is on my > system. > > -- Bruce > > -- > http://linuxfromscratch.org/mailman/listinfo/lfs-dev > FAQ: http://www.linuxfromscratch.org/faq/ > Unsubscribe: See the above information page > ___________________________________________________ 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! http://messenger.yahoo.com.tw/ -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page