🔴IMPORTANT❗🔴 - Following the steps below could result in the non recoverable loss of data on a drive which is not your intent. Check, Check and Check again before hitting enter after any dd command.

A quick post on the steps I use to write raw CD image ISO files to USB thumb drives in order to take over the world, or at least boot from the IS file. The steps below will entirely overwrite existing data on the thumb drive if done correctly and will overwrite data on another drive if done wrong. Be careful and check your commands before submitting as there is no undo for dd.

Steps to Follow

  • Open a shell command window.
  • Change to the directory where the ISO file is located, or move the ISO file to the current directory.
  • Insert USB thumb drive you wish to overwrite with ISO file.
  • Identify device USB drive was detected as. I used the lsblk command, and in the output, I can see my 8G USB drive was detected as device sdg and it currently has two partitions which will be overwritten and lost.
$ lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda             8:0    0   1.8T  0 disk
├─sda1          8:1    0 109.8M  0 part
├─sda2          8:2    0     1G  0 part
└─sda3          8:3    0   1.8T  0 part
  └─sda3      254:0    0   1.8T  0 crypt
    ├─vg-usr  254:1    0    45G  0 lvm   /usr
    ├─vg-home 254:2    0 230.2G  0 lvm   /home
    ├─vg-opt  254:3    0     8G  0 lvm   /opt
    ├─vg-tmp  254:4    0     2G  0 lvm
    ├─vg-var  254:5    0  34.9G  0 lvm   /var
    ├─vg-dasd 254:6    0  1000G  0 lvm   /mnt/dasd
    ├─vg-root 254:7    0    12G  0 lvm   /
    └─vg-swap 254:8    0     2G  0 lvm   [SWAP]
sdf             8:80   1   1.8T  0 disk
└─sdf1          8:81   1   1.8T  0 part  /mnt/newdasd
sdg             8:96   1   7.5G  0 disk
├─sdg1          8:97   1   1.6G  0 part
└─sdg2          8:98   1    10M  0 part
  • Prepare the command to do the work. In the below, I am writing an ISO file called install-amd64-minimal-20210203T214504Z.iso to a thumb drive detected as /dev/sdg. To understand the command below, please read the man page for dd, as you should for any command that you do not already fully understand, even commands less likely to destroy data on disk if there is a mistake.

⚠️WARNING⚠️

Pressing <Enter> after a dd command with an incorrect target of= will destroy the data on that device. Be certain you have the correct device name identified. Beyond this point, danger awaits the unwary.


$ sudo dd if=install-amd64-minimal-20210203T214504Z.iso of=/dev/sdg bs=4M conv=fdatasync status=progress
  • Check the command for typos, particularly the device specified as the target for overwrite after the of=. When comfortable everything looks good, check again. When ready to discover your fate, press <Enter> key. Note, I issued a sync command in the below output just to make sure all the writes are committed, likely unneeded, but hurts nothing.

  • The output should look something like the following when complete.

104+1 records in
104+1 records out
437256192 bytes (437 MB, 417 MiB) copied, 95.7831 s, 4.6 MB/s
$ sync
$

That’s it for this one. The next time, I need to make a boot able USB thumb drive, hopefully I will remember to refer back to this post.