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 have created grub iso brunt it to cd, do I just insert the disc What do cd,s show up as sda,hda etc. or do I use [code]grub-install --grub-setup=/bin/true /media/cdrom
I am at Section 8.4 in the 6.7 book setting up grub. I have 10gig drive with only lfs build on it I now want to set grub up so as to boot system. Having googled some more I think I need to miss some parts of 8.4 Do I just need to install grub now, if so where? fdisk -l shows hda1 I have installed lfs on hda2 is swap I did try
Code:
grub-install --grub-setup=/bin/true /dev/hda1
but get an error "No path or device specified" Auto detection of a filesystem module failed"
I have created grub iso brunt it to cd, do I just insert the disc What do cd,s show up as sda,hda etc. or do I use [code]grub-install --grub-setup=/bin/true /media/cdrom
The steps in chapter 8 might not be needed if you already have another distro on the same disk. You can add LFS to its bootloader (be it lilo or grub).
If LFS is the only "distro" on your system and you do need grub, don't spend too much time on chapter 8.4.1 (do read it, just don't do the commands). You can always use the liveCD to get access and repair stuff if needed
Start with 8.4.2. Setting Up the Configuration, read it first a few times and then follow the steps given.
Quote:
grub-install --grub-setup=/bin/true /dev/hda1
The book doesn't mention 1, 2 or 3 yet for this command, use hda (or sda depending on your system). At step 8.4.3 you need to know where lfs is situated [hd0,1 if lfs is on hda1]).
It looks like you stopped and restarted somewhere along the line and did not remount some of the mount-points. If you reboot for whatever reason you need to remount some mount-points en re-enter the chrooted environment.
These steps (when working on chapter 6 and beyond):
Code:
#6.2.2
mount -v --bind /dev $LFS/dev
# 6.2.3
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
# 6.4
chroot "$LFS" /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
The above is mentioned in chapter 6.4 (the note at the bottom).
Done as you said druuna and got grub loaded but when starting pc kernel panic,
Code:
Root-NFS No VFS server available giving up
vfs unable to mount root fs via NFS trying floppy
vfs cannot open root device "hda1" or unknown-block (2.0)
please append a correct "root=" boot option here are available partitions
9820440 sda driver sd
8755393 sda1
1060290 sda2
1048575 sr0 driver sr
kernel panic - not syncing VFS Unable to mount root fs on unknown-block (2.0)
fdisk -l shows hda1 * boot, hda2 swap
grub.cfg shows almost the same as book version,
insmod ext3
set root=(hda,1)
search --no-floppy --fs-uuid --set 915852a7-859e-45a6-9ff0-d3ebfdb5cea2
linux /boot/vmlinux-2.6.35.4-lfs-6.7 root=/dev/hda1 ro single
Done as you said druuna and got grub loaded but when starting pc kernel panic,
Code:
Root-NFS No VFS server available giving up
vfs unable to mount root fs via NFS trying floppy
vfs cannot open root device "hda1" or unknown-block (2.0)
please append a correct "root=" boot option here are available partitions
9820440 sda driver sd
8755393 sda1
1060290 sda2
1048575 sr0 driver sr
kernel panic - not syncing VFS Unable to mount root fs on unknown-block (2.0)
First thing I noticed: sda vs hda.
Quote:
insmod ext3
Did you change ext2 to ext3? You shouldn't. Change it back to: insmod ext2
To be honest I don't think this line is needed at all, but I haven't tried playing with it yet, so leave it as mentioned in the book.
Quote:
set root=(hda,1)
That should be hd0,1.
Quote:
The bold bits are the difference to book.
Yep, and those are wrong
You might still get some errors: The output posted talks about sda and not hda (which you used). If the above 2 changes don't solve all the problems change this line: linux /boot/vmlinux-2.6.35.4-lfs-6.7 root=/dev/hda1 ro single into:
Code:
linux /boot/vmlinux-2.6.35.4-lfs-6.7 root=/dev/sda1 ro single
Hope this helps.
Last edited by druuna; 02-22-2011 at 02:22 PM.
Reason: Spelling
I tried the setting as described plus some varibles but got a failure
Code:
Populating /dev with device nodes
[ 4.7497771] modprobe used greatest stack depth: 6044 bytes left
[ 5.1244071] mkdir used greatest stack depth: 6024 bytes left [ ok]
Activating all swap files/partitions
swapon: /dev/hda2: stat failed: No such file or directory [ Fail ]
Mounting root file system in read-only mode [ ok ]
Checking file systems
fsck.ext3 No such file or directory while trying to open /dev/hda1
/dev/hda1:
The sperblock could not be read or dose not describe a correct ext2
file system. If the device is valid and it really contains an ext2
file system (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternative superblock:
e2fsck -b 8193 <device>
FAILURE [fail ]
At the moment grub.cfg has the settings as per post above
I tried the setting as described plus some varibles but got a failure
Code:
Populating /dev with device nodes
[ 4.7497771] modprobe used greatest stack depth: 6044 bytes left
[ 5.1244071] mkdir used greatest stack depth: 6024 bytes left [ ok]
Activating all swap files/partitions
swapon: /dev/hda2: stat failed: No such file or directory [ Fail ]
Mounting root file system in read-only mode [ ok ]
Checking file systems
fsck.ext3 No such file or directory while trying to open /dev/hda1
/dev/hda1:
The sperblock could not be read or dose not describe a correct ext2
file system. If the device is valid and it really contains an ext2
file system (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternative superblock:
e2fsck -b 8193 <device>
FAILURE [fail ]
At the moment grub.cfg has the settings as per post above
Hi,
as druuna already stated in his earlier post you will have to change /dev/hda1 to /dev/sda1 in /boot/grub/grub.cfg. Do NOT run grub again. The problem is that the kernel on the liveCD exposes your hdd as /dev/hdXX. The newer kernel of the LFS system, however, exposes them as /dev/sdXX.
Also check your /etc/fstab for correct device-names. Your swap partition is also falsely named as /dev/hda2. It should be /dev/sda2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.