Jump to content

A Useful Discovery


Dr. J

Recommended Posts

After a long time using different programs to write .iso files to USB or CD (all of which ran into miscellaneous problems at some stage), I came across, in a seemingly unexplored part of Wikipedia, a mention of a handy little command line tool called dd. Apparently it's included in the base packages of pretty much every Linux distro out there. The syntax is such...

sudo dd if=inputfile.iso of=/dev/sd* bs=4M; sync

 

Where (just to state the obvious) 'inputfile.iso' is the name of the file (in the current directory) you wish to write, and '/dev/sd*' is the USB device, which must be unmounted (not "safely removed"), and the 'bs=' part is the sise of blocks to be processed (default is 512 bytes, which could take a while).

I just figured I'd put this out there, because it doesn't exactly seem to be advertised, and I don't know how well known it is. I've used it twice so far with nothing but success.

FOOTNOTE: This comes with the standard health warning of "Your USB drive will be wiped and re-partitioned."

Edited by Dr. J
  • Like 4
Link to comment
Share on other sites

securitybreach

I am kind of surprised that you have not used it before since that is the only way to get the Archlinux iso onto a usb stick due to syslinux being overwritten by unetbootin and others: https://wiki.archlin..._media#Using_dd

 

BTW they added a status option to the last update of dd.

 

It is a very useful tool that I have been using for many years..

  • Like 1
Link to comment
Share on other sites

I used imageUSB (running on windows 7) to write the Arch iso, which is one of those "sometimes work, sometimes won't" programs. For some reason I could never unetbootin to work (as in start up properly). I was quite happy to discover dd, as it's the last thing I need to do a complete Linux switch-over. I still have Windows, but everything is out of date by about a year, and I haven't booted into it since I installed Arch (apart from when I needed to write or extract a disc image) . I'll probably overwrite it with Slackware and use the two distros intermittently, I've been thinking about doing that for a while.

  • Like 1
Link to comment
Share on other sites

securitybreach

The reason unetbootin will not work with Archlinux (and derivatives) is that it overwrites syslinux which is required to boot Archlinux.

UNetbootin can be used on any Linux distribution or Windows to copy your iso to a USB device. However, Unetbootin overwrites syslinux.cfg, so it creates a USB device that does not boot properly. For this reason, Unetbootin is not recommended -- please use dd or one of the other methods discussed in this topic.

https://wiki.archlin...sing_UNetbootin

  • Like 1
Link to comment
Share on other sites

I usually use dcfldd - basically dd with progress updates. The last update for this utility was ~10 years ago, but it still works correctly.

Using bs=1M will make it provide more updates.

Link to comment
Share on other sites

securitybreach

I usually use dcfldd - basically dd with progress updates. The last update for this utility was ~10 years ago, but it still works correctly.

Using bs=1M will make it provide more updates.

 

The last version of dd added progress. To use it, simply add status=progress to the command after the /dev/sd* device and before sync. For instance:

 

dd bs=4M if=/path/to/linux.iso of=/dev/sdg status=progress && sync

Link to comment
Share on other sites

securitybreach

dd is also a recommended way to write an image for Debian. Unetbootin has been known to cause problems.

 

https://www.debian.o.../faq/#write-usb

Interesting. I was unaware of unetbootin affecting others distros besides Archlinux. I always thought Unetbootin was safe and that it was simply an issue with archlinux and syslinux.cfg. I wonder if debian is using syslinux as their installation media bootloader like arch does?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...