A full-card image is the only backup that captures everything: partition table, hidden partitions, boot flags and filesystems macOS can't even read. Before a firmware update on a retro handheld or a risky change on a Raspberry Pi card, it's ten minutes that can save your whole setup.
Find the disk, unmount it, image it:
diskutil list # find the device, e.g. /dev/disk4
diskutil unmountDisk /dev/disk4
sudo dd if=/dev/rdisk4 of=~/card.img bs=4m status=progress
Restoring is the same command with if/of swapped — and
triple-check the disk number: dd to the wrong device destroys it silently. Note the
r in rdisk4 (the raw device — several times faster), and that
on modern macOS dd needs Full Disk Access for the terminal.
A 128 GB card with 6 GB used still produces a 128 GB image with dd. Cloning
each partition separately (or using a tool that does) keeps images as small as the data
they contain, and lets you restore just the system partition while keeping your roms intact.
Omnimount's Clone does the same thing with a progress bar, a free-space check
before it starts, automatic unmount of every partition (including FUSE mounts, which
diskutil misses) and per-partition clone/restore. Same result, no disk-number
roulette.
Skip the terminal. Omnimount does everything on this page from the menu bar: mount, write, format, check and clone ext4 and NTFS drives — no kernel extensions, no Recovery Mode, no password prompts.
Get Omnimount — €9.99 or build it free (GPL)