On 12/07/2010 07:31 PM, kashyap garimella wrote:
> Hello everybody,
>
> I want to install grub on an image. I created an image and formatted
> it using fdisk(to create partition table) and mkfs.ext3 to create an
> ext3 partition. I followed the instructions from this wiki page:
>
http://wiki.osdev.org/Loopback_Device
> Then I installed grub.
>
> Following are the list of commands:
> $dd if=/dev/zero of=floppy.img bs=516096c count=1000
> $fdisk -u -C1000 -S63 -H16 floppy.img # And create a partition table,
> following the link
http://wiki.osdev.org/Loopback_Device
> $losetup /dev/loop0 floppy.img -o0
> $losetup /dev/loop1 floppy.img -o32256 # the ext3 partition starts
> from 63 sector(32256=63*512)
> $mkfs.ext3 /dev/loop1
> $mkdir mnt; mount /dev/loop1 mnt/
> $mkdir -p mnt/boot/grub
> $echo "(hd0) /dev/loop0" > mnt/boot/grub/device.map
> $grub-install --root-directory=mnt /dev/loop0
> Installation finished. No error reported.
>
In such config GRUB is unable to detect partitions. Either add