Mac下安裝樹莓派系統

Mac下安裝樹莓派系統

鏡像

官方推薦的Raspbianphp

準備SD卡

輸入圖片說明

新卡32G,更名稱爲PIwindows

SD卡格式化

格式成FAT格式
FAT32 支持小於4G如下文件
exFAT 支持大於4G文件,支持mac和windowsapp

輸入圖片說明

寫鏡像

查看磁盤狀況ssh

$ diskutil list
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.9 GB    disk3
   1:               Windows_NTFS PI                      31.9 GB    disk3s1

disk3 爲磁盤名稱工具

$ df -lh
Filesystem     Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk3s1   30Gi  2.5Mi   30Gi     1%      80     973600    0%   /Volumes/PI

卸載磁盤post

$ sudo diskutil umount /dev/disk3s1
Volume PI on disk3s1 unmounted

燒錄鏡像
使用dd命令來燒錄this

dd bs=4m if=鏡像名稱 of=磁盤名稱

bs=4m 指的是同時設置讀入/輸出的塊大小爲 4m bytes 個字節code

$ sudo dd bs=4m if=2017-09-07-raspbian-stretch-lite.img of=/dev/disk3
442+1 records in
442+1 records out
1854590976 bytes transferred in 586.177802 secs (3163871 bytes/sec)

時間還挺久,聽說改 /dev/disk3 爲 /dev/rdisk3 會更快。下次再試試提升bs值和用rdiskblog

完成燒錄後,彈出卡,將SD卡插上樹莓派 ,通電則自動啓動系統圖片

??? 那通電後怎麼連上樹莓派?
沒HDMI線!!沒鍵盤!!

SSH登陸樹莓派系統

須要工具: 網線一根

pi初始賬號密碼 : pi/raspberry 經過插卡路由器或nmap掃描,找到pi的ip地址 192.168.3.50

$ ssh pi@192.168.3.50
ssh: connect to host 192.168.3.50 port 22: Connection refused

納尼?默認沒開ssh服務?

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=196277&p=1227711&hilit=ssh#p1227711 As we know, SSH was disabled by default in Raspbian versions released after November 2016, and according official blog post

official blog post: https://www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/

If you want to enable SSH, all you need to do is to put a file called ssh in the /boot/ directory. The contents of the file don’t matter: it can contain any text you like, or even nothing at all. When the Pi boots, it looks for this file; if it finds it, it enables SSH and then deletes the file. SSH can still be turned on or off from the Raspberry Pi Configuration application or raspi-config

根據上面文章說的,在/boot/下建一個命名位ssh文件,而後啓動的時候就會默認開啓ssh服務了

$ cd /Volumes/boot/
$ touch ssh

參考

跟着上手樹莓派(一)—— 初次上手 & Mac 下刷入 Raspbian Jessie with Pixel
為Raspberry Pi 安裝Raspbian系統的詳細步驟 (Mac OS版本)
樹莓派ssh鏈接以及無線靜態ip分配

相關文章
相關標籤/搜索