This recipe will explain how to set up the SD card using a Linux-based operating system. On Linux computers, you usually will not need any special software to uncompress archives or write the image to an SD card. To do these tasks, you usually need the command-line tools tar and dd that are preinstalled on almost any Linux distribution by default.
To prepare your image and the SD card on Linux, you will only need the following software ingredients:
A downloaded image from the Downloading an operating system for the Banana Pi recipe
The dd program
The tar program including gzip support
Optionally, the fdisk program
The following steps are required to unpack the image archive and write the image to the SD card:
Use the following
dd command very carefully. The
dd command will overwrite anything on the output (the
of parameter). In fact, you can damage your computer, if you choose the wrong output. So, make sure that the value of the parameter
of is definitely the SD card.
$ tar -xzvf Raspbian_For_BananaPi_v1412.tgz
If you have downloaded a
.zipfile, you use the following command:
$ unzip Raspbian_For_BananaPi_v1412.zip
$ sudo fdisk -l
Make a backup of the contents on your SD card.
Unmount all partitions of the SD card, if any partition is mounted:
$ sudo umount /dev/mmcblk0*
Write the image to the SD card:
$ sudo dd if=Raspbian_For_BananaPi_v1412.img of=/dev/mmcblk0 bs=1M
The writing process takes a few minutes.
On some systems, the SD card is automatically mounted after the writing process. Unmount the partitions of the SD card again:
$ sudo umount /dev/mmcblk0*
When the writing process is finished, you can eject your SD card and put it into the SD slot of your Banana Pi.
On Linux, you also need to unpack an image file and write the image to the SD card. Luckily, these tasks are much quicker and more easily done on the command line and you usually do not need to install additional software.
In fact, to unpack the image, you need the
tar command and to write an image to the SD card you need the
dd (disk dump) command. The tool tar is a program to pack or unpack archive files. The tool dd is a utility to convert and copy files from a source (the input file—the
if parameter) to a destination (the output file—the
of parameter). In contrast to a normal file copy, the actual order of the bytes is preserved.
dd command is executed with root privileges (by using the prefix command
sudo) to use the image file as input, the SD card as output, and to read/write with a block size (the
bs parameter) of one megabyte. That block size value is a safe choice when writing images to or reading from SD cards. You can also try a block size value of
4M, which results in a faster but possibly unsuccessful writing process.
The output parameter has to be the whole SD card (
/dev/mmcblk0 in our previous example). Make sure not to accidentally write to a partition of the SD card. This means do not use
/dev/mmcblk0p1 or the like).
Moreover, depending on your computer, the SD card may be recognized as
/dev/sdX and not
/dev/mmcblk0. Use the
fdisk -l command to determine the correct device file as mentioned in this recipe.
dd command will take some time. If you want to check the progress, you can issue the following command in another shell:
$ sudo pkill -USR1 -n -x dd
This will output the current status on the running