Wrap security around cp or dd when flashing iso file to USB

Here you can discuss every aspect of Debian. Note: not for support requests!

Wrap security around cp or dd when flashing iso file to USB

Postby sudodus » 2015-03-16 10:19

The recommendation to use cp to 'Prepare a USB stick using a hybrid CD or DVD image' is very short, elegant and efficient.
The CD or DVD image you choose should be written directly to the USB stick, overwriting its current contents. For example, when using an existing GNU/Linux system, the CD or DVD image file can be written to a USB stick as follows, after having made sure that the stick is unmounted:
Code: Select all
# cp debian.iso /dev/sdX
# sync

But it is easy to write to another device, for example a drive with valuable data. A simple typing error or mistake when identifying and selecting the target device is enough to create big problems.

I made the shellscript mkusb to wrap security around dd for this purpose. It is a GUI application, which uses zenity. It works smoothly in Wheezy, while it needs the normal user to be added in the sudo group to work in Jessie. There is a command line version, mkusb-nox, which works smoothly also in Jessie, when running as root, and it does the same job without the eye candy of zenity.
Code: Select all
# mkusb-nox debian.iso

These shellscripts are available for Ubuntu via PPAs, and for other linux distros via the following link

https://help.ubuntu.com/community/mkusb/v9#from_phillw.net

mkusb and mkusb-nox are FOSS, and I would be happy, if they can help also you, users of Debian, to flash your iso files into USB sticks in a safe way.
sudodus
 
Posts: 1
Joined: 2015-03-16 08:49

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable