[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to install grub on an image

From: kashyap garimella
Subject: Unable to install grub on an image
Date: Wed, 8 Dec 2010 00:01:17 +0530

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:
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 linkhttp://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.

And then I ran qemu on the image:
qemu -hda /dev/loop0

I get the following error:
error: no such device:ba16366d-55d7-445d-99e8-e4cd25287b16

I checked the UUID using blkid and it is same UUID in the error. I don't know why grub is unable to find that partition. Here are the results of fdisk and blkid:
$fdisk -l /dev/loop0

Disk /dev/loop0: 516 MB, 516096000 bytes
16 heads, 63 sectors/track, 1000 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x0e5173d2

Device Boot Start End Blocks Id System
/dev/loop0p1 * 1 1000 503968+ 83 Linux

$blkid /dev/loop1
/dev/loop1: UUID="ba16366d-55d7-445d-99e8-e4cd25287b16" SEC_TYPE="ext2" TYPE="ext3" LABEL="-v"

I am using the latest stable grub:
$grub-install --version
grub-install (GRUB) 1.99~beta0

Can somebody help me in this. I am struggling to fix this from long time.

Kashyap Garimella

Attachment: Screenshot.png
Description: PNG image

reply via email to

[Prev in Thread] Current Thread [Next in Thread]