On 18/03/2019 23:20, Pei Jia wrote:


Hi, all:


Thank you for your help so far... I make some progress, please refer to the following pictures...


https://longervision.cc/bugs/gparted.jpg

https://longervision.cc/bugs/grub.jpg

https://longervision.cc/bugs/kernel_panic.jpg



I'm pretty sure I've got *2 grubs*, *one on laptop*, *the other on USB stick*.

For now, I'm sure I boot from laptop's grub, ti comes to the

*Kernel panic - not syncing: No working init found. Try passing init= option to kernel.*

*......
*


Does that mean, *an initrd.img is a must?*


It seems I come to the final stage before make it installable ????



Thanks



On 2019-03-18 2:41 p.m., spiky0011 wrote:


On 18/03/2019 20:54, Bruce Dubbs wrote:
On 3/18/19 3:20 PM, Pei Jia wrote:

Hi, Bruce:


Thank you for your detailed explanation.


1. 2 grubs

  * *grub on my host's laptop*, please refer to
https://longervision.cc/bugs/grub.jpg . And the contents in
    */boot/grub/grub.cfg* is too much, I'm *NOT* copy/paste it here.
  * grub on my USB stick, the contents in /boot/grub/grub.cfg:

         ➜  grub cat grub.cfg
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

set root=(*hd0*,*msdos1*)
insmod ext4

menuentry "GNU/Linux, Linux 5.0.2-lfs-8.5" {
         linux   /boot/vmlinuz-5.0.2-lfs-8.5 rootdelay=10 root=*/dev/**sde* ro
}


Obviously, the *grub.cfg* on my *USB stick* is *incorrect*, right? From *grub* *bash*, if I want to load *USB stick's LFS Linux*, I'm quite sure the hard drive is *hd0*, which should *corresponds to sda* instead of *sde*. No matter what, while booting, my laptop pops up https://longervision.cc/bugs/grub.jpg *by default*. So, it seems I'm using *my laptop's grub* right now.

I am only guessing, but if the firmware is booting the usb drive, then I would try changing the grub.cfg file on the usb drive to say

linux   /boot/vmlinuz-5.0.2-lfs-8.5 rootdelay=10 root=/dev/sda1 ro

From the point of view if the system at this time the only drive is /dev/sda.

fstab should reflect the same.

grub identifies hard disks differently from the kernel.  hd0 is the first drive, but which drive is first?  Depends on the firmware, but my guess is the usb drive since it is finding the kernel for booting.  The problme is telling the kernel about the system.

  -- Bruce

What is confusing the matter is so many drives, /dev/sd,b,c,d are they usb or internal, can they be removed? if yes that would help.

Which grub are you using to boot with? laptop grub or grub on usb, stick. Usb stick grub will be harder to setup at 1st.

A good thing to learn would be "booting from grub prompt" this is a very usefull piece of knowledge and helps in situations like this.

https://www.linux.com/learn/how-rescue-non-booting-grub-2-linux

grub.cfg should look

set root=(*hd0,msdos1)
insmod ext4

menuentry "GNU/Linux, Linux 5.0.2-lfs-8.5" {
         linux   /boot/vmlinuz-5.0.2-lfs-8.5 rootdelay=10 root=/dev/sde1 rootdelay=10 ro
}

*"*is vmlinuz-5.0.2-lfs-8.5 in host */boot?* (confirm please) Because set root=(hd0,msdos1) is looking in /dev/sda1/boot for vmlinuz-5.0.2-lfs-8.5.

Your grub.cfg from host we only need the lfs part none of the rest is required.

looking at your fstab

# *_/boot/efi _*was on /dev/sdb1 during installation
UUID=YYYYYYYYY *_/boot/efi_*       vfat umask=0077      0       1

is this a uefi boot system??? If it is there's alot wrong.




You havn't said if it' uefi boot or legacy
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to