-
Book Overview & Buying
-
Table Of Contents
Banana Pi Cookbook
By :
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:
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.gz or .tgz archive using the following command:$ tar -xzvf Raspbian_For_BananaPi_v1412.tgz
.zip file, you use the following command:$ unzip Raspbian_For_BananaPi_v1412.zip
$ sudo fdisk -l
To determine the correct device, you can compare the results before and after you plug in the SD card.
The commands used in the next steps assume that your SD card is recognized as /dev/mmcblk0.
$ sudo umount /dev/mmcblk0*
$ sudo dd if=Raspbian_For_BananaPi_v1412.img of=/dev/mmcblk0 bs=1M
The writing process takes a few minutes.
$ 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.
The 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.
You do not need to format the SD card before issuing the dd command as dd also writes the whole partition information directly to the SD card.
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.
The 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 dd job.
man dd command into a shell to show the manual page of dd:$ man dd
man tar command into a shell to show the manual page of tar:$ man tar
man fdisk command into a shell to show the manual page of fdisk:$ man fdisk
Change the font size
Change margin width
Change background colour