LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to install grub into .img file? (https://www.linuxquestions.org/questions/linux-software-2/how-to-install-grub-into-img-file-321278/)

jackandking 05-08-2005 08:29 AM

how to install grub into .img file?
 
I do the following setups:
mount /dev/hda2 /mnt/hda2
cd /mnt/hda2
dd of=jakux.img bs=1024 seek=500000 count=0
mount /mnt/hda2/jakux.img /mnt/hda7 -o loop
then I cp a simple rootfs (created by buildroot) to /mnt/hda7 and add the kernel:
ls /mnt/hda7
bin boot dev etc home lib linuxrc mnt opt proc root sbin tmp usr var

at last ,I try to install grub like this:
grub-install /mnt/hda2/jakux.img
Format of install_device not recognized.
or:
grub-install /mnt/hda7
Format of install_device not recognized.

how could I install grub at the beginning of /mnt/hda2/jakux.img and then boot from it?

ichrispa 05-09-2005 03:01 AM

just dd it. the bootloader is not written to the file system you made on hda7, and if the.img from hda2 does contain a working bootloader you only need to write the image to the first 512 bites of hda7.
However you don't need to install grub to boot using the new filesystem as rootfs, just modify the grup configuration file to contain an entry defining hda7 as rootfs and define the kernel...

jackandking 05-10-2005 03:36 AM

thanks.


All times are GMT -5. The time now is 06:45 PM.