LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   grub:stage1 not find (https://www.linuxquestions.org/questions/linux-from-scratch-13/grub-stage1-not-find-683011/)

jimmerlin 11-12-2008 08:49 PM

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!

pinniped 11-12-2008 11:27 PM

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


jimmerlin 11-24-2008 08:21 PM

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


All times are GMT -5. The time now is 10:01 AM.