Hacker News new | ask | show | jobs
by skrellm 26 days ago
"Get Balena's Etcher (if you don't have it)"

You lost me there. Why are ppl still using this electron monstrosity when there are so many better alternatives? (Like dd, WIN32Imager, USBImager, DiskImager, etc.)?

I mean, Etcher is bigger than the entire NetBSD image, what the hell?

5 comments

Rawrite32 was always the standard tool included with NetBSD for writing images from Windows. It's tiny, source included, BSD licensed.

https://www.netbsd.org/~martin/rawrite32/

Thanks! I've only known the original rawrite.exe (pre-NT) and it's various forks (for NT), like

- https://sourceforge.net/projects/paud/files/tools/rawrite/

- https://sourceforge.net/projects/zoollinux/files/Utility/Raw...

- https://sourceforge.net/projects/ntrawrite/

- https://uranus.chrysocome.net/linux/rawwrite-old.htm

- ...etc.

Neither of these had a GUI though, so not recommendable to average users.

You usually don't even need dd, plain cat <iso >device is fine, or pv if you want to be fancy and want progress bars.

Less of a chance of swapping if/of and destroying something unexpected.

This is one of those things that SystemD can make more complicated. When you DD a disk image on something it rewrites the disk header, which can cause SystemD to reparse the header and do some weird stuff with the device that causes the write to fail or get corrupted. Etcher works around that problem.

That said, the more lightweight "Disk Image Creator" also gets around this problem without dragging in an entire self contained browser.

> That said, the more lightweight "Disk Image Creator" also gets around this problem without dragging in an entire self contained browser.

Exactly my point. Also that self contained browser hides a spyware (telemetry without notice and opt out), so illegal in the EU.

ddrescue always works.
What is this "systemd" you speak of? Getting in between a man-as-root and his dev nodes? Sounds most un-unixlike.
It's IBM's way of embrace-extend-extinguish'ing freedesktop
> You usually don't even need dd, plain cat <iso >device is fine

Definitely not. In fact, even dd is insufficient unless you use os specific flags to flush the disk cache, otherwise your stick might be corrupted. Read about the fdatasync syscall.

For what it's worth, probably not much, net/openbsd still has raw devices /dev/rsd1a vs /dev/sd1a(the block device) while it looks like linux made them all block devices (unless opened a special way O_DIRECT) and freebsd(as best I can tell) made all devices raw. https://docs-archive.freebsd.org/doc/11.2-RELEASE/usr/local/...

So, on openbsd, make sure you use the raw device when writing images with dd, and in my experience you want to use dd because the block size on cat is too small. dd bs=64k if=image.file of=/dev/rsd2c (c on obsd is entire disk)

Okay, so cat && sync
May not work, OS dependent. According to POSIX "sync" flushes the file system level buffer cache of opened files, and not necessarily the block device cache inside the kernel. (Eg. "sync" flushes devfs under /dev, so updates the /dev/sda directory entry, but maybe not the block cache of the (8,0) device.)

There's a good reason why the dd command exists, believe me.

FYI: https://linux.die.net/man/2/sync syscall is not the same as https://linux.die.net/man/2/fsync syscall.

ddrescue worked for me better than dd.
I like it. It’s cross platform, so you can recommend it to anyone. It prevents you from writing to system disks accidentally. It verifies the image after writing.

Who cares if it’s an electron monstrosity? It’s a portable executable, you run it once and then never again.

> It’s cross platform, so you can recommend it to anyone. It prevents you from writing to system disks accidentally. It verifies the image after writing.

USBImager likewise, cross-platform, stupid-proof, verifies write, decompresses on-the-fly, but it's multilingual too and does not collect your data like Etcher. All of that in just 300 kilobytes in a single portable executable.

https://bztsrc.gitlab.io/usbimager/

I prefer to recommend that instead to anyone.

I’ll try that next time :)

There are a few too many Linux builds, imo, that I wouldn’t feel comfortable recommending it to a newbie Linux user. It looks like on Linux that the authors are obsessed with making the smallest possible binary instead of the smallest possible binary that runs anywhere.

> It looks like on Linux that the authors are obsessed with making the smallest possible binary instead of the smallest possible binary that runs anywhere.

Yep, the site offers a download link to a binary that should work everywhere (small JS detects OS and arch). The default Linux binary even has an embedded Unifont and implements its own widgets to avoid as much dependency as possible (this version is 800k because Unifont takes a lot of space).

But if you want, there's a smallest version too in the repo (uses GTK widgets and fonts installed on the system, calls the portal for open file modal, and relies on udisks2 daemon to access the device without privilege). This latter also downloadable as .deb (Ubuntu and RaspiOS ARM too).

https://gitlab.com/bztsrc/usbimager/#usbimager

I'm not who you're replying to, but maybe alternatives need better marketing. However I'm going to check this out and if I have a good experience I'll recommend it to people I know in the future instead. Thanks.
dd and Etcher do not exactly have the same target audience.
> dd and Etcher do not exactly have the same target audience.

But the others do. They are all minimal GUI apps.

Given the topic, I'd say the target audience preference would likely be thus:

Admin/root superuser of rpi4: dd

Admin/root superuser of NetBSD, other BSDs, or linux: dd

doesn’t etcher “just work” everywhere?