$ dd bs=4m if=pi.img of=/dev/rdisk2
781+1 records in
781+1 records out
3276800000 bytes transferred in 194.134151 secs (16879050 bytes/sec)
至此,SD卡上已经刷入了 Raspbian 系统
再用diskutil unmountDisk卸载设备
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
2、配置
把SD卡插入树莓派,连上网线,因为不知道树莓派的ip,所以在网上随便找了个扫描ip的软件(Free IP Scanner),然后在一台windows电脑上扫描了局域网内的所有ip,其中端口为22的ip就是我们的树莓派了。
然后就是 ssh 登录树莓派 用户名 pi 密码 raspberry
如果执行 ssh 命令返回 connection refused, 则需要开启 sshd 服务
把SD卡拔下来,进入到根目录,新建一个名为ssh的空白文件
在树莓派执行 service sshd restart
SSH 服务启动成功
$ ssh pi@192.168.1.170
pi@192.168.1.170's password:
Linux raspberrypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Sep 11 11:16:12 2015 from c.local
NOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config'
Mac下给SD卡安装 Raspbian 系统
1、安装
系统下载地址
插入SD卡,使用
df
查看当前已经挂载的卷因为已经命名了SD卡为 Pi ,所以SD卡的分区对应的设备文件为:/dev/disk2s1
使用diskutil unmount卸载
diskutil list 确认设备 我买的是16G的卡
使用dd命令将系统镜像写入
PS /dev/disk2s1是分区,/dev/disk2是块设备,/dev/rdisk2是原始字符设备
至此,SD卡上已经刷入了 Raspbian 系统
再用diskutil unmountDisk卸载设备
2、配置
把SD卡插入树莓派,连上网线,因为不知道树莓派的ip,所以在网上随便找了个扫描ip的软件(Free IP Scanner),然后在一台windows电脑上扫描了局域网内的所有ip,其中端口为22的ip就是我们的树莓派了。
然后就是 ssh 登录树莓派 用户名
pi
密码raspberry
SSH 服务启动成功
执行
sudo raspi-config
选择第一项 Expand Filesystem 扩展 SD 卡上可用的空间,不然以后安装大软件会提示空间不足
执行
df -h
先把自带的难用的vim删掉 重新安装
删除
sudo apt-get remove vim-common
安装
sudo apt-get install vim
然后就是 linux 下 vim 的配置,不再多说。