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?
|
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. |
|||||
|