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? |
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... |
thanks.
|
All times are GMT -5. The time now is 11:01 PM. |