LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-14-2010, 10:54 PM   #1
supern0va
LQ Newbie
 
Registered: May 2010
Posts: 12

Rep: Reputation: 0
Grub problems


I just don't know what to do anymore..

LFS-Version: 6.6
Chapter: 8.4.2 - 8.4.4

Well I issued:

Code:
root:/# grub-install --grub-setup=/bin/true /dev/sdb                        
Installation finished. No error reported.                                   
This is the contents of the device map /boot/grub/device.map.               
Check if this is correct or not. If any of the lines is incorrect,          
fix it and re-run the script `grub-install'.                                

(hd0)   /dev/sda
(hd1)   /dev/sdb
Code:
root:/# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...                     
Found linux image: /boot/vmlinux-2.6.32.8-lfs-6.6
done
So no problems here it seems.

I assume the following steps in 8.4.3. "Testing the Configuration" take place in the host system.

Code:
    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

grub> kernel /boot/grub/core.img

Error 15: File not found
So this is the first problem. Grub doesn't see core.img, although it exists.

Code:
root:/# find /boot/grub/core.img
/boot/grub/core.img
If I skip this step and continue to 8.4.4 "Updating the Master Boot Record", I get this error:

Code:
root:/# grub-setup '(hd1)'
grub-setup: warn: Your embedding area is unusually small.  core.img won't fit in it.
grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: If you really want blocklists, use --force.
That's the second problem. Any suggestions on either of these problems?

Hint: Before formating my partitions I did a complete overwrite through dd with values from /dev/urandom. Could it be that GRUB assumes that memory in the embedded area is filled because there are non-zero values? Would I have to overwrite with /dev/zero after using /dev/urandom to make sure GRUB recognizes it as free?

Code:
Platte /dev/sda: 120.0 GByte, 120034123776 Byte
255 Köpfe, 63 Sektoren/Spuren, 14593 Zylinder
Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
Disk identifier: 0x04270427

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sda1               1         262     2104483+  82  Linux Swap / Solaris
/dev/sda2   *         263        2873    20972857+  83  Linux
/dev/sda3            2874       14593    94140900   83  Linux

Platte /dev/sdb: 16.0 GByte, 16001036288 Byte
64 Köpfe, 32 Sektoren/Spuren, 15259 Zylinder
Einheiten = Zylinder von 2048 × 512 = 1048576 Bytes
Disk identifier: 0x471d85c4

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sdb1   *           1         191      195568   83  Linux
/dev/sdb2             192        1145      976896   82  Linux Swap / Solaris
/dev/sdb3            1146        4960     3906560   83  Linux
/dev/sdb4            4961       15259    10546176   83  Linux
Code:
(hd0)   /dev/sda
(hd1)   /dev/sdb
hd0 is my host system
hd1 is for LFS
 
Old 06-15-2010, 06:30 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
On your host system you shouldn't need to run grub-0.97. The book suggests that you reboot and go to a command line whilst grub legacy is booting. I think it's easier to edit /boot/grub/menu.lst and add a new entry that points to the /boot/grub.grub.img on your LFS system. Something like this
Code:
title Grub-1.98
root (hd1,0)
kernel /boot/grub/core.img
Don't try installing the new grub onto the MBR until you're sure it works OK.
For the "file not found" error, is /boot on /dev/sdb1 or is it on a separate partition? If /boot is on a separate partition then the path to core.img would be /grub/core.img
As for the second problem, the error installing grub-1.98 - I 've no idea. I've never seen that problem.
 
Old 06-15-2010, 03:38 PM   #3
supern0va
LQ Newbie
 
Registered: May 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for the hint. Boot is on a seperate partition and the image was found this time.

Here is ther verbose output of grub-setup:

Code:
root:/# grub-setup --verbose '(hd1)'                                                                                                                        
grub-setup: info: the size of hd0 is 234441648                                                                                                              
grub-setup: info: the size of hd0 is 234441648                                                                                                              
grub-setup: info: the size of hd0 is 234441648                                                                                                              
grub-setup: info: the size of hd0 is 234441648                                                                                                              
grub-setup: info: the size of hd0 is 234441648                                                                                                              
grub-setup: info: the size of hd1 is 31252024                                                                                                               
grub-setup: info: the size of hd1 is 31252024                                                                                                               
grub-setup: info: the size of hd1 is 31252024                                                                                                               
grub-setup: info: the size of hd1 is 31252024                                                                                                               
grub-setup: info: the size of hd1 is 31252024                                                                                                               
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd0 is 234441648
grub-setup: info: the size of hd0 is 234441648
grub-setup: info: the size of hd0 is 234441648
grub-setup: info: the size of hd0 is 234441648
grub-setup: info: the size of hd0 is 234441648
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: changing current directory to /dev
grub-setup: info: changing current directory to dri
grub-setup: info: changing current directory to mapper
grub-setup: info: changing current directory to snd
grub-setup: info: changing current directory to by-path
grub-setup: info: changing current directory to net
grub-setup: info: /dev/sdb1 starts from 32
grub-setup: info: opening the device hd1
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: DOS partition 0 starts from 32
grub-setup: info: getting the size of /boot/grub/boot.img
grub-setup: info: reading /boot/grub/boot.img
grub-setup: info: getting the size of /boot/grub/boot.img
grub-setup: info: getting the size of /boot/grub/core.img
grub-setup: info: reading /boot/grub/core.img
grub-setup: info: getting the size of /boot/grub/core.img
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: the size of hd1 is 31252024
grub-setup: info: setting the root device to `hd1,1'
grub-setup: info: dos partition is 0, bsd partition is -1
grub-setup: warn: Your embedding area is unusually small.  core.img won't fit in it.
grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: If you really want blocklists, use --force.

Last edited by supern0va; 06-15-2010 at 05:30 PM.
 
Old 06-15-2010, 07:11 PM   #4
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
A quick google on your error message suggests that there may be a problem with the way your drive is partitioned and that the solution may be to repartition the drive. See here. Obviously you'd have to backup everything on the drive and copy it back after it has been repartitioned. What does fdisk -l tell you about /dev/sdb?
 
Old 06-15-2010, 07:42 PM   #5
supern0va
LQ Newbie
 
Registered: May 2010
Posts: 12

Original Poster
Rep: Reputation: 0
I just tried to repartition, but it didn't solve my problem.

For fdisk -l output see my first post (at the bottom).

I also found that article before posting here. I'm going to read over it again carefully and see if I can find anything interesting.


EDIT: Well, I'll try using parted instead of cfdisk. but don't really know if that's going to change anything.

EDIT2: It worked after all! I partitioned my drive with gparted instead of cfdisk (setting the label to msdos). gparted setup my disk with other properties which seem to fit grub better.

I'm still suffering problems trough kernel panic, hope I get that fixed too.

LAST EDIT: kernel panic problem solved too.

Last edited by supern0va; 06-16-2010 at 01:06 PM.
 
  


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
Gentoo... grub problems... "/boot/grub/stage1" exists... no halo14 Gentoo 5 02-06-2011 05:50 PM
Problems with /boot/grub/grub.conf not being read properly on reboots cmeyer Linux - Software 1 10-11-2008 07:34 PM
Problems with GRUB, not using whats in grub.conf **FIXED silentpetey Linux - General 1 11-06-2006 10:24 AM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 09:33 AM
Problems with Grub aqoliveira Linux - Software 2 05-03-2002 06:00 AM

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

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