Grub Booting Errors in Section 8.4 of Linux From Scratch 6.3
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.
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
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.
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.