Creating a bootable USB stick using the dd
command is a common task for installing or running a Linux distribution from a USB drive. The dd
command is a powerful Unix utility for converting and copying files, and when used correctly, it can write an ISO image of an operating system to a USB stick, making it bootable. Here's a general outline of the steps you need to follow to use dd
to create a bootable USB stick:
First, you need to download the ISO image of the operating system you want to install. Ensure you have the ISO file saved on your system.
Before using dd
, you need to identify the USB stick's device name in your system. Be very careful during this step because selecting the wrong device could overwrite data on another disk.
- Insert the USB stick into your computer.
- Open a terminal.
- Run
lsblk
ordf -h
to list all the disks and find your USB stick. The device name is usually something like/dev/sdb
or/dev/sdc
.
If your USB stick is automatically mounted, you need to unmount it before proceeding. Replace sdX
with your actual device name:
umount /dev/sdX*
Now, use the dd
command to write the ISO file to the USB stick. Be sure to replace /path/to/your.iso
with the path to your ISO file and sdX
with your USB stick's device name. Warning: This will erase everything on the USB stick.
sudo dd bs=4M if=/path/to/your.iso of=/dev/sdX status=progress oflag=sync
bs=4M
sets the block size to 4MB for faster writing.if=
specifies the input file (your ISO image).of=
specifies the output file (your USB stick).status=progress
shows the progress.oflag=sync
ensures the write operation is completed before it's reported as finished.
After the dd
command completes, it's a good idea to safely eject the USB stick:
sudo eject /dev/sdX
- Be very careful with the device name of your USB stick. If you specify the wrong device, you could erase important data.
- The
dd
command does not show progress in the traditional way. If you've includedstatus=progress
, you will see how much data has been copied in real-time. - Depending on the size of the ISO and the speed of your USB stick, the
dd
process may take a while.
After completing these steps, your USB stick should be bootable with the OS you've chosen. You can then use it to install the OS on a computer by selecting the USB stick as the boot device in the computer's BIOS or boot menu.