刚从linux阵营转过来,平常用fedora和rhel比较多,OSX也是类UNIX系统,所以命令都差不多
1、先df -h看一下插入的磁盘:
yulongjundeMacBook-Pro:~ yulongjun$ df -h
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk1 233Gi 82Gi 150Gi 36% 21587595 39391219 35% /
devfs 187Ki 187Ki 0Bi 100% 649 0 100% /dev
map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net
map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home
localhost:/_cRizs-JgB-oG6YegLSAQX 233Gi 233Gi 0Bi 100% 0 0 100% /Volumes/MobileBackups
/dev/disk3s1 466Gi 124Gi 342Gi 27% 1013052 2802324 27% /Volumes/yulongjun-7
/dev/disk2s2 7.0Gi 29Mi 6.9Gi 1% 7412 1814712 0% /Volumes/Kingston
/dev/disk1是系统的ssd盘,/dev/disk3 是我的500G移动硬盘(我的所有光盘镜像存在这里面的iso_image下了),/dev/disk2是8G U盘
2、umount掉/dev/disk2s2
yulongjundeMacBook-Pro:~ yulongjun$ sudo umount /dev/disk2s2
Password:
umount(/Volumes/Kingston): Resource busy -- try 'diskutil unmount'
yulongjundeMacBook-Pro:~ yulongjun$ sudo diskutil umount /dev/disk2s2
Volume Kingston on disk2s2 unmounted
开始用umount命令说资源忙,提示用diskutil umount
3、dd写入
yulongjundeMacBook-Pro:~ yulongjun$ sudo dd if=/Volumes/yulongjun-7/iso_image/Fedora-Live-Workstation-x86_64-21-5.iso of=/dev/disk2
这里if=iso镜像的文件路径,of=磁盘设备路径
4、写入过程中可以用iostat命令查看磁盘写入状态
yulongjundeMacBook-Pro:~ yulongjun$ iostat -w 2
disk0 disk2 disk3 cpu load average
KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us sy id 1m 5m 15m
37.69 5 0.18 4.36 1 0.01 336.10 0 0.02 6 3 91 1.04 1.86 1.81
0.00 0 0.00 4.00 583 2.28 0.00 0 0.00 10 7 83 1.04 1.85 1.81
0.00 0 0.00 4.00 340 1.33 512.00 3 1.50 12 6 81 1.04 1.85 1.81
12.50 18 0.22 4.00 579 2.26 439.43 3 1.50 2 5 94 1.03 1.83 1.80
13.05 21 0.27 4.00 342 1.34 0.00 0 0.00 8 15 77 1.03 1.83 1.80
13.33 1 0.02 4.00 565 2.21 512.00 3 1.50 3 6 91 1.03 1.83 1.80
0.00 0 0.00 4.00 335 1.31 0.00 0 0.00 1 2 97 1.03 1.82 1.80
0.00 0 0.00 4.00 571 2.23 512.00 3 1.50 1 4 95 1.03 1.82 1.80