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.
Leave a Reply