by Devin Yang

建立于: 7年前 ( 更新: 7年前 )

前言

这篇文章,分享使用MacOS上的内建命令,进行Raspberry Pi的作业系统安装。
在这个安装过程中关於dd命令,请小心指定您of的参数,即是write output到文件的位置,
指定错了,会毁掉自己的系统哦

步骤

到官网下载官方的作业系统,本文我使用RASPBIAN。
https://www.raspberrypi.org/downloads/


一、首先透过USB读卡机,将Micro Sd卡接上Mac,再用命令查看挂载。
diskutil list
可以看见,在我的例子中,我的Micro Sd卡是在/dev/disk3。



二、 解除挂载命令如下:disk[n]的磁盘编号请依您自己的实际情况调整
diskutil unmountDisk /dev/disk3

成功unmount后,应可以看到文本如下,我成功解除disk3上挂载的所有卷宗。
Unmount of all volumes on disk3 was successful

三、接下来就可以用dd命令,将下载下来的img档,写到sd卡上罗。
将image写到rdisk3,使用rdisk3的速度会较快,如果您使用rdisk[n],失败了,可改用disk[n],这里的[n]磁盘的编号。
关於磁盘编号(disk[n])请勿照抄,请确实了解,您自己要写sd卡的编号是多少,例如/dev/disk4
sudo dd bs=1m if=2018-03-13-raspbian-stretch.img of=/dev/rdisk3 conv=sync

这里补充一下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.

关於 dd 命令的使用说明,我们可在终端机打 man dd 查看,按 q 可以离开。
Linux 的世界,以 Linux 系统管理者来说,dd命令应该是一个好用基本必学的命令哦。
如果以英文单字的记忆打比方,那么dd命令,肯定是一个值得记忆的单字,不会是那种一辈子可能看不到一次的冷门不需记忆单字。

这里列出,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.
结果如下:


完成后,就可以取出micro sd卡,装到Raspberry Pi上开开看罗。
desktop

 

Tags: linux

Devin Yang

文章内容无法一一说明,如果您有什么不了解处,欢印提问哦:)

No Comment

Post your comment

需要登入才可留言!

类似文章


linux,raspberry

树莓派安装VNC Server

检单介绍如何在树莓派上启动VNC Server

linux,security

ssh-agent及ssh-add认证代理员

在ssh的核心包中的进程诸如,scp、ssh、ssh-add、ssh-agent、sshd及ssh-keygen 让我们来谈谈ssh-agent及ssh-add使用情境吧。 在开始前先来看看这些命令用途的简介:

linux, mac, terminal, tips

再Linux或Mac的终端机如何清除目前的命令行的输入?

再Linux或Mac的终端机如何清除目前的命令行? 例如打错了一堆命令,打错了想清除从打, 千万要跟我以前一样,用倒退键慢慢杀了,我们可以用......