Create a Linux live USB on Mac

How to create a live USB stick with your favorite distro,  on a Mac, and for a Mac ? Creating a live USB stick may come handy if you don’t have an available CD to burn or if your laptop is just not equipped with a CD player. It’s also a fast and easy way to test several distros without sacrificing a CD each time.

Will see how to create an live USB stick that will boot on a Mac. It slightly differs from the classic method in that you’ll have to change the ISO extension in the process.

term_dmg

1. First step : make a DMG of your ISO

Open a terminal prompt and enter:

hdiutil convert -format UDRW -o /path/target_dmg.dmg /path/original_iso.iso

2. Identify the USB device node

Plug the USB stick and find its mountpoint through the diskutil command:

diskutil list
/dev/disk0
   #:                       TYPE NAME              SIZE       IDENTIFIER
   0:      GUID_partition_scheme                  *500.1 GB   disk0
   1:                  Apple_HFS Macintosh HD      499.8 GB   disk0s1
/dev/disk1
   #:                       TYPE NAME              SIZE       IDENTIFIER
   0:     Apple_partition_scheme                  *16.1 GB    disk1
   1:        Apple_partition_map                   4.1 KB     disk1s1
   2:                  Apple_HFS                   426.0 KB   disk1s2

3. Unmount the device

Unmount the partition so that you will be allowed to overwrite the disk:

diskutil unmountDisc /dev/disk1

You are now ready to clone the .dmg file to the USB stick. Be aware that this method will entirely wipe out the device content. You’d better not misread its mountpoint. One last word of advice:

Warning: As with any command of this type, you should be very cautious when using it; it can destroy data. Remember the order of input file (if=) and output file (of=) and do not reverse them! Always ensure that the destination drive or partition (of=) is of equal or greater size than the source (if=).

4. Copy the disk

In the terminal write the image to the USB stick with the following command:

sudo dd if=target_dmg.img of=/dev/rdisk1 bs=1m
  • You are using the raw disk device name by replacing “disk” with “rdisk”, to improve copy speed.
  • The “bs” option (block size) measures the number of bytes that are read, written, or converted at one time.

5. Eject the card

sudo diskutil eject /dev/rdisk1

Well done! You’re now ready to test any distro on your Mac : plug the device, reboot your system while pressing the Alt key.

Advertisements

Comments are closed.

Blog at WordPress.com.

Up ↑