I need to write a .bin file directly to a USB (as boot sector opcodes), however, I don't like using the "disk destroyer" command from the terminal.
Is there a safer way to use dd?
I need to write a .bin file directly to a USB (as boot sector opcodes), however, I don't like using the "disk destroyer" command from the terminal.
Is there a safer way to use dd?
Because dd is a terminal program you can't easily see what you're doing, so if you're not paying attention it's easy to make a mistake that overwrites the wrong partition or drive. Even the smallest of typing errors can make dd into a disk destroyer. Using a graphical front-end to dd is a safer way to use dd.
Gdiskdump is a open source graphical user interface for dd. You can easily select the input and output stream, so you can clone or image your hard drive or partition. .tar.gz and .deb files are available at the gdiskdump GitHub website.
Installation in Debian-based systems
sudo apt-get install git
git clone https://github.com/screenfreeze/gdiskdump.git
cd gdiskdump/deb/ && sudo dpkg -i *.deb # latest version is gdiskdump_0.8-1_all.deb
If your OS distribution supports it, consider using the /dev/disk/ symlinks instead of the /dev/sd* devices directly. For example, instead of:
# Was sda the right one? Or do I need to use sda1?
dd if=disk.img of=/dev/sda
You can use:
# Overwrite the partition with the label "OldStuff"
dd if=disk.img of=/dev/disk/by-partlabel/OldStuff
or
# Overwrite the first partition of my 3GB Seagate drive
dd if=disk.img of=/dev/disk/by-id/ata-ST3000DM001-1ER166_W5009B5W-part1
or
# Write to the drive plugged into USB
dd if=disk.img of=/dev/disk/by-path/pci-0000:0a:00.0-usb-0:1:1.0-scsi-0:0:0:0