So I have a 512MB flash chip used in an embedded system with the following partition table:

p1: 32MB boot partition
p2: 200MB recovery partition
p3: 200MB normal partition

I'm using buildroot on my ubuntu (development) box to compile the 200MB ext2 image for the "normal" parition. At this point on my dev box I dd the image created from buildroot to the flash chip (plugged in with an ide to usb connector on /dev/sdd):

dd if=./output/images/rootfs.ext2 of=/dev/sdd3

OK, fine this works and I can mount /dev/sdd3 and see the entire filesystem that the embedded device will use.

Now, I want to install grub on this flash chip and am lost on how to do this. I've tried:

grub-install /dev/sdd

But when I plug the flash chip into my embedded device and turn it on, grub won't load (just sits at a black screen with blinking cursor--no error).

2 Answers 2


With a lot of searching and a lot of guess and check I came upon the solution to my problem:

First dd rootfs image buildroot creates:

sudo dd if=./output/images/rootfs.ext2 of=/dev/sdd3

Then, copy /boot from sdd3 to sdd1, create a menu.lst file, and copy over bzImage.

Finally, run grub:

sudo grub --device-map=/dev/null
> device (hd0) /dev/sdd
> root (hd0,0)
> setup (hd0)
> quit

Plug the drive into the system and everything loads.


You need to inform Grub that your disk will be the primary hard disk in the new system, and to let it know where to find the part of the bootloader that doesn't fit in the boot sector. Grub calls the correspondence between the boot-time disk designations and the disk designations in the running operating system as the device map.

I think you'll get a working bootloader if you edit /media/sdd3/boot/grub/device.map to contain

(hd0) /dev/sdd

then run grub-install --root-directory=/media/sdd3/boot/grub/device.map.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .