LinuxQuestions.org
Visit Jeremy's Blog.
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-17-2013, 03:15 PM   #1
yjy4321
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 42

Rep: Reputation: Disabled
LFS6.8 8.4.3. Testing the Configuration


I successfully generated /boot/grub/grub.cfg file
Quote:
grub-mkconfig -o /boot/grub/grub.cfg
I restarted with (and removed the lfs-live-cd)
Quote:
/sbin/reboot
It does not show grub> prompt. The computer restarts again and again...
So I put the lfs-live-cd to boot...
How do I do next commands?
Quote:
grub> root (hd0,1)
grub> kernel /boot/grub/core.img
grub> boot
Do I need to do this in the host system or in the chroot?
 
Old 02-17-2013, 03:21 PM   #2
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
Hi

can you post
Code:
sudo fdisk -l
showing lfs
and fstab and grub.cfg files.
Yes you can do it from chroot
 
Old 02-17-2013, 03:51 PM   #3
yjy4321
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: Disabled
from host system
Quote:
fdisk -l
Device Boot Start End Blocks ID System
/dev/hda1 * 1 9480 76148068+ 83 Linux
/dev/hda2 9481 9729 2000092+ 5 Extended
/dev/hda5 9481 9729 2000061 82 Linux swap / Solaris
from chroot
Quote:
$ fdisk -l
Device Boot Start End Blocks ID System
/dev/hda1 * 63 152296199 76148068+ 83 Linux
/dev/hda2 152296200 156296384 2000092+ 5 Extended
/dev/hda5 152296263 156296384 2000061 82 Linux swap / Solaris


$ cat /etc/fstab
/dev/hda1 / ext3 defaults 1 1
/dev/hda5 swap swap pri=1 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0


$ cat /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "GNU/Linux, with Linux 2.6.37.6-lfs-6.8" --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
echo Loading Linux 2.6.37.6-lfs-6.8 ...
linux /boot/vmlinux-2.6.37.6-lfs-6.8 root=/dev/hda1 ro
}
menuentry "GNU/Linux, with Linux 2.6.37.6-lfs-6.8 (recovery mode)" --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
echo Loading Linux 2.6.37.6-lfs-6.8 ...
linux /boot/vmlinux-2.6.37.6-lfs-6.8 root=/dev/hda1 ro single
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
I did not type comments in the first two files...

spiky0011,
What do you mean by showing lfs?
 
Old 02-17-2013, 04:03 PM   #4
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
Hi

The remark about show your lfs dont matter as thats the only system.
Code:
### BEGIN /etc/grub.d/10_linux ###
menuentry "GNU/Linux, with Linux 2.6.37.6-lfs-6.8" --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
echo Loading Linux 2.6.37.6-lfs-6.8 ...
linux /boot/vmlinux-2.6.37.6-lfs-6.8 root=/dev/hda1 ro
}
menuentry "GNU/Linux, with Linux 2.6.37.6-lfs-6.8 (recovery mode)" --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
echo Loading Linux 2.6.37.6-lfs-6.8 ...
linux /boot/vmlinux-2.6.37.6-lfs-6.8 root=/dev/hda1 ro single
You might want to change the red parts to sda1
 
Old 02-17-2013, 04:16 PM   #5
yjy4321
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: Disabled
I still don't get grub> prompt.
And where do I issue this command? grub-setup '(hd0)'

Edit:
I did grub-setup '(hd0)' command from chroot. And I get grub menu after reboot, but it prints...
Quote:
Root-NFS: no NFS server address
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 options; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Pid: 1, comm: swapper Not tainted 2.6.27.6 #1

Last edited by yjy4321; 02-17-2013 at 04:24 PM.
 
Old 02-17-2013, 04:50 PM   #6
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
I would adjust the grub.cfg file as I said then just reboot system
 
Old 02-17-2013, 05:10 PM   #7
yjy4321
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: Disabled
I did change as you suggested, but it prints almost same thing... now it says sda1 instead of hda1
Quote:
Root-NFS: no NFS server address
VFS: Unable to mount root fs via NFS, trying floppy
VFS: Cannot open root device "sda1" or unknown-block(2,0)
Please append a correct "root=" boot options; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Pid: 1, comm: swapper Not tainted 2.6.27.6 #1
 
Old 02-17-2013, 05:18 PM   #8
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
Did you setup grub as per the last part grub-setup /dev/sda

Also in fstab you have hda I would set that to sda as well
 
Old 02-17-2013, 06:09 PM   #9
yjy4321
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: Disabled
I changed to /dev/sda on both grub.cfg and fstab files.
The Grub menu appears, but during booting it shows...
Quote:
Root-NFS: no NFS server address
VFS: Unable to mount root fs via NFS, trying floppy
VFS: Cannot open root device "sda1" or unknown-block(2,0)
Please append a correct "root=" boot options; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Pid: 1, comm: swapper Not tainted 2.6.27.6 #1
What can I do now? What is VFS? Is this related to grub?
 
Old 02-18-2013, 07:54 AM   #10
alexchen
LQ Newbie
 
Registered: Feb 2013
Location: china
Distribution: slackware
Posts: 13

Rep: Reputation: Disabled
The VFS is Virtual File System ,you can see the Documentation in /usr/src/linux-version/Documentation/filesystems/vfs.txt
When you boot system ,the kernel can not find the /dev/sda1 so it panic
 
Old 02-18-2013, 07:57 AM   #11
alexchen
LQ Newbie
 
Registered: Feb 2013
Location: china
Distribution: slackware
Posts: 13

Rep: Reputation: Disabled
After LFS , Do you run the command grub-install /dev/hda ???
 
Old 02-19-2013, 11:28 PM   #12
yjy4321
Member
 
Registered: Apr 2011
Distribution: Ubuntu
Posts: 42

Original Poster
Rep: Reputation: Disabled
http://www.linuxfromscratch.org/lfs/...er08/grub.html
Starting 8.4 I will show you what I did...
Code:
grub-mkdevicemap --device-map=device.map
cat device.map
It outputs
Quote:
(hd0) /dev/hda
Then I did
Code:
grub-install --grub-setup=/bin/true /dev/hda
If I try with sda, then it gives two messages like
Quote:
/usr/sbin/grub-probe: error: cannot stat '/dev/sda'.
Instalation finished. No error reported.
They do not match...
Then I did...
Code:
grub-mkconfig -o /boot/grub/grub.cfg
It outputs
Quote:
Generating grub.cfg ...
Found linux image: /boot/vmlinux-2.6.37.6-lfs-6.8
done
Quote:
cat /boot/grub/grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "GNU/Linux, with Linux 2.6.37.6-lfs-6.8" --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
echo Loading Linux 2.6.37.6-lfs-6.8 ...
linux /boot/vmlinux-2.6.37.6-lfs-6.8 root=/dev/hda1 ro
}
menuentry "GNU/Linux, with Linux 2.6.37.6-lfs-6.8 (recovery mode)" --class gnu-linux --class gnu --class os {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 9ecf32d3-e02d-4f95-b0ef-ef3775c9bd2b
echo Loading Linux 2.6.37.6-lfs-6.8 ...
linux /boot/vmlinux-2.6.37.6-lfs-6.8 root=/dev/hda1 ro single
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
Like spiky0011 said, I changed from root=/dev/hda1" to "root=/dev/sda1" Should I also change from set root='(hd0,1)' to set root='(sd0,1)'?

From here, I do not know how to do section 8.4.3. So I skip that... If I need to do this, then please let me know how to get to that prompt.

Next I did...
Code:
grub-setup '(hd0)'
If I try with '(sd0)', then it gives error like...
Quote:
grub-setup: error: no mapping exists for 'sd0'.
Please any help would be great!!!
 
Old 02-20-2013, 01:51 AM   #13
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
Hi

set root=hd0,1 is correct
run
Code:
grub-setup /dev/hda
When you reboot dose it still panic?

Make sure your grub.cfg and /etc/fstab have the same settings
hda1 or sda1
I would try both options hda1 try that 1st
if not try sda1

Last edited by spiky0011; 02-20-2013 at 02:09 AM.
 
Old 02-20-2013, 04:16 AM   #14
alexchen
LQ Newbie
 
Registered: Feb 2013
Location: china
Distribution: slackware
Posts: 13

Rep: Reputation: Disabled
Use root=/dev/hda1
 
Old 02-20-2013, 08:50 AM   #15
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Some things to think about...

One is that IDE and SATA devices have been using the same libata driver code for a long time. Back when that happened, we stopped using /dev/hdx notation forever. There is no harm in trying, but I wouldn't make too much out of a failure with trying that.

Next, at least some GRUB boot loader seems to be installed and working, or else it wouldn't get as far as it does in booting. So to me, the efforts having to do with re-installing GRUB somewhere (e.g., grub-setup, grub-install) probably aren't doing much for the unable-to-mount issue.

Lastly, this unable-to-mount issue sometimes has been related to failing to configure the devtmpfs filesystem in the kernel. Or perhaps forgetting to configure support even for the main partition's filesystem. I would review the kernel's config for that stuff.
 
  


Reply



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 section 8.4.3 of LFS 6.6 book (Testing the Grub configuration) jackplughd Linux From Scratch 1 04-14-2010 08:24 AM
[Announce] LutelWall Firewall Configuration Tool - finally released for use/testing. GrapefruiTgirl Linux - Security 0 01-06-2010 06:17 PM
testing the configuration of the bridge networking with eth0 and tap0 htamayo Linux - Networking 0 09-17-2008 08:18 PM
Exim4 Configuration on Etch/Testing Schiz0 Debian 0 03-19-2007 12:00 AM
LXer: Security Testing your Apache Configuration with Nikto LXer Syndicated Linux News 0 08-13-2006 12:54 PM

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

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