How to save an image from an sd card and write it to another via command line as admin

to dd and save your image to a usb stick for instance and write another copy…
you must be root user for this process… sda is the device you want to copy this being your system image…
.you may need to take your system image to another machine using linux depending on how your system drive is reported in the fstab and the dev directory… if your trying to copy on the fly straight from the image you have running the system

the media must match memory size exactly card per card…

mkdir images from root dir on your usb sick or media for to be stored onto…r…code belowits coded below to save on /images/ and on sdb device…
dd if=/dev/sda bs=4M conv=fsync status=progress of=/dev/sdb/images/bulleseye.img

to flash image back to sd card via card reader of choice using usb stick storage and sd card reader with matching sd-card inserted …assuming the usb stick is sdb and the writer is sdc…

if=/dev/sdb/images/bulleseye.img of=/dev/sdc bs=4M conv=fsync status=progress

because you are imaging the complete sd-card…
the easiest way to find what drive is what is by using a tool like gparted for instance.
**.to allocate the correct drive lettering…**one drive will show data the other will not because it is still blank…

8 Likes

Nice writeup Brian :slight_smile:

I’m always most in my element on windows, so I’ve always gone for Win32Disk Imager. Then I use the Raspberry Pi IMager (or Balena Etcher, or whatever you prefer) to write the image.

2 Likes