Snippets are tiny notes I've collected for easy reference.
Backup an SD card on Linux using 'dd'
#!/bin/bash
if [ -b "/dev/$1" ]
then
outfile="sdcard-backup-`date +"%s"`.dd"
echo "cloning /dev/$1 to $outfile"
dd if=/dev/$1 of=$outfile
echo "tgz-ing $outfile"
tar zcvf $outfile.tgz $outfile
echo "done."
else
echo "Usage: $0 /dev/<device>"
fi
echo "to restore, unmount(?), then use:"
echo "tar Ozxf <file> | dd of=<device>"
Snippets are tiny notes I've collected for easy reference.