zjunebao
5/30/2019 - 6:43 AM

bootable USB

Create Win bootable USB

# to find USB, e.g. /dev/disk2 
diskutil list

# format disk2
diskutil eraseDisk MS-DOS "Label" MBR disk2

# to find volume of disk2, e.g. /Volumes/Label
df -h | grep disk2

# mount iso 
open discFile.iso

# to find volume of iso, e.g. /Volumes/discFile
df -h | grep discFile

# copy
cd /Volumes/discFile
sudo cp -r . /Volumes/Label

# unmount
diskutil unmountDisk /dev/disk2
# end

Create Linux bootable USB

# format USB
Applications > Utilities > Disk Utility

# convert image
hdiutil convert -format UDRW -o dmgFile isoFile.iso

# unmount
diskutil unmountDisk /dev/disk2

# write into USB
sudo dd if=dmgFile.dmg of=/dev/rdisk2 bs=1m

# eject
diskutil eject /dev/disk2