Mac OS X Tips
This appendix offers a couple of tips pertaining to Raspberry Pi SD card operations under Mac OS X. Figure E-1 shows an SD card reader and a built-in card slot being used.
Figure E-1. USB card reader and MacBook Pro SD slot
The one problem that gets in the way of working with Raspberry Pi images on SD cards is the automounting of partitions when the card is inserted. This, of course, can be disabled, but the desktop user will find this inconvenient. So you need a way to turn it off, when needed.
Another problem that occurs is determining the OS X device name for the card. When copying disk images, you need to be certain of the device name! Both of these problems are solved using the Mac diskutil command (found in /usr/sbin/diskutil).
Caution Copying to the wrong device on your Mac can destroy all of your files. Be afraid!
Before inserting your SD cards, do the following:
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme ∗750.2 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 749.3 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
Check the mounts:
$ mount
/dev/disk0s2 on / (hfs, NFS exported, local, journaled)
...
Insert the SD card:
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme ∗750.2 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 749.3 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme ∗3.9 GB disk1
1: Windows_FAT_32 58.7 MB disk1s1
2: Linux 3.8 GB disk1s2
Unmount any automounted partitions for disk1:
$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
$
Likewise, insert the destination SD card and use diskutil to get its device name (mine was /dev/disk2). Unmount all file systems that may have been automounted for it (diskutil unmountDisk).
At this point, you can perform a file system image copy:
$ dd if=/dev/disk1 of=/dev/disk2 bs=1024k
3724+0 records in 3724+0 records out
3904897024 bytes transferred in 2571.524357 secs (1518515 bytes/sec)
$
3.138.124.40