Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i'm using dd to backup and restore sd card images but it insists on backing up the whole of the sd card including unpartitioned space. is there a way to avoid this or better process for cross platform backup/restore of sd cards?

share|improve this question

1 Answer 1

dd doesn't know anything about partitions; it just reads or writes whatever block device you point it at. If you point it at the whole-card device, it'll back up the whole card.

You could back up just the first sector from the whole-card device to get the partition table, then back up each individual partition device. This means your backup will consist of multiple files, but it'll only include partitions, not unpartitioned space.

Or you could forego dd, and use Partimage, which is a dd-like block-by-block copy but it understands filesystems and only copies blocks that are actually part of a file, so you avoid backing up "free space" within the partition too.

Or you could just mount the card and back up the files using tar or rsync or whatever.

Going back to dd, you could fill the non-partitioned areas with zeroes, and compress the backup file. The zeroed regions should compress down to practically nothing.

share|improve this answer
    
+1 for Partimage. –  user55325 Jul 20 '12 at 3:23
    
it needs to be multi-platform which limits my options and the filesystem on the sd card partitions is likely not readable by the device taking the image. thanks for the suggestions though –  Lee Tickett Jul 20 '12 at 7:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.