Skip to content

Instantly share code, notes, and snippets.

@troglobit
Last active January 20, 2024 14:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troglobit/b0da9b7fc68dfa8c0cf38cbb52e71911 to your computer and use it in GitHub Desktop.
Save troglobit/b0da9b7fc68dfa8c0cf38cbb52e71911 to your computer and use it in GitHub Desktop.
HowTo use dd to write a disk image/iso to USB on Linux

The UNIX utility dd is actually inherited from VMS, hence the opt=arg instead of --opt=arg syntax.

Here we write the input file (if) to the output file (of), using a larger block size (bs) than default (512 bytes). We'd like to see the progress of the write, this is not the default, and we want to avoid caching in the Linux VFS, so we set output flag (oflag) to direct, i.e. write-through.

sudo dd if=linuxmint-20-cinnamon-64bit.iso of=/dev/sdb bs=1M status=progress oflag=direct

Watch out, check the output file (/dev/sdb) matches your USB stick, otherwise you'll kill all the kittens!

@troglobit
Copy link
Author

troglobit commented Nov 17, 2022

Flashing sdcard.img built with Buildroot:

sudo dd if=output/images/sdcard.img of=/dev/mmcblk0 bs=1M status=progress oflag=direct

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