jdiskimage

Overview

jdiskimage is a program that solves what Charles calls the “copy on write whether you need to or not” problem. Charles wanted to keep a history of snapshots of disk images in a space efficient manner and couldn’t find a way to do it so Charles wrote jdiskimage to help and has been using it to backup his personal computers.

Example script to backup a laptop drive

#!/bin/bash -x
java -jar jdiskimage.jar \
 -i /dev/disk/by-id/ata-Samsung_SSD_REDACTED \
 -o ./x360/ata-Samsung_SSD_REDACTED.img

btrfs subvolume snapshot -r ./x360 ./snapshots/x360-$(date +%Y%m%d-%H%M)

Features

  • Initial Creation is a Sparse File, then only non-zero data takes up space
  • Reads target image and only updates blocks that need changing
  • Outputs percentage of data that changed