by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

foreword

In this article, share the use of built-in instructions on MacOS to install the operating system of Raspberry Pi.
Regarding the dd command during this installation process, please carefully specify the parameter of your of, which is the location of the write output to the file,
If you make a mistake, your system will be destroyed.

step

Go to the official website to download the official operating system. In this article, I use RASPBIAN.
https://www.raspberrypi.org/downloads/


1. First, connect the Micro SD card to the Mac through a USB card reader, and then use the command to view the mount.
diskutil list
As you can see, in my example, my Micro SD card is in /dev/disk3.



2. The command to unmount is as follows: Please adjust the disk number of disk[n] according to your actual situation .
diskutil unmountDisk /dev/disk3

After successfully unmounting, you should be able to see the text as follows, I successfully unmounted all files on disk3.
Unmount of all volumes on disk3 was successful

3. Next, you can use the dd command to write the downloaded img file to the sd card.
Write the image to rdisk3, the speed of using rdisk3 will be faster, if you fail to use rdisk[n], you can use disk[n] instead, where [n] is the number of the disk.
Do not copy the disk number (disk[n]), please know exactly what number you want to write to the sd card, for example /dev/disk4 .
sudo dd bs=1m if=2018-03-13-raspbian-stretch.img of=/dev/rdisk3 conv=sync

Here is a supplement to the description reference of rdisk:
/dev/rdisk nodes are character-special devices, but are "raw" in the BSD sense and force block-aligned I/O. They are closer to the physical disk than the buffer cache. /dev/disk nodes, on the other hand, are buffered block-special devices and are used primarily by the kernel's filesystem code.

Regarding the usage instructions of the dd command, we can view it by typing man dd on the terminal, and press q to leave.
In the Linux world, for Linux system administrators, the dd command should be an easy-to-use and basic must-learn command.
If we use the memory of English words as an example, then the dd command must be a word worth remembering, and it will not be the kind of unpopular word that does not need to be memorized that may not be seen once in a lifetime.

Listed here, the instructions for conv=sync.
sync Pad every input block to the input buffer size. Spaces are used for pad bytes if a block oriented con-
version value is specified, otherwise NUL bytes are used.
The result is as follows:


After the completion, you can take out the micro sd card and install it on the Raspberry Pi to start watching.
desktop

 

Tags: linux

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux

Generate ssh key pair without password query

Sometimes it is necessary to generate an ssh key pair for automatic configuration. There is no password query in the command line, and an ssh key pair is generated.

linux

Multiple ssh configuration files for public key authentication

When we use ssh public key authentication, we usually add relevant settings in ~/.ssh/config. If some are used by the company or at home, can multiple configs be used? In fact, it is possible. We can use git to load the company-shared, version-controlled config through Include.

linux

How to create an ssh key so that your computer can connect to the instance of GCE

Recently, I just started using Google's GCE, and I will record the official Goolge documentation on how to generate a key for the instance to use. The -C comment here will use the name of the logged-in user, and the -t will use rsa.