I consider the existence of Balena Etcher an Ozymandian emblem of the failures of all of modern computing.

I have a .img file. I want to write it to an SD card, plugged into my Mac.
1. I open the built-in Disk Utility and attempt to use the Restore function. This gives a cryptic error that after internet research, is because it doesn't support regular .img files. This is ridiculous and very true to Apple. Totally arbitrary limitation on functionality for a commonly used standard, because it's not their one.

Show thread

2. I open Balena Etcher to try there. It fails cryptically. Research reveals that's because of a Catalina security restriction. Fine. I update Etcher. Now it gives a sketchy non-system dialog box demanding my user password, that could be doing anything with it. Not a fucking chance. Uninstall Etcher.

Show thread

3. Hey, I use the terminal enough. Just because everyone has a dd horror story doesn't mean it's impossible to use right, right??
$ man dd
[ Massive unreadable pile of unbroken text including no usage examples or even basic guide to argument placement ] Okay, fuck the man entry then, --help is usually more concise.
$ dd -h (& dd --help)
unknown operand.

Show thread

I am at the point of having to spend multiple minutes using an internet search engine just to look up how to correctly coaxing this command that is older than me into working, without accidentally wiping anything else, just to image a disk

Show thread
@s0 can you use good 'ol dd in a terminal?
@s0 yeah, dd's command line interface is, quite literally, a joke. The whole command is completely different to how any other command works cause they copied an old ibm command as a joke and its survived and its what we have now
@s0 dd if=path/to/img of=/dev/<something> bs=1M

@steph I am literally too upset at computers to trust myself running a potentially destructive command rn.

@s0 @steph I'm glad to know I'm not the only person that has this feeling whenever having to use dd.

@steph so I calmed down and tried it and my dd just inexplicably wouldn't take a bs argument, it said illegal numeric value. I am moving to live in a hut on a glacier in Greenland. Anyone caught nearby with technology more complex than a snare will be chased off with a hatchet

@steph do people genuinely think it's okay for programs that spend many minutes, maybe hours, doing an operation, to not output any progress information. In the year 2020.
Imagine what we could achieve if computers weren't like this

@s0 @steph dd has a `status=progress` option but it's not the default cause bAcKwArDs CoMpAtIbIlItY

at least gnu dd does, bsd dd i have no clue
@lis @s0 I didn't even mention it cause BSD DD has 0 chance of having it
@steph @s0 let me guess, macos doesn't have pv either?
@x44203 this is macos, bsd dd

only GNU dd has status=progress

it's been said a few times in the thread...

@s0 @steph I think the point might be to chase folks out of the shell, and keep them inside a nerfed desktop environment.

@s0 @steph oh fuck that's right, bsd dd x.x

use bs=4000000

@null @steph lol guess what, lowercase m works :))))))))))))))))))))))))))

@s0 @steph thank the gods

what even is macos sometimes, i swear
@s0 oh my x.x

since the man didn't help you, here's basically what you want:
dd if=image.img of=/dev/disk bs=4M

the disk utility you were in earlier should tell you what dev device your sdcard is

@null oh yeah, I used the command line utility for that bit. Of course, that involved trying
$ diskutil --list
$ diskutil -list
$ diskutil list
because the modern command line is a joke

@s0 i also forget if macos has it or not, but `fdisk -l` will also show you what disks you have in your system too

remember to use sudo with both, too

@s0 idk if Apple stuff has this, but on a very good practice is to always always ALWAYS use /dev/disk/by-<something> to identify your disk. never ever /dev/sdX.
once you've identified the block device (which is either the whole disk or a partition of it) you just dd if=$input_file of=$target_block status=progress (to see how it's progressing)
(maybe play with block size too, but i trust it to figure it out on its own)

@s0 fwiw “cat” is fine for writing disk images. The crucial part (for cat or dd) is targeting the correct device name.

@s0 Dirty secret they don't tell you: In most use-cases you can just use `cat` instead of `dd`. I have successfully used cat to burn USB liveboots without issue. Save yourself the dd BS

@s0 another option (are you tired of these yet? (: ) - dcfldd, a forensics dd - which could possibly be in homebrew? (I did not check, as I no longer use osX.)

I used to use this before I learned of the status=progress option to the latest versions of dd.

dcfldd if=[image file] of=[disk device] sizeprobe=if

(which presents the progress while writing.)

also has verify, and hashing (for creating hash checksums, like when posting your image to someone else to verify that the checksum is identical - without needing to run sha256sum or similar on the output file separately.)

Is, sadly, basically the same format for the input and output type things - if and of - input file, output file - which is odd.

--help is not as obtuse, but is still for forensics, so is a bit heavy on the "do everything" side.

Sign in to participate in the conversation

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!