Skip to content

Instantly share code, notes, and snippets.

@dcuadraq
Last active April 24, 2020 21:57
Show Gist options
  • Save dcuadraq/a7dffa5780028427a6292977a433f976 to your computer and use it in GitHub Desktop.
Save dcuadraq/a7dffa5780028427a6292977a433f976 to your computer and use it in GitHub Desktop.
Extract ISO image content on USB

When attenpting to install a Linux Distro, its common to download the ISO then use a tool (e.g. UNetbootin, Linux Live USB Creator, Universal USB Installer, Live USB Creator) to make a USB bootable with the installer of the distro. This is no the recommended way.

Source

https://wiki.archlinux.org/index.php/USB_flash_installation_media

Prefered method

On OS X

To list USB devices

diskutil list

USB devices will appear as something like /dev/disk2 (external, physical), confirm the desired device by the SIZE if more than one.
Unmount device (replace X with disk number)

diskutil unmountDisk /dev/diskX

Then, to copy the content

sudo dd if=path/to/image.iso of=/dev/rdiskX bs=1m

On GNU Linux

To list USB devices

sudo fdisk -l

Identify device, then run next command, replacing sdX with device identifier.

sudo dd bs=4M if=/path/to/image.iso of=/dev/sdX status=progress oflag=sync

It's the device's identifier, no the partition (e.g. sda not sda1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment