LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 05-11-2010, 03:26 PM   #1
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Rep: Reputation: 0
Grub Booting Errors in Section 8.4 of Linux From Scratch 6.3


I am new to Linux and am currently trying to build a Linux From Scratch OS. I have made it all the way through the book, up to Section 8.4 Making the LFS System Bootable.

I have mounted the /dev folder onto my system as well as the other file systems (devpts, tmpfs, proc, and sysfs).

Code:
mount -v --bind /dev /media/disk/mnt/lfs/build/dev
mount -vt devpts devpts /media/disk/mnt/lfs/build/dev/pts
mount -vt tmpfs shm /media/disk/mnt/lfs/build/dev/shm
mount -vt proc proc /media/disk/mnt/lfs/build/proc
mount -vt sysfs sysfs /media/disk/mnt/lfs/build/sys
I then chroot into my building environment:

Code:
chroot "/media/disk/mnt/lfs/build/" /tools/bin/env -i     HOME=/root TERM="$TERM" PS1='\u:\w\$ '     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin     /tools/bin/bash --login +h
And then run the code:

Code:
root (hd0,0)
Because I am building on a separate hard drive. I then get the message:

Code:
Filesystem type is ext2fs, partition type 0x83
So, I then ran the code:

Code:
setup (hd0,0)
And got this:

Code:
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 15: File not found
I then went looking for the /boot/grub/stage1 file. I thought that I knew where it was so I quit the grub shell and ran:

Code:
find /boot/grub/stage1
And it reported that it was found in that location.

I am confused and would be very thankful for any assistance concerning this problem.

Thanks!
 
Old 05-11-2010, 07:03 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

You said that you build your LFS on a seperate hdd. But when you run root (hd0,0) that means, that you build your LFS on /dev/hda1. But usually your primary system resides there.
So please post the partition layout of your harddrives(s) to determine which commands need to be issued.
 
1 members found this post helpful.
Old 05-12-2010, 03:15 PM   #3
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
My hard drives are as follows:

hda1 is building environment for Linux From Scratch
hda5 is swap space for hda1
hdb1 is operating system (Ubuntu 9.04)
hdb5 is swap space for hdb1

Hope this helps.
Thanks for your help.
 
Old 05-13-2010, 05:33 AM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by keydrain View Post
My hard drives are as follows:

hda1 is building environment for Linux From Scratch
hda5 is swap space for hda1
hdb1 is operating system (Ubuntu 9.04)
hdb5 is swap space for hdb1

Hope this helps.
Thanks for your help.
Hi,

Since you already have a bootloader installed, maybe it might be better to modify Ubuntu's menu.lst to also boot your LFS. That is what I did, since I wanted to keep my main OS functional. If you want to install a boot loader from LFS there might be problems with Ubuntu when updating it. Not 100% sure about that, but Ubuntu tries to modify it's menu.lst when updating the kernel. This modifications might not be visible, if you use LFS' menu.lst to boot the system.
 
1 members found this post helpful.
Old 05-13-2010, 03:28 PM   #5
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I don't need my Ubuntu to boot, I just need my LFS OS to boot.

I did find the menu.lst in my Ubuntu OS in the /boot/grub/ folder, but how would I go about editing the menu.lst in Ubuntu or in LFS?

And I couldn't find a menu.lst in my /boot/grub/ folder of my LFS OS.
 
Old 05-13-2010, 03:45 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Here is the part that I added to my Ubuntu (also 9.04) to boot my LFS
Code:
title		LFS
root		(hd0,0)
kernel		/boot/lfskernel-2.6.22.1 root=/dev/sda1
Use this as template to modify Ubuntu's menu.lst.
It is strange though that grub does not see your stage1 file. Did you check if the permissions for the files and the containing directories are set correctly?
 
1 members found this post helpful.
Old 05-24-2010, 03:14 PM   #7
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I have been gone recently, sorry for the trouble.

Quote:
Code:
title		LFS
root		(hd0,0)
kernel		/boot/lfskernel-2.6.22.1 root=/dev/sda1
I have added that code to the file in the folder (menu.lst) like you said with the change of the kernel (changed from 2.6.22.1 to 2.6.22.5 for my kernel)

I check the permissions on the files and those were correct to what the book said.

I then changed the permissions to 0777 with chmod in the chrooted environment:

Code:
chmod -v 777 /boot/grub/stage{1,2}
This changed the stage1 and stage2 files to Read, Write, and Execute for everyone.

Nothing has caused grub to identify the files nor does my LFS OS boot on startup.
 
Old 05-25-2010, 05:43 AM   #8
mac.tieu
Member
 
Registered: Jan 2010
Location: Vietnam
Distribution: Arch
Posts: 65

Rep: Reputation: 22
You could use 'cat /<TAB>' to find out grub file existed. May be your LFS disk is (hd1) under chroot.

MT.

Last edited by mac.tieu; 05-25-2010 at 05:52 AM.
 
Old 05-26-2010, 03:10 PM   #9
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mac.tieu View Post
You could use 'cat /<TAB>' to find out grub file existed. May be your LFS disk is (hd1) under chroot.

MT.
I do not know where I am suppose to use the

Code:
cat /<TAB>
If you could provide more detail, it would be greatly appreciated.
 
Old 05-26-2010, 03:35 PM   #10
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I was looking into the stage1 file.

Code:
more /boot/grub/stage1
It was mostly gibberish but I did find one interesting line:

Code:
�GRUB GeomHard DiskRead Error�
I am not sure of what that means though.
 
Old 05-27-2010, 01:05 AM   #11
mac.tieu
Member
 
Registered: Jan 2010
Location: Vietnam
Distribution: Arch
Posts: 65

Rep: Reputation: 22
Quote:
Originally Posted by keydrain View Post
I do not know where I am suppose to use the

Code:
cat /boot/<press TAB keystroke>
If you could provide more detail, it would be greatly appreciated.
Using auto completion feature to ensure we are in right place. And you should figure out your LFS partition is hd0 or hd1 after chroot.

Regards,
MT
 
Old 05-27-2010, 03:07 PM   #12
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I am sure that the LFS is on hd0.

And I know that the stage files are in /boot/grub/

Why should I be using cat to find this information?
 
Old 05-27-2010, 10:07 PM   #13
mac.tieu
Member
 
Registered: Jan 2010
Location: Vietnam
Distribution: Arch
Posts: 65

Rep: Reputation: 22
Quote:
Originally Posted by keydrain View Post
I am sure that the LFS is on hd0.

And I know that the stage files are in /boot/grub/(in grub context?)

Why should I be using cat to find this information?
It's bit confused. Here are steps I was used to install grub to my system:
Code:
# grub => enter grub shell
Code:
grub> root(hd0,0) 
 Filesystem type is ext2fs, partition type 0x83
Code:
grub> cat /boot/grub/[press TAB key] => to list content of '/boot/grub' 
 Possible files are: menu.lst e2fs_stage1_5 fat_stage1_5 ffs_stage1_5 iso9660_s
tage1_5 jfs_stage1_5 minix_stage1_5 reiserfs_stage1_5 stage1 stage2 stage2_elto
rito ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
When it not show correctly, you should try out other partition with root(hdX,X) command
Code:
grub> setup (hd0,0)
grub> quit
Hope that make clear what I mean
MT
 
Old 05-28-2010, 03:29 PM   #14
keydrain
LQ Newbie
 
Registered: Apr 2010
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I was inside of the grub shell and typed that code:

Code:
root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
Then tried to type;

Code:
cat /boot/grub/<TAB>
Error 15: File not found
So I tried the code in the basic directory:

Code:
cat /<TAB>
This gave me the list of directories like this:

Code:
cat /mnt/lfs/build/
This is the main directory that I have all my files in.
So then I navigated to the boot directory:

Code:
cat /mnt/lfs/build/boot/grub/<TAB>
 Possible files are: stage1 stage2
I tried it with the other hard drive (hd1,0) but I only got this:

Code:
root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

cat /boot/grub/
Error 2: Bad file or directory type
Hope this helps.
 
Old 05-28-2010, 11:23 PM   #15
mac.tieu
Member
 
Registered: Jan 2010
Location: Vietnam
Distribution: Arch
Posts: 65

Rep: Reputation: 22
Quote:
Originally Posted by keydrain View Post
I was inside of the grub shell and typed that code:

Code:
root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
Then tried to type;

Code:
cat /boot/grub/<TAB>
Error 15: File not found
So I tried the code in the basic directory:

Code:
cat /<TAB>
This gave me the list of directories like this: like what?

Code:
cat /mnt/lfs/build/
This is the main directory that I have all my files in.
Your LFS tree was lied in '/mnt/lfs/build' subdirectory?

So then I navigated to the boot directory:

Code:
cat /mnt/lfs/build/boot/grub/<TAB>
 Possible files are: stage1 stage2 
that why it said:
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no
I tried it with the other hard drive (hd1,0) but I only got this:

Code:
root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

cat /boot/grub/
Error 2: Bad file or directory type
Your LFS partition may be (hd0,0)
Hope this helps.
If your LFS built was placed in '/mnt/lfs/build' in the 1st partition of 1st disk, then you should move all files in '/mnt/lfs/build' to root of partition.
Code:
mv /media/disk/mnt/lfs/build/* /media/disk
Then install grub again

Good luck,
MT.
 
1 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux From Scratch 6.5 section 5.8 problem steviebob Linux From Scratch 25 02-03-2010 06:56 AM
GRUB errors, booting on 2nd hard drive p1800 Linux - Newbie 14 12-02-2004 02:05 PM
linux booting errors sheikhsa Linux - Newbie 4 11-08-2004 01:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration