1.mac 磁盘工具 抹掉sd卡 为fat
2. df -h 看清sd卡号
3. 卸载sd卡
diskutil unmount /dev/disk2s2
Volume UNTITLED on disk2s2 unmounted
4.列出sd卡分区
diskutil list
/dev/disk0 (internal):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme 500.3 GB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 500.0 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +500.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 281.1 GB disk1s1
2: APFS Volume Preboot 21.9 MB disk1s2
3: APFS Volume Recovery 519.9 MB disk1s3
4: APFS Volume VM 3.2 GB disk1s4
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *15.7 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Microsoft Basic Data UNTITLED 15.5 GB disk2s2
//来源:https://www.cnblogs.com/zhaocundang/p/7784872.html
5. 烧录
➜ Desktop sudo dd bs=4m if=2017-09-07-raspbian-stretch.img of=/dev/disk2
Password:
1172+1 records in
1172+1 records out
4916019200 bytes transferred in 1004.623877 secs (4893393 bytes/sec)
6.卸载sd卡
➜ Desktop diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
//其它命令
输入diskutil显示出diskutier的命令
diskutier list 列出磁盘分区
擦除要删除的磁盘分区disk0s4
diskutil eraseVolume HFS+ Blank /dev/disk0s4
合并磁盘分区 把disk0s4合并到disk0s2
diskutil mergePartitions JHFS+ 我的全部 disk0s2 disk0s4
合并失败看看disk0s2是否是逻辑分区
查看逻辑分区的ID
diskutil corestorage list
把逻辑分区改成普通分区
diskutil corestorage revert 523A1310-A007-489B-8AEF-656446D6C1AF
这个命令也是把逻辑分区改成普通分区 不知两者有什么不同
diskutil cs revert 523A1310-A007-489B-8AEF-656446D6C1AF
输入命令后重启,在进行合并命令操作就可以了
注意:烧录完成,需要在boot分区 touch .ssh