This topic has been beat to death... do some searches...
... but, this next part is new, I think. Its a neat little unix trick that can be used to backup CD images too, thumb drives of all kinds, and the cool thing is it maintains all of the right permissions and only backs up the content, because its not a 'disk image' like dd produces ! So, here it is, I'll explain it after:
First, you need to mount the SD card in your gnu+linux notebook (or what-have-you) so that you have something like /mnt/SD-card where SD-card is the root partition that you are trying to backup. I'm assuming that you know enough about gnu+linux to get that accomplished ...
Now for the trick:
Code: Select all
tar -cvf - -C /mnt SD-card | tar -xvf -
Please pay attention to ALL of the spaces and hypens above... they are not typos and they are ALL important.
This is what it does... it creates a tape archive stream via stdin and stdout (that's the hyphens). The -C changes to the mount directory and what is being backed up is just the SD-card root partition that is mounted there !
This little trick will place an SD-card directory in ~/backup-directory/ and will maintain recursively all subdirectories and permissions.
It does this so well that if you use the trick to backup a CD rom to your hard drive, you can actually mount that directory as a loopback device and access it the same way you would access the CD itself!
To restore the backup just reverse the process. Obviously its only going to backup the content, not the empty space.