1. Desktop [master] hdiutil convert -format UDRW -o ./ubuntu-18.04-desktop-amd64 ./ubuntu-18.04-desktop-amd64.iso # 将ISO转为DMG
    2. 正在读取Driver Descriptor MapDDM0)…
    3. 正在读取Ubuntu 18.04 LTS amd64 Apple_ISO1)…
    4. 正在读取AppleApple_partition_map2)…
    5. 正在读取Ubuntu 18.04 LTS amd64 Apple_ISO3)…
    6. .............................................................................
    7. 正在读取EFIApple_HFS4)…
    8. .............................................................................
    9. 正在读取Ubuntu 18.04 LTS amd64 Apple_ISO5)…
    10. ..............................................................................
    11. 已耗时: 2.082s
    12. 速度:880.0M 字节/秒
    13. 节省:0.0%
    14. created: /Users/huqilin/Desktop/ubuntu-18.04-desktop-amd64.dmg
    15. Desktop [master] diskutil list # 得到 U 盘设备号
    16. /dev/disk0 (internal):
    17. #: TYPE NAME SIZE IDENTIFIER
    18. 0: GUID_partition_scheme 251.0 GB disk0
    19. 1: EFI EFI 314.6 MB disk0s1
    20. 2: Apple_APFS Container disk1 250.7 GB disk0s2
    21. /dev/disk1 (synthesized):
    22. #: TYPE NAME SIZE IDENTIFIER
    23. 0: APFS Container Scheme - +250.7 GB disk1
    24. Physical Store disk0s2
    25. 1: APFS Volume Macintosh HD 112.5 GB disk1s1
    26. 2: APFS Volume Preboot 21.1 MB disk1s2
    27. 3: APFS Volume Recovery 517.8 MB disk1s3
    28. 4: APFS Volume VM 3.2 GB disk1s4
    29. /dev/disk2 (external, physical):
    30. #: TYPE NAME SIZE IDENTIFIER
    31. 0: FDisk_partition_scheme *7.8 GB disk2
    32. 1: Apple_HFS USB8G 7.8 GB disk2s1
    33. Desktop [master] diskutil unmountDisk /dev/disk2 # 卸载 U 盘设备
    34. Unmount of all volumes on disk2 was successful
    35. Desktop [master] sudo dd if=ubuntu-18.04-desktop-amd64.dmg of=/dev/disk2 bs=1m # 创建可启动的 USB 驱动盘
    36. Password:
    37. 1832+1 records in
    38. 1832+1 records out
    39. 1921843200 bytes transferred in 207.200284 secs (9275292 bytes/sec)
    40. Desktop [master] diskutil eject /dev/disk2 # 弹出磁盘
    41. Disk /dev/disk2 ejected