I’ve been playing around with RPIs lately, and I’ve found it handy to take snapshots of my Micro SD card as I’m messing around, so that I’ve got backups when something inevitable goes wrong.
First, you need to find the device (the Micro SD card). To my understanding it’s always something like
/dev/mmcblk0p1. For me it happens to be the latter.
My external drive hooked to the PI with a USB 3 cable occupies the name
You can do an
ls on the
/dev (device) directory:
$ ls -l /dev
Then, check which drives are actually mounted currently:
$ df -h
You should see something like
Then make the image with
$ sudo dd bs=4M if=/dev/mmcblk0p1
It’s smart to pipe that right into into gzip to save a bit of time:
$ sudo dd bs=4M if=/dev/mmcblk0p1 | gzip > raspbian.img.gz
Comments would go here, but the commenting system isn’t ready yet, sorry.