LinuxQuestions.org
Help answer threads with 0 replies.
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 11-12-2008, 08:49 PM   #1
jimmerlin
LQ Newbie
 
Registered: Oct 2008
Posts: 8

Rep: Reputation: 0
grub:stage1 not find


i am trying to make my LFS bootable,

when setting grub,it can't find file stage1 :

1.my host system is on sda1,mount point / ,
my LFS is on sda3,mounted on /mnt/lfs/,

in my host's fstab,i already have
sda2 / ext3 default 1 1

if i want everything right? what should i write to the fstab?
should i write

sda3 / ext2 default 1 1

or

sda3 /mnt/lfs ext2 default 1 1

i chrooted to mnt/lfs,so my /mnt/lfs is / to the LFS.

2.when i chrooted to /mnt/lfs,and then run grub,which directory is grub looking for the stage1,/mnt/lfs/boot/ or /mnt/boot or / directory.maybe grub can't find stage1 because it is searching the wrong directories!

who knows how to do it,please help me!
 
Old 11-12-2008, 11:27 PM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
If you built grub, you need to copy the Stage* files to the boot/grub directory of your new installation. Stage1 and Stage2 are essential, but sometimes you need one (or more) of the other stages.

Personally, rather than run the install script for 'grub', I invoke it directly; it spares me the hassle of the install script doing the wrong thing. To do this:

1. copy the Stage* files as I have mentioned.

2. if you want to reinstall grub from the system which you are setting up, you will also need to create a boot/grub/device.map file which corresponds to the device mapping you expect when you boot that system.

3. unmount your target (the partition with boot/grub must not be mounted or grub will complain)

4. create a temporary map file (temp.map) which has the device mapping for your *current* (running) system. For example, I have something like this:

Code:
(hd0) /dev/sda
(hd1) /dev/sdb
5. invoke grub (just an example - you need to change bits as appropriate):
Code:
grub --batch --device-map=./tmp.map << EOF > grub_install_log
setup (hd1) (hd1,0)
quit
EOF
 
Old 11-24-2008, 08:21 PM   #3
jimmerlin
LQ Newbie
 
Registered: Oct 2008
Posts: 8

Original Poster
Rep: Reputation: 0
it's the inode size problem,i copied all my file else where,and try this:
mkfs.ext2 -I 128 /dev/sda3
then copied back all my files,and it worked
 
  


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
GRUB stage1.5 ignoring Linux twist3r Linux - Newbie 3 04-30-2008 07:40 PM
detect stage1.5 in GRUB Amouse Programming 5 08-10-2006 08:24 AM
Grub install error 31 while setting up stage1.5 netadptr0719 Linux - Software 1 01-21-2006 03:51 PM
grub error 21 stage1.5 wxman2 SUSE / openSUSE 2 08-27-2005 10:45 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM

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

All times are GMT -5. The time now is 11:39 AM.

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