Skip to content

在mac上制作 U盘 启动盘

1. 用hdiutil将ISO转dmg

$ hdiutil convert -format UDRW -o CentOS-7-x86_64-DVD-1804 CentOS-7-x86_64-DVD-1804.iso
Reading Master Boot Record (MBR : 0)...
Reading CentOS 7 x86_64                  (Apple_ISO : 1)...
Reading  (Type EF : 2)...
Reading CentOS 7 x86_64                  (Apple_ISO : 3)...
.........................................................................................
Elapsed Time:  2m 55.451s
Speed: 24.3Mbytes/sec
Savings: 0.0%
created: /Volumes/data/software/CentOS-7-x86_64-DVD-1804.dmg

这个时候我们就得到了一个.dmg硬盘镜像文件。

2. Unmount U盘

查看U盘,路径通常为/dev/diskN

diskutil list

Unmount U盘

$ diskutil unmountDisk /dev/disk4
Unmount of all volumes on disk4 was successful

3. 拷入镜像

$ sudo dd if=CentOS-7-x86_64-DVD-1804.dmg of=/dev/disk4 bs=1m
4262+1 records in
4262+1 records out
4469153792 bytes transferred in 2602.575198 secs (1717204 bytes/sec)

4. 最后弹出U盘

diskutil eject /dev/disk4