Presenting Etcher: A better way to write SD cards.
Writing SD cards is a neglected, and very platform-specific affair, which means using “dd” on certain platforms, (and risking overwriting your hard drive) and downloading software from SourceForge on others (and risking catching spyware). None of the common writers verify that what made it to the SD card is what was intended. In general, it feels like an underappreciated problem, and was definitely the ugliest part of the resin.io provisioning experience.
Not being the kind of people to leave well enough alone, we wanted to do it better, both for resin.io, and the entire community. We wanted an removable drive writer that was:
- Cross-platform: The ideal SD card writer works the same on Windows, Linux, and OS X. No longer should tutorials have special sections for each OS.
- Open source: Self-explanatory.
- Safe by default: Some basic sanity checking goes a long way towards avoiding nuking someone’s hard drive.
- A building block: The problem shows up all over the place. People should be able to use our work to never have to think about the problem again.
- A pleasure to use: Why should writing SD cards mean working with ugly UI? And why don't SD card writers unmount the card by default?
After more than 6 months of work, it’s our pleasure to introduce Resin Etcher, which is all those things and more. Etcher v1 has been built by amazing resineer Juan Cruz Viotti, with UI designed by our resident artist, Taahir Isaacs.
The biggest challenge in having Etcher work was having a cross-platform way to write SD cards. It turns out the number of permission escalations, version discrepancies, and node.js specific limitations was staggering. We also had to make some small contributions to Electron, including a libchromium patch, to make everything work as it should.
Etcher also uses heuristics to make sure we’re not writing to your hard drive. Etcher, through its module drivelist, detects system drives, and excludes them. This is a particularly big issue on Windows, since it allows arbitrarily writing data on the system drive even it is mounted.
For the coders out there, Etcher’s architecture is also deeply modular, being composed of separate projects, many of which can be used individually. Is your project writing SD cards? The code is on github and npm and waiting to be used.
After a long journey, Etcher is ready for your use and feedback!
We’re not known for resting on our laurels, so we naturally have a lot more things we want Etcher to do.
First of all: moar speed! There is some fantastic work coming out of the Tizen project that may allow us to speed writes up significantly on Linux. We want to look deeper into it and see how we can bring the technique across platforms.
Another way we want to investigate speeding up is by streaming a download straight onto the card, meaning that the two waiting periods (downloading and writing) can actually be spent in parallel, cutting something like 10 minutes out of the process, at least when it’s the first time an image is being written.
Of course speed isn’t everything. One thing we’ve learned is that people tend to reuse SD cards, and that those SD cards can become corrupted surprisingly early, especially when they’ve been used in conjunction with a less-than-optimally powered device. To mitigate this frustration, we’re looking into is validating that the card indeed has stored the bytes we told it to store.
Finally, the scope of Etcher can be a bit broader than just SD cards, into all sorts of things you attach to a computer and want to write an image onto. The Intel Edison uses DFU to write straight onto the eMMC, and other devices like the BeagleBone also offer this as an option. There is no real reason why Etcher can’t write to these devices as well.
If you want to help move Etcher forward on these ideas, or other ones you have in mind, submit issues, fork the source, and send us pull requests!
What are you waiting for? Download Etcher and burn you some SD cards!