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.
2. UUID
On my *laptop's /etc/fstab*, I am using *UUID*.
➜ ~ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc3 during installation
UUID=XXXXXXXXXXXXXXXXXXXXXXXXXXXX / ext4
errors=remount-ro 0 1
# /dev/sde1
UUID=*d8a7b940-0ff5-41c4-81a0-9fd1797501ed* / ext4 errors=remount-ro
0 1
# /boot/efi was on /dev/sdb1 during installation
UUID=YYYYYYYYY /boot/efi vfat umask=0077 0 1
/swapfile
3. initrd
* Yes, I used *Gparted* to create both the *filesystem* (*msdos*) as
well as the *partition* .
* And yes, I do NOT have *initrd* so for. Is it a *must*? On my *host
laptop*, I can see:
➜ /boot ls
config-4.18.0-15-generic grub memtest86+.bin
System.map-4.18.0-15-generic vmlinuz-4.18.0-16-generic
config-4.18.0-16-generic initrd.img-4.18.0-15-generic
memtest86+.elf System.map-4.18.0-16-generic
efi initrd.img-4.18.0-16-generic
memtest86+_multiboot.bin vmlinuz-4.18.0-15-generic
Any further suggestions?
Thank you very much...
Pei
On 2019-03-18 10:28 a.m., Bruce Dubbs wrote:
On 3/18/19 5:22 AM, thomas wrote:
Am 2019-03-18 11:14, schrieb Pei Jia:
Hi:
I now make some progress:
* I followed your suggestions, CP -A LFS OUT TO MY HOST, AND
PARTITION THE USB DRIVE.
* However, I still failed to boot, please refer to my new result:
https://longervision.cc/bugs/lfs_kernel_panic.jpg
I believe I'm already very close to the RIGHT answer...
Anyway, I now have 2 GRUBS, one is ON MY HOST'S LAPTOP GRUB, the
other is ON MY USD DRIVER.
BTW, is this
http://linuxfromscratch.org/lfs/view/stable/chapter08/grub.html for
configuring GRUB2 on the HOST COMPUTER (EXISTING GRUB) ? or for the
NEWLY USB DRIVE?
Cheers
Pei
On 2019-03-17 2:13 p.m., spiky0011 wrote:
On 17/03/2019 20:33, Pei Jia wrote:
...
Please do not top-post. Add your comments *below* the text you're
answering. That helps to follow the discussion.
Please provide the grub.cfg file, the fstab of the system to boot and
the partition layout including info about which partition contains
which file system.
Indeed, it looks like we not too far from success, but you never
know... ;-)
If you want to boot from the usb drive you have to tell the system
firmware to boot from that system. That can get tricky because the
devices will change. The usb drive will be /dev/sde (for example)
when booting from the hard disk and /dev/sda (probably) when booting
from the usb drive.
You can get around that by by using UUIDs instead of devices, but that
is a bit tricky. If the drives are partitioned with GPT, then you can
use PARTUUID and not need an initrd.
Personally I think at the current knowledge level, Pei is trying to
run before he can walk.
-- Bruce
--
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