Instructions for Creating a Bootable USB Key from an Image File
By Dale Taylor - 5Oct2008
The Moblin Image Creator produces an IMG file which is an image that can be installed on a Mobile Internet Device. These are the steps I've done to:
- Take an .img file
- Create a bootable USB key that you can install on your MID, and
- Have it run to install a new image
I do these steps on a Linux workstation, not on the MID.
These steps apply to several types of image files, including those provided by OEM’s during the development process as hardware prototypes are worked on. They work for IMG updates as provided by OEM’s along with the previously mentioned IMG files as generated by the Moblin Image Creator.
You'll need a 1Gb USB key, anything smaller than 1Gb and the full image won’t fit. I use 2Gb Sandisk™ USB keys since they are available from Costco at 3 for $20.
First you’ll need to make sure your USB key doesn’t have any of that annoying partition magic software that most manufacturers are putting onto their USB devices. You’ll need to clean all of that off of your USB stick before the image will work correctly. For example the U3 stuff that comes on Sandisk systems needs to be removed using the software that comes with it… if not the key won't boot, as the partition they create to hide their software is the bootable one. On a Sandisk, run the U3 control panel, go into the U3 launch pad settings, and look in the left column for “Uninstall”. This is the option that will completely remove all remnants from the USB key.
Once you have a single partition USB key, I start by formatting the USB key to be clean. I usually do this on a WinXP or Vista system by reformatting the USB key to FAT32.
Now that you have a clean key, it’s ready to accept an image.
DD is the linux command you use to create the USB key. It's a built-in command, and here is what it looks like in Ubuntu.
sudo dd if=[filepath.img] of=/dev/[devicename]
The big warning here is to make sure that you choose the right device for 'of'. If you choose your harddrive instead of the flash drive, you're in trouble. The easiest way to see what device to map to is this: Run "ls /dev/sd*" before inserting your USB device. Then run "ls /dev/sd*" after inserting your USB device. Then point dd to the newly found device.
In my case, after double checking to make sure that my USB key shows up as sdc, this is what I typed:
Sudo dd if= CP.011.4004_v2.img of=/dev/sdc
It takes about a minute to copy the software to a USB key. Once it's done, you can eject the key and there you go - an auto boot key you can use to install a new OS on your MID. Put it in the USB slot and turn it on, it will auto run from the key and prompt you to warn you that you are about to overwrite everything on your device.
One more thing, depending on your MID, you might have to go into the boot options for the MID to enable booting from the USB key. On most of the recent devices I have seen this is now the default state.
Once it's fully installed, remove the key and reboot the device. I've had to occasionally reset the device by using the pointer and pressing into the small hole in the back of the unit to get it to startup once you've installed a new OS.
Keep the USB key around because you’ll end up using to restore images after things get messed up in the development process.
*** Update, the Moblin site has added a page which offers additional instructions for this process ***