Skip to content

ziman/diffcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

diffcat

SD cards (especially the cheaper ones) have frequently an okay read performance but are slow to write to. If you're restoring an image of a Raspberry Pi, for example, chances are that most blocks will be untouched since the backup.

diffcat first reads blocks from the output file to determine if they need overwriting. If they don't, it skips them.

Performance

On a ThinkPad laptop with a cheap SD card:

  • pixz -d image.xz > /dev/mmcblk0: 41 minutes
  • pixz -d image.xz | diffcat /dev/mmcblk0: 6 minutes

(The diffcat call ran on an already identical image so it performed no writes.)

Usage

$ make
$ pixz -d image.xz | diffcat /dev/mmcblk0

Debugging

  • you can #define DEBUG to get a (very verbose) description of the process
  • you can re-#define BLOCKSIZE to use non-4K blocks

About

Write images, skipping identical blocks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors