LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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

Reply
 
LinkBack Search this Thread
Old 01-12-2013, 02:46 PM   #16
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226

So am i correct you cant find boot or grub for lfs?
 
Old 01-12-2013, 05:15 PM   #17
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
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...
 
Old 01-12-2013, 05:19 PM   #18
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Hi

If you mount the lfs partition usin live cd you can look through the whole partition,
You could use host system to mount the partition
 
Old 01-12-2013, 06:01 PM   #19
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
Wink

Quote:
Originally Posted by spiky0011 View Post
Hi

If you mount the lfs partition usin live cd you can look through the whole partition,
You could use host system to mount the partition
Yup, I'm cruising around in there right now. Thank you for the help. I'm sure I'll be back.
 
Old 01-12-2013, 06:02 PM   #20
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 397

Rep: Reputation: 130Reputation: 130
Quote:
Originally Posted by engineer

...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.
 
Old 01-12-2013, 08:42 PM   #21
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
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.

Last edited by engineer; 01-12-2013 at 08:44 PM.
 
Old 01-12-2013, 09:26 PM   #22
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 397

Rep: Reputation: 130Reputation: 130
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.

Last edited by stoat; 01-12-2013 at 09:28 PM.
 
Old 01-13-2013, 03:02 AM   #23
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Posting the output of lfs /boot might help as well
 
Old 01-13-2013, 09:03 AM   #24
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by stoat View Post
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.

Code:
[root@localhost /]# mkdir /mnt/exboot
[root@localhost /]# mount -t ext4 /dev/sda1 /mnt/exboot
[root@localhost /]# cd /mnt/exboot
[root@localhost exboot]# ls
config-3.3.4-5.fc17.i686         initramfs-3.6.9-2.fc17.i686.img
config-3.6.9-2.fc17.i686         lost+found
efi                              memtest86+-4.20
elf-memtest86+-4.20              System.map-3.3.4-5.fc17.i686
grub                             System.map-3.6.9-2.fc17.i686
grub2                            vmlinuz-3.3.4-5.fc17.i686
initramfs-3.3.4-5.fc17.i686.img  vmlinuz-3.6.9-2.fc17.i686
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
 
Old 01-13-2013, 09:25 AM   #25
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Hi

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

vmlinuz-3.5.2-lfs-7.2
System.map-3.5.2
config-3.5.2

I see what you have done cd /mnt/lfs/boot
dont do /mnt/lfs
then cd /boot That will put you in host boot dir
You should of cd /mnt/lfs Then cd boot

Last edited by spiky0011; 01-13-2013 at 09:26 AM.
 
Old 01-13-2013, 09:56 AM   #26
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
You're right. My mistake. See below.

Code:
[root@localhost grub]# cd /mnt/lfs
[root@localhost lfs]# cd boot
[root@localhost boot]# ls
config-3.2.6  grub  System.map-3.2.6  vmlinuz-3.2.6-lfs.7.1
 
Old 01-13-2013, 10:04 AM   #27
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Ok

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
Code:
grub-install /dev/sda
?
or what did you do?
 
Old 01-13-2013, 04:19 PM   #28
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
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?
 
Old 01-13-2013, 04:29 PM   #29
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
I,m not sure where the problem is but at the moment you now know that you are on sda6 which kernel to use vmlinuz-3.2.6-lfs-7.1.

I hope you now get a grub prompt when you boot the machine?
There could be problems in the kernel config.

When you built the kernel did you check and build in devtmpfs as mention on kernel page
Code:
Device Drivers  --->
  Generic Driver Options  --->
     Maintain a devtmpfs filesystem to mount at /dev
 
Old 01-13-2013, 06:09 PM   #30
engineer
Member
 
Registered: Oct 2007
Distribution: LFS
Posts: 58

Original Poster
Rep: Reputation: 0
Yes, I do get a grub terminal when I boot.

Also, I did make the change in the kernel configuration for the devtmpfs as required.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LFS 6.8: Grub Error TKH Linux From Scratch 5 08-20-2011 08:52 AM
Grub error 21 with LFS 6.3 Chapter 8.4 bines Linux From Scratch 10 12-24-2008 03:18 PM
LFS 6.2 grub boot error 15 problem HedAche Linux From Scratch 1 08-02-2007 01:20 PM
error in 6.34 grub lfs-6 sharmashikha Linux From Scratch 1 07-05-2005 08:22 AM
Boot LFS with Grub darkmage Linux From Scratch 2 08-20-2002 12:53 PM


All times are GMT -5. The time now is 10:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration