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.
$ 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 ###
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
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
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
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?
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
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...
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.