LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-29-2012, 02:42 AM   #1
k84834
Member
 
Registered: Aug 2012
Posts: 142

Rep: Reputation: Disabled
I want to fix boot error for LFS , please help me


Hi every body
I have same error as this error . I build LFS-7.1 on VM mashin with same specifications as omar's mashin with below differences:

I use VMware installed Ubuntu 12.04 on a virtual disk of 20G. Before beginning, I add another 10G virtual disk to VM and mount it in the Ubuntu manually. So the first disk with Ubuntu displays sda in /dev/ and the second which is mounted newly displays sdb in /dev/. Following the book I install LFS
7.1 on the sdb1 which is formatted with ext3 on the sdb and given only one partition.
in chapter 8.4.3 I run cmd as grub-install /dev/sda and in
chapter 8.4.4 I save grub.cfg as follows.

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd1,1)

menuentry "GNU/Linux, Linux 3.2.6-lfs-7.1" {
linux /boot/vmlinuz-3.2.6-lfs-7.1 root=/dev/sdb1 ro
}

I want to fix errors according above link .
I use from ubuntu-12.04-dvd-i386 iso file and mount /dev/sdb1 on /mnt/lfs and my LFS system be available .
but when running "grub-install" this error occur:
root@ubuntu:/# grub-install /dev/sda
/usr/sbin/grub-probe : error: can not find a device for /boot/grub(is /dev mounted)
is it necessary to mount /dev ? I see dev directory in root of iso file .
these are iso's fstab and mtab files and fdisk command:


fdisk :
root@ubuntu:/# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000bc5ba

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 37750783 18874368 83 Linux
/dev/sda2 37752830 41940991 2094081 5 Extended
/dev/sda5 37752832 41940991 2094080 82 Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5e672529

Device Boot Start End Blocks Id System
/dev/sdb1 63 20971519 10485728+ 83 Linux
root@ubuntu:/#


fstab:
overlayfs / overlayfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda5 swap swap defaults 0 0


mtab:
/cow / overlayfs rw 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
/dev/sr0 /cdrom iso9660 ro,noatime 0 0
/dev/loop0 /rofs squashfs ro,noatime 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev 0 0
none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
gvfs-fuse-daemon /home/ubuntu/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=ubuntu 0 0
/dev/sdb1 /mnt/lfs ext3 rw 0 0
/dev /mnt/lfs/dev none rw,bind 0 0
devpts /mnt/lfs/dev/pts devpts rw 0 0
shm /run/shm tmpfs rw 0 0
proc /mnt/lfs/proc proc rw 0 0
sysfs /mnt/lfs/sys sysfs rw 0 0
 
Old 08-29-2012, 04:58 AM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debain
Posts: 1,742
Blog Entries: 1

Rep: Reputation: 244Reputation: 244Reputation: 244
Hi did you set dev in the kernel build as mentioned in note in chapter 8.3.
 
Old 08-29-2012, 06:01 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by k84834 View Post
I use from ubuntu-12.04-dvd-i386 iso file and mount /dev/sdb1 on /mnt/lfs and my LFS system be available .
but when running "grub-install" this error occur:
root@ubuntu:/# grub-install /dev/sda
/usr/sbin/grub-probe : error: can not find a device for /boot/grub(is /dev mounted)
is it necessary to mount /dev ? I see dev directory in root of iso file .
You should be inside the chrooted environment with dev mounted (as stated in 6.64. Cleaning Up) while doing these actions. Are you?
 
Old 08-29-2012, 06:23 AM   #4
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
yes , I chrooted to my sda1 hard disk but I don't know why I miss my sda,sda1,sda2 and sda5 files in /dev directory !
so , I now is installing an ubuntu 12.04 on sda and mount my sdb to /mnt/lfs mount point then use ubuntu's grub to boot LFS.
before i boot again and may face with other errors . I want to know how I can see both operating system ( ubuntu and LFS) from startup to select one of them ? is it necessary to add some line to grub.cfg ??
 
Old 08-29-2012, 07:19 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by k84834 View Post
yes , I chrooted to my sda1 hard disk
Hopefully a communication problem; You don't chroot to a hard disk, you chroot into the LFS environment.

My previous post wasn't about the chroot part but about the following:
Quote:
If the virtual kernel file systems have been unmounted, either manually or through a reboot, ensure that the virtual kernel file systems are mounted when reentering the chroot. This process was explained in Section 6.2.2, “Mounting and Populating /dev” and Section 6.2.3, “Mounting Virtual Kernel File Systems”.
Quote:
Originally Posted by k84834
... but I don't know why I miss my sda,sda1,sda2 and sda5 files in /dev directory !
If your host is on /dev/sda and you used your host to successfully boot then all those entries are there (otherwise your host wouldn't be able to boot).

Are you in the chrooted environment when the sda entries are missing? Or aren't you? Details please.

Quote:
Originally Posted by k84834
so , I now is installing an ubuntu 12.04 on sda and mount my sdb to /mnt/lfs mount point then use ubuntu's grub to boot LFS.
I don't understand what it is you are trying to do here. I assume you installed your host on /dev/sda and after that you build lfs on /dev/sdb1.

I'm not sure if you realize this, but once you have a working host and a working lfs, there is no need to mount /dev/sdb1 on /mnt/lfs on your host. Both are 2 separate OS's.

Quote:
Originally Posted by k84834
before i boot again and may face with other errors .
I want to know how I can see both operating system ( ubuntu and LFS) from startup to select one of them ? is it necessary to add some line to grub.cfg ??
Add an LFS entry to your hosts grub.cfg OR (!!) set up grub using lfs (http://www.linuxfromscratch.org/lfs/...er08/grub.html) and add an extra entry for your host. You either use your hosts grub.cfg OR the grub.cfg from LFS, not both!

Using your hosts grub.cfg is probably the easiest way to go. An Ubuntu tutorial: https://help.ubuntu.com/community/Grub2 (8. Custom Menu Entries)
 
Old 08-29-2012, 09:19 AM   #6
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Thank you druuna and spiky0011
I Add an LFS entry to my hosts grub.cfg by running update-grub command then reboot system.
on startup list I go on Linux 3.2.6-lfs-7.1 and be highlighted. then press e key and add below line to its config options:
nitrd /boot/initrd.img-3.2.6-lfs-7.1

before I do these works, I copy initrd file from my host to /boot of lfs.

I attached error file with post.
Attached Images
File Type: jpg ask.jpg (115.9 KB, 9 views)
 
Old 08-29-2012, 10:09 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by k84834 View Post
I Add an LFS entry to my hosts grub.cfg by running update-grub command then reboot system.
on startup list I go on Linux 3.2.6-lfs-7.1 and be highlighted. then press e key and add below line to its config options:
nitrd /boot/initrd.img-3.2.6-lfs-7.1

before I do these works, I copy initrd file from my host to /boot of lfs.
Why do you add an initrd option to lfs? LFS does not use initrd. Ubuntu needs one, lfs does not.
 
Old 08-29-2012, 10:17 AM   #8
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Why do you add an initrd option to lfs? LFS does not use initrd. Ubuntu needs one, lfs does not.
yes I know, because of I use ubuntu's grub and ubuntu need initrd.
 
Old 09-01-2012, 02:19 AM   #9
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Hello
I find that this error is related to kernel compiling .
I must add below options to config-3.2.6 file according this.
CONFIG_VMWARE_PVSCSI=y
CONFIG_VMWARE_BALLOON=y

can every body help me where I add these options in config file ????
 
Old 09-01-2012, 03:56 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by k84834 View Post
Hello
I find that this error is related to kernel compiling .
I must add below options to config-3.2.6 file according this.
CONFIG_VMWARE_PVSCSI=y
CONFIG_VMWARE_BALLOON=y

can every body help me where I add these options in config file ????
After make menuconfig they can be found here:
- Device Drivers -> SCSI device support -> SCSI low-level drivers -> VMware PVSCSI driver support
- Device Drivers -> Misc devices -> VMware Balloon Driver
 
Old 09-01-2012, 06:10 AM   #11
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
thanks druuna
I add above options and some errors have been correct . but still there are errors! I almost select all SCSI drivers and file systems in menuconfig. when I run the "make modules_install" one warning occur that you might need module-init-tools !
what is this ? should I install it and then run "make modules_install" command ?

how I handle the errors ?!
what I see when LFS booting be successful?
Attached Images
File Type: png pic2.png (101.4 KB, 3 views)

Last edited by k84834; 09-01-2012 at 06:15 AM.
 
Old 09-01-2012, 07:43 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by k84834 View Post
I add above options and some errors have been correct . but still there are errors! I almost select all SCSI drivers and file systems in menuconfig. when I run the "make modules_install" one warning occur that you might need module-init-tools !
what is this ? should I install it and then run "make modules_install" command ?

how I handle the errors ?!
There's not enough information posted to give you any decent advice.

- How did you recompile the kernel? Did you do that from the chrooted environment? Did you copy the appropriate files after compilation?
- Are all disk/scsi/[ps]ata related options set to static ([*] vs [M], should be[*])?
- What are the exact error messages that are produced?

Quote:
Originally Posted by k84834
what I see when LFS booting be successful?
A login prompt.

Compile LFS kernel after booting into host system (as root):
Code:
mount -v --bind /dev $LFS/dev
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

chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login

cd /location/of/linux-3.2.6/
make mrproper
cp /boot/config-3.2.6 .config
make menuconfig #set/change options -> exit and safe
make
make modules_install
cp -v arch/x86/boot/bzImage /boot/vmlinuz-3.2.6-lfs-7.1
cp -v System.map /boot/System.map-3.2.6
cp -v .config /boot/config-3.2.6
exit
reboot
 
Old 09-01-2012, 08:51 AM   #13
k84834
Member
 
Registered: Aug 2012
Posts: 142

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Compile LFS kernel after booting into host system (as root):
Code:
mount -v --bind /dev $LFS/dev
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

chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login

cd /location/of/linux-3.2.6/
make mrproper
cp /boot/config-3.2.6 .config
make menuconfig #set/change options -> exit and safe
make
make modules_install
cp -v arch/x86/boot/bzImage /boot/vmlinuz-3.2.6-lfs-7.1
cp -v System.map /boot/System.map-3.2.6
cp -v .config /boot/config-3.2.6
exit
reboot
I recompile the kernel according above procedure.
the result of make and make modules_install commands is :

Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 4 modules
CC arch/x86/kernel/test_nx.mod.o
LD [M] arch/x86/kernel/test_nx.ko
CC drivers/hid/hid-logitech-dj.mod.o
LD [M] drivers/hid/hid-logitech-dj.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
CC net/netfilter/xt_mark.mod.o
LD [M] net/netfilter/xt_mark.ko
root:/sources/linux-3.2.6# make modules_install
INSTALL arch/x86/kernel/test_nx.ko
INSTALL drivers/hid/hid-logitech-dj.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL net/netfilter/xt_mark.ko
DEPMOD 3.2.6
Warning: you may need to install module-init-tools
See http://www.codemonkey.org.uk/docs/po...loween-2.6.txt
root:/sources/linux-3.2.6#


I set all disk/scsi/[ps]ata related options to static in "Device Drivers" section of menuconfig. but the attached error occurs.

can tell me in details witch option must to be selected ? because I select all of options I think is related but the error don't solved
Attached Images
File Type: png pic3.png (22.3 KB, 3 views)

Last edited by k84834; 09-01-2012 at 08:59 AM.
 
Old 09-01-2012, 09:54 AM   #14
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,576

Rep: Reputation: 580Reputation: 580Reputation: 580Reputation: 580Reputation: 580Reputation: 580
Have you module init tools? Are they in the $PATH? Run

which depmod
which modprobe
echo $PATH
 
Old 09-01-2012, 10:45 AM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by business_kid View Post
Have you module init tools?
(@k84834) Those should have been installed in chapter 6.49 (kmod-5).

Quote:
Originally Posted by k84834 View Post
I set all disk/scsi/[ps]ata related options to static in "Device Drivers" section of menuconfig. but the attached error occurs.
Are there more errors shown? (scrolled of the page, use shift-PgUp to access them).

Selecting all options might not be a good idea. Some could conflict.

Quote:
can tell me in details witch option must to be selected ? because I select all of options I think is related but the error don't solved
These kernel options are directly related to the hardware that is being used, so I cannot point out which should/shouldn't be set.

You can get info about your hardware with the following commands (from your host):
Code:
lspci
dmesg
lsusb
lshw (might not be installed)
Maybe Ubuntu has other, graphical, tools that you might be able to get info from.

A few other things (maybe it isn't the kernel that is giving you problems):
- What does your lfs grub entry look like?
- What is the output of df -h and fdisk -l (from your host)?

Last edited by druuna; 09-01-2012 at 10:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
I'm getting an error while trying to boot into my finished lfs....Some PLEASE HELP!!! reclis94 Linux From Scratch 9 11-26-2009 04:23 PM
[SOLVED] Cross-LFS PPC kernel boot error timmytycoon Linux - Kernel 1 06-14-2009 11:58 AM
LFS 6.2 grub boot error 15 problem HedAche Linux From Scratch 1 08-02-2007 02:20 PM
error message at boot and stops there, please help me fix it. golpemortal Fedora 2 01-18-2007 01:32 AM
Boot Error in LFS saurav_gohain Linux From Scratch 5 07-07-2003 02:19 AM


All times are GMT -5. The time now is 02:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration