I am using the BeagleBoard development board that can run the Android platform to learn both kernel development and programming the Android platform.  As Ubuntu is the recommended platform for developing Android, I am working in the Ubuntu 11.10 desktop environment on an Acer Aspire set up with both Windows 7 and Ubuntu as a dual boot system.  I only reason that kept Windows 7 is that I have a lot of engineering software for windows, otherwise I would have built a purely Linux/Ubuntu computer

This is not the Wubi installation as there is an upper limit of 30 GB when installed this way, but the full Ubuntu on a partitioned hard drive.   I dedicated 160 GB of the 500 GB hard drive for the Ubuntu operating system so that I would not run out of space, as I did when I originally installed Ubuntu 10.04 using Wubi.  To develop in Android requires a lot of drive space and supporting apps be loaded into Ubuntu so make sure you have the space to preform the tasks before building your Ubuntu machine.  Setting up your computer for Android development requires that you load a lot of files, you don’t want to have to do this multiple times.

One of the tasks that I needed to do was create a disk image as a backup of the Micro SD that came with the development kit.  Although this image is available for download, it’s good form to learn how to create one on your own.  This will process will be helpful to know once you need to create your own disk images for what ever propose. For this example create a working directory within your home directory.  I have named mine “workspace”.

Open a console window and and change to that directory: using; “cd workspace” (do not include the quote marks.)   Now your prompt will have your home directory name followed by “/workspace$”

All disk are referred to as “Media.”  When you Mount (insert) your media, Ubuntu will advise you in a number of ways depending on what Ubuntu finds on the drive.  Media with multiple partitions will be displayed as separate drives in the launch menu/bar.  There are multiple ways to discover the name Ubuntu assigned the mounted media.  One is to use “Disk Utility” the other is to simply type “mount” in the terminal window.  I used the latter and discovered that my memory card which has 3 partitions was named:

/dev/sdb1 on /media/boot type vfat

/dev/sdb2 on /media/data type vfat

/dev/sdb3 on /media/rootfs type ext3

This indicates to me that the MMC is located at /dev/sdb  Now lets make an image of that drive.  For this example we will be using the command format:

sudo dd if=/dev/<sd*> of=<file>.img

Using my disk as an example, I will enter the command:
sudo dd if=/dev/sdb of=msd.img

Creation of the image file will take a few minutes.  When the process is done a report of the number of records copied will be displayed.  To duplicate your Micro SD from the image using the following example:

# Burn img to Micro SD
sudo dd if=<file>.img of=/dev/<sd*>

# Example
sudo dd if=msd.img of=/dev/sdb

Note, you can use other extensions for these processes.  For example, you can create .iso files too.  You can also create images of other drives such as CDs or even a backup of your system drive.

Comments are closed.