Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I really enjoyed my first attempt at an LFS build (11.1) though to be honest I found the slope suddenly hard from section 9.3 onwards. I felt like I'd suddenly, after several weeks of the semester, walked into the wrong class, a year ahead. However, I persevered, looked up all the terms (ahem!), improvised a bit but seemed to have survived, and nervously approached my first boot. I wondered if the old ThinkPad (X200) would suddenly vanish into hyperspace. It didn't. It got stuck after the GRUB screen and wouldn't budge.
error: disk `hd0,2' not found. Press any key to continue..._"
Time for the Infinite Monkey moment? Not enough keyboards, or bananas. I went back to the GRUB screen and settled on pressing a modest 'e' for edit, finding:
setparams 'GNU/Linux, Linux 5.16.9-lfs-11.1'
linux /boot/vmlinuz-5.16.9-lfs-11.1 root=/dev/sda2 ro
Oops! I quickly discovered something: copying the example at 10.4.4 LITERALLY meant I was telling the machine to look for the root partition where my swap partition is. Duh. This took me to grub.cfg
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 5.16.9-lfs-11.1" {
linux /boot/vmlinuz-5.16.9-lfs-11.1 root=/dev/sda2 ro
}
EOF
My SSD looks like this: Host (Arch Linux) /dev/sda1=root /dev/sda2=swap; /dev/sda3=LFS. So I changed "hd0,2" to "hd0,3", and "root=/dev/sda2" to "root=/dev/sda3". I even tried changing ext2 to ext4.
Result?
error: disk `hd0,3' not found. Press any key to continue..._"
Swamped by insecurity, I tried every possible combination of edits, and got back to the same roadblock each time. I'll add that I'm used to UEFI installations, and I'm a little extra unsteady with my venerable X200 and its BIOS ways.
Next step? Shall I do the whole thing all over again ... and look out carefully for whatever I must have done wrong? Use a BIOS Boot partition? Did I somehow miss mounting the LFS partition? Monkeys may not be infinite, but ignorance is!
Any advice would be most gratefully received. And apologies if this isn't the approved layout. I don't think I got far enough for logs, dmesg etc, but that may just further illustrate my ignorance.
Thanks to everybody, and please forgive my newbie mistakes. I posted, could not find my post, and the system said I had never posted at all. So, assuming I'd done it wrong, I repeated the procedure. Anyway, learning from the responses I finally found (from the third post which succeeded) I discovered the host system I was using had some issues, and GRUB was not functioning properly. When I tried to issue the 'ls' command, it froze. I tried the 'hello world' command and the machine said it couldn't find it. So I've gone back to Square One, reinstalled the Host system, and will test and make sure everything is going smoothly before starting to build LFS again. I'm also studying what the Kernotex guy has to say, and will do a walk through with him.
So thanks to everybody. I have noted everything suggested, and if I have problems at the boot stage again I'll have avenues of approach ready. Thus I'm marking this thread SOLVED.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.