root:/# cat /etc/fstab # Begin /etc/fstab # file system mount-point type options dump fsck # order /dev/sdb1 / ext3 defaults 1 1 /dev/sda3 swap swap defaults 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
root:/# cat /boot/grub/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, with Linux 2.6.32.8-lfs-6.6" { insmod ext2 set root=(hd1,1) search --no-floppy --fs-uuid --set 6cf00fe4-33fb-4550-8a3c-737380a44131 linux /boot/vmlinux-2.6.32.8-lfs-6.6 root=/dev/sdb1 ro } menuentry "GNU/Linux, with Linux 2.6.32.8-lfs-6.6 (recovery mode)" { insmod ext2 set root=(hd1,1) search --no-floppy --fs-uuid --set 6cf00fe4-33fb-4550-8a3c-737380a44131 linux /boot/vmlinux-2.6.32.8-lfs-6.6 root=/dev/sdb1 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 ###
root:/# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes Disk identifier: 0x000bb02d Device Boot Start End Blocks Id System /dev/sda1 * 1 20 153600 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 20 2187 17408000 83 Linux /dev/sda3 2187 2442 2048000 82 Linux swap / Solaris /dev/sda4 2442 2610 1354201 83 Linux Disk /dev/sdb: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes Disk identifier: 0xf1e4f756 Device Boot Start End Blocks Id System /dev/sdb1 1 2610 20964793+ 83 Linux Disk /dev/sdc: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdc doesn't contain a valid partition table
运行 "make LANG=zh_CN.GB18030 LC_ALL= menuconfig" 调出配置菜单后, 全部使用的是默认选项, 然后保存生成了 .config 文件. 由于贴子字数的限制, 没有贴出 .config 的内容, 请见谅.
ringa_lee2017-04-17 11:14:28
我的问题解决了, 参考的是 http://www.linuxchina.net/?p=1091. 同时, 也多谢 "凌晨 4 点半" 的耐心解答!!
怪我咯2017-04-17 11:14:28
lfs默认没有生成initrd.img,所以你应该在编译内核时把硬盘文件系统的驱动编译进内核,而不是编译成模块方式,编译成模块方式后,就会在生成initrd.img时被包含进去,也需要修改引导方式为
linux /boot/vmlinuz..... root=/dev/sdb1 initrd /boot/initrd.img.....
我是在真机上做LFS6.6, 我是直接把硬盘文件系统的驱动(我的是ext3)直接编译进内核, 可以直接用
linux /boot/vmlinuz.... root=/dev/sdb1
来引导系统,跳过使用 initrd /boot/initrd.img......
网上也有和你一样情况的http://bbs.chinaunix.net/thread-35679...