Writing a Raspberry Pi image on SD card

Identifying the SD Card mounting point to write the Raspberry Pi system image. Start by opening a command line as Root, and type the command lsblk to get existing list of available drive(s).

Disclaimer:
The usage of this information can damage your current system. Please use care and make sure to follow recommendations, advices and also your own analysis before proceeding. I will not take responsibility for any damage you may cause following these instructions.
You will be the sole responsible in case of misuse.

arnaud@VBM-Testing: ~$ sudo su
[sudo] password for arnaud:
root@VBM-Testing:/home/arnaud# lsblk
NAME   MAJ:MIN  RM    SIZE   RO   TYPE   MOUNTPOINT
sda      8:0     0     60G    0   disk   
-sda1    8:1     0     60G    0   part   /
sr0     11:0     1   1024M    0   rom

Then connect the SD Card by plugging it into the SD Card reader and type the same command again, lsblk. We will now get the SD Card information by comparison.

root@VBM-Testing:/home/arnaud# lsblk
NAME   MAJ:MIN  RM    SIZE   RO   TYPE   MOUNTPOINT
sda      8:0     0     60G    0   disk   
-sda1    8:1     0     60G    0   part   /
sdb      8:16    1   15.1G    0   disk
-sdb1    8:17    1   15.1G    0   part   /media/arnaud/SD16BG
sr0     11:0     1   1024M    0   rom

Here we can see a new device in the list, name sdb, with 1 partition on it: sdb1. That is a SD Card as it is the only device we connected in between. We can also see the partition is mounted. We need to un-mount them with umount command.

root@VBM-Testing:/home/arnaud# umount /media/arnaud/SD16GB

Note: The SD card was already imaged with a Raspberry Pi system, that wasn’t used, you may see only 1 partition on the SD Card that have the size of the entire SD Card.

We need to extract it from the zip file we downloaded before we can write it to the SD card, for that we will use unzip command. The file will be extracted in the current folder with command below (eg. /home/arnaud/ in this example).

unzip Downloads/2019-04-08-raspbian-stretch-lite.zip

We can now write the Raspberry Pi image to the SD Card using the command dd. This command will copy 4MB bs=4M at the time, from the source image if=2019-04-08-raspbian-stretch-lite.img to the SD Card of=/dev/sd. It will done synchronously with conv=fsync (meaning it will finish to write on the SD Card before reading the next 4MB of the image source) and status=progress will also display progression of the entire process.

dd bs=4M if=2019-04-08-raspbian-stretch-lite.img of=/dev/sdb conv=fsync status=progress

Progression will look like this:
448790528 bytes (449 MB, 428 MiB) copied, 14 s, 31.1MB/s

Once copy is completed it will return to prompt. The SD Card may mount automatically again, un-mount it in this case, and remove it from the computer. We are now ready to boot from it using the Raspberry Pi.

Soon I will add a new article with my preferred 1st steps after getting the SD Card ready. That article will be linked about here at the end of this article (just be patient for that one if you arrive before I write it).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.