ミラーサイト:http://ftp.jaist.ac.jp/pub/raspberrypi/raspbian/images/
~ $cd Downloads/ Downloads $ls 2017-04-10-raspbian-jessie.img Downloads $df Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk1 487653376 257338968 229802408 53% 1498518 4293468761 0% / devfs 367 367 0 100% 638 0 100% /dev : (略) /dev/disk2s1 30547968 4736 30543232 1% 0 0 100% /Volumes/BOOT Downloads $diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful Downloads $sudo dd if=2017-04-10-raspbian-jessie.img of=/dev/rdisk2 bs=1m Password: 4086+1 records in 4086+1 records out 4285005824 bytes transferred in 271.178348 secs (15801431 bytes/sec) Downloads $
~ $cd /Volumes/ Volumes $pwd /Volumes Volumes $ls Home Directory Macintosh HD MobileBackups RAID RAID-1 boot Volumes $cd boot boot $ls COPYING.linux bcm2708-rpi-b.dtb bootcode.bin fixup_db.dat overlays LICENCE.broadcom bcm2708-rpi-cm.dtb cmdline.txt fixup_x.dat start.elf LICENSE.oracle bcm2709-rpi-2-b.dtb config.txt issue.txt start_cd.elf bcm2708-rpi-0-w.dtb bcm2710-rpi-3-b.dtb fixup.dat kernel.img start_db.elf bcm2708-rpi-b-plus.dtb bcm2710-rpi-cm3.dtb fixup_cd.dat kernel7.img start_x.elf boot $emacs ssh boot $ls COPYING.linux bcm2708-rpi-b.dtb bootcode.bin fixup_db.dat overlays start_x.elf LICENCE.broadcom bcm2708-rpi-cm.dtb cmdline.txt fixup_x.dat ssh LICENSE.oracle bcm2709-rpi-2-b.dtb config.txt issue.txt start.elf bcm2708-rpi-0-w.dtb bcm2710-rpi-3-b.dtb fixup.dat kernel.img start_cd.elf bcm2708-rpi-b-plus.dtb bcm2710-rpi-cm3.dtb fixup_cd.dat kernel7.img start_db.elf Downloads $diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful Downloads $取り出したSDカードをRaspberry piに差し込み、LANケーブルを接続して電源をつなぎます。
~ $ssh 192.168.1.21 -l pi The authenticity of host '192.168.1.21 (192.168.1.21)' can't be established. ECDSA key fingerprint is SHA256:******************************************** Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.21' (ECDSA) to the list of known hosts. pi@192.168.1.21's password: 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: Mon Apr 10 10:09:40 2017 SSH is enabled and the default password for the 'pi' user has not been changed. This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password. pi@raspberrypi:~ $ pi@raspberrypi:~ $passwd以前に同じIPアドレスの別の装置にSSH接続したことがあるとWARNINGになることがあります。その場合には ~/.ssh/known_hostsファイルの該当行を削除してください。例はこちら。
pi@raspberrypi:~ $ sudo raspi-config Current default time zone: 'Asia/Tokyo' Local time is now: Thu Jun 22 21:15:30 JST 2017. Universal Time is now: Thu Jun 22 12:15:30 UTC 2017.パッケージの最新化は、apt-get update/upgradeで実施します。
pi@raspberrypi:~ $ sudo apt-get update : pi@raspberrypi:~ $ sudo apt-get upgrade :
WiFiを有効にするには、接続するWiFiのSSIDとパスワードが必要です。wpa_passphraseコマンドでキーを取得し、
/etc/wpa_supplicant/wpa_supplicant.confファイルにその結果を書き込んでください。
下記はSSIDがconductor-test、パスワードがconductor-passwordの例です。
pi@raspberrypi:~ $ wpa_passphrase conductor-test conductor-password network={ ssid="conductor-test" #psk="conductor-password" psk=8cf8d6d29427293c0dbe97cb076b306d8d468787d9e3336b3e94de3a45015560 } pi@raspberrypi:~ $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf pi@raspberrypi:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf country=JP ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="conductor-test" psk=8cf8d6d29427293c0dbe97cb076b306d8d468787d9e3336b3e94de3a45015560 } pi@raspberrypi:~ $設定が完了したら、sudo shutdown nowでraspberry piを終了させ、LANケーブルを抜いて、再起動(電源の抜き差し)をすれば、WiFiに接続されます。 WiFiには通常は別のIPアドレスが付与されるので、有線で接続した際と同様の方法でIPアドレスを調べてください。
~ $mkdir raspberryBackup ~ $cd raspberryBackup/ raspberryBackup $df Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk1 487653376 257179480 229961896 53% 1502547 4293464732 0% / devfs 369 369 0 100% 640 0 100% /dev : disk2s1 82644 42779 39865 52% 0 0 100% /Volumes/boot raspberryBackup $diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful raspberryBackup $sudo dd if=/dev/disk2 of=./rasberry3.dmg Password: 30564352+0 records in 30564352+0 records out 15648948224 bytes transferred in 1743.520160 secs (8975490 bytes/sec) raspberryBackup $ls -la total 30564368 drwxr-xr-x 4 **** staff 136 6 22 23:43 . drwxr-xr-x+ 52 **** staff 1768 6 22 23:34 .. -rw-r--r--@ 1 **** staff 6148 6 22 23:43 .DS_Store -rw-r--r-- 1 root staff 15648948224 6 23 00:12 rasberry3.dmg raspberryBackup $ls -l total 30564352 -rw-r--r-- 1 root staff 15648948224 6 23 00:12 rasberry3.dmg raspberryBackup $バックアップからSDカードを復元するには次のような手順になります。
raspberryBackup $df Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on /dev/disk1 487653376 257179480 229961896 53% 1502547 4293464732 0% / devfs 369 369 0 100% 640 0 100% /dev : disk2s1 82644 42779 39865 52% 0 0 100% /Volumes/boot raspberryBackup $diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful raspberryBackup $sudo dd if=./rasberry3.dmg of=/dev/rdisk2 bs=1m