LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 02-20-2011, 02:56 PM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Grub final hurdle


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
 
Old 02-20-2011, 03:14 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
What exactly are you trying to do?
 
Old 02-20-2011, 03:28 PM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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"
 
Old 02-20-2011, 03:33 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
Quote:
Originally Posted by spiky0011 View Post
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]).

Hope this helps.
 
Old 02-20-2011, 03:37 PM   #5
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Grub itself is installed onto the bootloader of your hard drive. As far as what you are trying to run, it would need to be /dev/hda and not hda1

EDIT: druuna beat me to it.
 
Old 02-20-2011, 04:21 PM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
ok ran
Code:
grub-install --grub-setup=/bin/true /dev/hda
It installed Grub in /boot but when i ran
Code:
grub-mkconfig -o /boot/grub/grub.cfg
I get "/usr/sbin/grub-probe error" cannot find a device for / (is /dev mounted?)
 
Old 02-20-2011, 04:33 PM   #7
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Can you post the output of "mount" (without the quote)?
 
Old 02-20-2011, 04:41 PM   #8
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
 
Old 02-20-2011, 04:45 PM   #9
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Try mounting hda to /mnt and run update-grub.
 
Old 02-20-2011, 04:52 PM   #10
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
mkdir /mnt/hda1
cd /mnt
mount dev/hda1 returned special device /dev/hda1 dose not exist.

Just a thought I still have the original build of lfs in tty2 which shows fdisk -l dev/hda1 *
Is this causing the problem???

Last edited by spiky0011; 02-20-2011 at 04:59 PM.
 
Old 02-21-2011, 02:46 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

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).

Now you are set up to continue.

Hope this helps.
 
Old 02-22-2011, 12:05 PM   #12
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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

The bold bits are the difference to book.
Code:
grub-mkdevicemap --device-map=device.map
cat device.map
returns (hd0) /dev/hda

then
Code:
grub-install --grub-setup=/bin/true /dev/hda
 
Old 02-22-2011, 12:25 PM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by spiky0011 View Post
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
 
Old 02-24-2011, 03:29 PM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
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
 
Old 02-24-2011, 06:01 PM   #15
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by spiky0011 View Post
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.
 
  


Reply

Tags
grub, lfs



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
Problem with final stage....GRUB error 17 lfs_rocks Linux From Scratch 4 03-26-2008 03:17 AM
LXer: AntiX spin on Mepis in 'pre-final' stage, should be 'final' in early July LXer Syndicated Linux News 0 06-28-2007 10:31 PM
Final Hurdle and it failed BobNutfield Linux From Scratch 1 05-20-2006 12:35 AM
Last hurdle with Slack...boot from Grub [SOLVED] BobNutfield Slackware 12 03-12-2006 10:38 AM
The IM hurdle for no-IM settings. NoobieDoobieDo Programming 0 10-18-2004 03:50 PM

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

All times are GMT -5. The time now is 08:18 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