Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-08-2005, 08:29 AM   #1
Registered: Dec 2004
Posts: 92

Rep: Reputation: 15
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.
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?
Old 05-09-2005, 03:01 AM   #2
Registered: Mar 2005
Location: Dresden, Germany
Distribution: OpenSuse 11.2/3, Debian 5.0 , Debian 1.3.1, OpenBSD
Posts: 277

Rep: Reputation: 32
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...
Old 05-10-2005, 03:36 AM   #3
Registered: Dec 2004
Posts: 92

Original Poster
Rep: Reputation: 15


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
Bootable IMG File thesystem DamnSmallLinux 1 10-24-2004 05:02 PM
open *.img file?? tricky_linux Linux - Software 2 04-27-2004 01:56 PM
Grub and initrd.img homestead1000 Linux - Software 2 07-25-2003 02:39 PM
initrd..img - grub.conf liguorir Linux - Software 2 06-29-2003 02:05 PM
how to handle *.img file? nutecinc Linux - Newbie 2 01-28-2003 11:38 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration