Using dd

From Low cost, low power, android ARM system board by Mini-Box.com - pico WiKi
Jump to navigation Jump to search

Identifying the microSD device name

pico-SAM9G45 can boot an operating system from the microSD card slot on the back of the board. See installing the microSD page for mounting info.
To install the operating system to microSD, you will need to connect the microSD card through a USB card reader to a computer follow the steps below.

Windows XP

In this example we used a 1GB micro SD card.
Download dd.exe
Open up a command prompt. Change to the directory where dd.exe is unpacked and run:

dd --list --filter=removable

This command lists only the removable devices attached to the PC.
A sample output should contain, on the last few lines, something similar with:

\\?\Device\Harddisk6\Partition0
link to \\?\Device\Harddisk6\DR27
Removable media other than floppy. Block size = 512
size is 988282880 bytes

In our example the microSD device name is: \\?\Device\Harddisk6\DR27
Please pay attention if your card reader has multiple slots and choose the right volume. Usually, it's the last one from the list showing the actual size of the microSD card in bytes
Use this command to write the image to the microSD card:

dd.exe if=<image name> of=<your microSD device name> bs=512 --progress

where:
bs is the block size.
--progress option will print the status of the bytes written on the microSD card.

Linux OS

In this example we used a 4GB micro SD card.
To identify the device name plug a microSD card in a USB card reader and issue a dmesg command on your linux box terminal.
A sample output should contain, on the last few lines, something similar with:

sd 8:0:0:3: [sdf] Attached SCSI removable disk
sd 8:0:0:3: [sdf] 7677952 512-byte logical blocks: (3.93 GB/3.66 GiB)

In our example the microSD device name is /dev/sdf

Writing the OS image to the microSD

The prebuilt images available for download here, must be unpacked with unzip <file_name> and then written on the microSD card using the dd command in Linux environment.
Example:

sudo dd if=<image name> of=<your microSD device name> bs=1M

Note that the "--progress" option is not available on all Linux distributions.
To see progress on distros that don't supply the option, open a second terminal and find the PID of your command by looking for part of the image name.
Example:

ps aux | grep angstrom

You will see something similar to:

root     15200 17.0  0.0  12068  1676 pts/0    D+   12:36   0:00 dd if=angstrom-gpe-2011-10-12.img of=/dev/sdi bs=1M

So the PID is 15200. Now in the second terminal you can enter

sudo kill -USR1 15200

dd will respond by showing the progress.

Or easier (note the & at the end of first command):

dd if=<image name> of=<your microSD device name> &
watch -n 5 -e kill -USR1 $! || echo "Done writing"