Menu
Create Linux and Unix bootable USB flash drive in Linux with command line In this tutorial we will create a Linux bootable USB drive in Linux via command line with two methods, in the first method we will use the dd command, a byte by byte copying tool available on Unix-like operating systems.
Insert USB Media and Format Insert your USB flash drive and use disk utility to format it (press command space to open spotlight search and type Disk Utility). Select the flash drive, choose edit erase and format to MSDOS. Convert ISO to IMG Format Once you’ve downloaded your ISO to your machine you will want to open terminal and cd to the directory. Once you’ve done this you’ll want to run the following commands (substituting your path): hdiutil convert -format UDRW -o /path/to/target.img /path/to/source.iso Once you’ve done this you’ll want to remove the.dmg extension by running the following (replacing the path with your path) mv /path/to/target.img.dmg /path/to/target.img DD the IMG to USB Stick Next we’ll use the Unix dd command to block copy the img file to the USB. Pay attention to the size of your flash drive when doing these steps as you can cause yourself some headache if you aren’t careful. Diskutil list Note the path to your drive and proceed to unmount it from the terminal (replacing # with the disk number for your USB stick): diskutil unmountDisk /dev/disk# Next we’ll use the dd command specifying the input file (if) which is your img file, and output file (of) which is the path to your USB flash drive, and specify block size (bs). Again where # is a placeholder for the disk number of your USB stick.
Sudo dd if=/path/to/downloaded.img of=/dev/rdisk# bs=1m Finally once this process completes we can eject the flash drive diskutil eject /dev/disk# That’s it, you’re ready to go. Sample of Entire Process With Windows 10 ISO Richards-MacBook-Pro: rstaats$ cd Downloads/ Richards-MacBook-Pro:Downloads rstaats$ hdiutil convert -format UDRW -o enwindows10multipleeditionsx64dvd6846432.img enwindows10multipleeditionsx64dvd6846432.iso Reading JCCSAX64FREEN-USDV5 (AppleUDF: 0).