/********************************************************************* * Author:samson * date:04/26/2015 * Test PL Atform: * GCC (Ubuntu 4.8.2-19ubuntu1) 4.8.2 * GNU bash, 4.3.11 (1)-release (X86_64-PC-LINUX-GNU) * *******************************************************************/
The following error occurred during the use of a host for Debian to build the LFS in VMware virtual:
LFS kernel panic-not syncing:VFS:Unable to mount Root fs on unkn ...
When compiling, you need to pay special attention to a problem: if the disk that is mounted in the virtual machine is a SCSI interface type, then in Make menuconfig, in addition to according to the 8.3.1 in LFS 7.7 to choose, but also to select the following items Device Drivers-->fusion MPT Device Support-->fusion MPT (base + scsihost) Drivers selected , this is for the SCSI interface of the hard disk devices.
when compiling the kernel, it is a troublesome matter to configure the parameters, and the kernel panic is usually caused by the configuration of the parameters which are not correct or missing some major drivers. If the virtual machine, can be viewed in other virtual machines, use the command Lspci, and then find the corresponding item in the menu Menuconfig appears to configure, and then compile.
First look at the layout of my hard drive:
The disk is laid out as:
[email protected]:/home/ufo# lsblk
sda 8:0 0 45g 0 disk
├─sda1 8:1 0 43.1g 0 Part/
├─sda2 8:2 0 1K 0 Part
└─sda5 8:5 0 1.9g 0 part [SWAP]
sdb 8:16 0 20g 0 disk
├─sdb1 8:17 0 15.5g 0 part/mnt/lfs
└─sdb2 8:18 0 4.5g 0 part
sr0 11:0 1 222m 0 rom /media/cdrom0
Note:
The following commands are performed in the chroot environment in LFS 7.7.
//Install grub to the second hard drive, after setting this, you need to modify the BIOS settings to enable booting from the second hard drive.
Grub-install/dev/sdb
//Use the steps in 8.4.4 into the/boot/grub/grub.cfg file
Cat >/boot/grub/grub.cfg << "EOF"
# begin/boot/grub/grub.cfg
Set default=0
Set timeout=5
Insmod ext2
Set root= (hd0,2)
Menuentry "Gnu/linux, Linux 3.19-lfs-7.7" {
Linux
/boot/vmlinuz-3.19-lfs-7.7 root=/dev/sda2 RO
}
Eof
The grub-mkconfig-o/boot/grub/grub.cfg is then used for automatic generation of the grub environment before overwriting.
//Use the SDB1 of the second hard drive as the primary partition, SDB2 as the swap partition, modify Fstab sda1 and Sda2
# Begin/etc/fstab
# File system mount-point type options Dump fsck
# Order
/DEV/SDA1/EXT4 Defaults 1 1
/dev/sda2 swap swap Pri=1 0 0
PROC/PROC proc Nosuid,noexec,nodev 0 0
Sysfs/sys Sysfs Nosuid,noexec,nodev 0 0
Devpts/dev/pts devpts gid=5,mode=620 0 0
Tmpfs/run TMPFS Defaults 0 0
Devtmpfs/dev Devtmpfs mode=0755,nosuid 0 0
# End/etc/fstab
other steps, and LFS in the 7.7 documentation. 55
LFS Kernel Panic One of the problems solved