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.
Using the search function of grub, the only thing I've been able to find is the grub.cfg file, on hd0 msdos6. Outside of that, I've tried searching for several different locations, and apparently it's just nowhere to be found...
...the only thing I've been able to find is the grub.cfg file, on hd0 msdos6.
Possible explanation: the host system was using legacy GRUB. At this point, fixing the host system's boot loader is a good idea (IMO). After all, you don't know if the LFS system is even capable of booting yet. Consider booting the host system with a Super Grub 2 Disk. Then repair its boot loader with grub-install /dev/sda in a terminal. Then you can use the host again and use its boot loader to boot LFS while you continue working on it. You also can use the Super Grub 2 Disk to boot the LFS system until it is finished.
The plot thickens. Thanks for the link to the software, stoat. I tried to boot with the SG2 program, and here are the results:
- First option: Detect any OS. Selecting this option brings up just two listings; LFS, and LFS single user mode. I tried picking both of them, and neither of them will boot. GRUB acts like it is doing something (data running across the screen) then just stops after a few seconds, with some text on the screen saying something about kernel panic (most of the text doesn't mean anything to me, if you want me to post more details, let me know).
- Second option: Detect any GRUB2 configuration file (grub.cfg). This results in one listing, grub.cfg, listed on hd0,6, and when selecting this I get the same error as before: file not found, and no booting action.
- Third option: Detect any GRUB2 installation (even if MBR is overwritten). This has the same result as option 2, it lists the LFS system, and when I pick it, still no boot.
I also chose the list devices/partitions option, which resulted in a listed of the partition table, which included hd0,6 as a type ext2 FS, and hd0,3, as an ext2 FS, for my Fedora install.
For what it's worth, I don't have any data on this system, just the base system, which I installed for the sole purpose of building LFS, and the LFS build that I am working on. So, no major loss other than time if I have to start over. At this point, I'm just curious where I went wrong so I don't do it again next time. I'm going to try looking at the config files I made just before rebooting via mounting the lfs partition within the Fedora live CD environment to try and glean some more answers.
PS. I don't think the host was using legacy grub. The host is/was (Taps playing in background) Fedora 17. Also, just to be clear, when Grub loads, it says Grub 1.99 at the top of the screen.
Use that live CD to mount and examine the filesystem of /dev/sda1. Its size makes it look like the Fedora boot partition. If so, the Fedora kernel, initial ram filesystem, and GRUB folder should be there. But in post #10 you mentioned using the existing boot partition. I'm wondering if it got formatted or if the Fedora boot files are still there or what. And if you find the LFS boot files in the /boot folder of /dev/sda6, maybe you could post the grub.cfg that we know is there since the one in post #1 is not it. Perhaps someone will see what is causing the file not found error and offer something to fix it. Who knows, the LFS system might miraculously boot to a login prompt. If so, it at least would be possible to tweak and finalize if for BLFS without the further need of the host system. If it doesn't boot own its own now, that would be trouble without the host system available.
Use that live CD to mount and examine the filesystem of /dev/sda1. Its size makes it look like the Fedora boot partition. If so, the Fedora kernel, initial ram filesystem, and GRUB folder should be there. But in post #10 you mentioned using the existing boot partition. I'm wondering if it got formatted or if the Fedora boot files are still there or what. And if you find the LFS boot files in the /boot folder of /dev/sda6, maybe you could post the grub.cfg that we know is there since the one in post #1 is not it. Perhaps someone will see what is causing the file not found error and offer something to fix it. Who knows, the LFS system might miraculously boot to a login prompt. If so, it at least would be possible to tweak and finalize if for BLFS without the further need of the host system. If it doesn't boot own its own now, that would be trouble without the host system available.
Ok, I mounted the /dev/sda1 partition, the below is the output.
Also, I mounted the /mnt/lfs system (from /dev/sda6) and here is the output of the /boot directory in there:
Code:
[root@localhost grub]# cd /mnt/lfs
[root@localhost lfs]# ls
bin dev home lost+found mnt proc run sources sys tools var
boot etc lib media opt root sbin srv tmp usr
[root@localhost lfs]# cd /boot
[root@localhost boot]# ls
config-3.3.4-5.fc17.i686 grub System.map-3.3.4-5.fc17.i686
efi grub2 vmlinuz-3.3.4-5.fc17.i686
elf-memtest86+-4.20 memtest86+-4.20
When I go into the /boot/grub directory within the lfs system (supposedly where the grub.cfg file went that I created in Chapter 8.4.4, here is the output (note that there is no grub.cfg file) I'm not sure if it is supposed to be in here, or on the /boot directory of /dev/sda1...
Code:
[root@localhost lfs]# cd /boot
[root@localhost boot]# ls
config-3.3.4-5.fc17.i686 grub System.map-3.3.4-5.fc17.i686
efi grub2 vmlinuz-3.3.4-5.fc17.i686
elf-memtest86+-4.20 memtest86+-4.20
[root@localhost boot]# cd grub
[root@localhost grub]# ls
splash.xpm.gz
The boot dir dose not look right for lfs. It looks like the boot dir of fedora
The files which should have been copied when building the kernel chapter 8.3
Your 1st post you were looking for vmlinuz-3.5.2-lfs-7.1
You should of had vmlinuz-3.2.6-lfs.7.1
your grub.cfg should look like this
Code:
Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd0,6)
menuentry "GNU/Linux, Linux 3.2.6-lfs-7.1" {
linux /boot/vmlinuz-3.2.6-lfs-7.1 root=/dev/sda6 ro
}
Now did you install grub as per chapter 8.4
installing grub to
Since the book said that this chapter was optional, all I did was create the new /mnt/lfs/boot/grub/grub.cfg file as shown above.
I'm at a real loss as to how Grub is working here. I've tried updating the grub.cfg file as you showed above. I've also checked that the files were copied in Section 8.3 (vmlinuz-3.2.6-lfs-7.1, System.map-3.2.6, and config-3.2.6) were all placed in the /boot directory of the /mnt/lfs partition for the LFS system.
Where does grub look for the information to choose which kernels (or OS) to display for selection on booting? Is this the information in the grub.cfg file? If so, it is correctly reading that file, since the kernel listed in Grub's boot menu is the 3.2.6 lfs kernel. Once I choose a kernel to boot, where does Grub look for the image (or what tells grub where to look for the image)?
It seems like no matter what I do, I get the error: file not found error on trying to boot the 3.2.6 image. What file is grub referring to when it says it is not found?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.