Looking to calculate parity between sets of data on a disk, rather than between disks. Snapraid stops this process and complains that the data is on the same device.
Is there software for this? It seems really obvious for tape archival/cold storage to have something like this.
I created a small bash script to perform this function on a BTRFS drive. In order to pull the data off the device, it requires catting the backed up data back into a tarball and extracting it, which I haven’t made a script for, but it’s fairly simple to do anyway.
#!/bin/bash
SRC=$1
DST=$2
tar -cvf - $SRC | split -dn 10 -a 1 - $DST/N
echo "parity $DST/snapraid.parity" >$DST/snapraid.conf
for NUM in {0..9}
do
btrfs subvolume create $DST/$NUM
mv $DST/N$NUM $DST/$NUM/N$NUM
echo "content $DST/$NUM/$NUM.content" >>$DST/snapraid.conf
echo "data d$NUM $DST/$NUM/" >>$DST/snapraid.conf
done
snapraid sync -c $DST/snapraid.conf
snapraid check -c $DST/snapraid.conf
I also did some tests on data reconstruction this way, and it seems pretty tanky. You can lose data in multiple files as long as the lost chunks don’t overlap, so far as I can tell.
Could potentially be used to make archives on tape that can be recovered from physical damage, provided the damage is physically smaller than the resulting chunk/parity size, but I haven’t thoroughly tested it and generally have pretty nob at what do.
Should go without saying, sudo is required for btrfs subvolume create.