Write an ISO to USB on Linux

Quick Linux Tip #64:

Question: How do I write an ISO to a USB stick from the command line?

Try: sudo dd if=ubuntu-24.04.iso of=/dev/sdb bs=4M status=progress conv=fsync

Info: dd writes data as raw blocks. bs=4M uses 4 MiB blocks for efficient transfers, status=progress displays live transfer progress, and conv=fsync waits for the data to be flushed before dd finishes.

Examples:

  • $ sudo dd if=/dev/zero of=/dev/sdb bs=4M status=progress  # Overwrite the target drive with zeros
  • $ sudo dd if=/dev/sda of=disk.img bs=64K status=progress  # Create a full disk image
  • $ sudo pv ubuntu.iso | sudo dd of=/dev/sdb bs=4M  # Show write progress with pv

Note: Always verify the target device with lsblk before using dd. Writing to the wrong device can overwrite existing partitions and data. After creating the bootable USB, run sync before removing it, or use sudo eject /dev/sdb when appropriate.




LinuxTeck.com
linuxteck@ubuntu:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0  500G  0 disk
├─sda1   8:1    0  512M  0 part /boot/efi
└─sda2   8:2    0 499.5G 0 part /
sdb      8:16   1   32G  0 disk

linuxteck@ubuntu:~$ sudo dd if=ubuntu-24.04.iso of=/dev/sdb bs=4M status=progress conv=fsync
5568286720 bytes (5.6 GB, 5.2 GiB) copied, 244 s, 22.8 MB/s
1328+1 records in
1328+1 records out
5568286720 bytes (5.6 GB, 5.2 GiB) copied, 244.123 s, 22.8 MB/s
linuxteck@ubuntu:~$

PREVIOUS ARTICLE Quick Linux Tip #63: Is someone trying to break into my server? NEXT ARTICLE Quick Linux Tip #65: How to View Child Processes in Linux with pstree
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.