Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .