As explained on wikipedia and Arch linux wiki "Parchive"s can be used to generate additional data for a file, that can be used in verification and even to some degree for repair/recovery of said file in case it has become partly corrupted (i.e. lets say a 4K block of a HDD becomes unreadable).

Considering the effort (both CPU and memory to store the extra redundancy repair data), is there a way use the concept of parchive as well on block devices. I would imagine

/dev/sdX having two partitins /dev/sdX1 being 90% of the storage and /dev/sdX2 containing the par2 data for related to the content of /dev/sdX1.

Considering the value that can be seen in sacrifizing some CPU and storage for increased data integrity, I would imagine there to be even a linux kernel module (e.g. related to device mapper functionality) that would offer such a feature (maybe this is partly the software raid feature?)

Lastly and a related aspect to the question. Do any common filesystems employ such a parchive mechanism to protect against data loss (i.e. to due bit rot, or other corruption of blocks)? (I know that zfs boasts some sort of protection, and ext4 is known to store multiple copies of important things like the superblock making it likely that to also feature a parchive-like feature?)


Parchive/par2 take a long time to compute parity data. E.g., I use par2 for burning files to Blu-ray, at around 10% parity data it takes on the order of an hour on a somewhat-recent machine. That scales (not sure if linearly or worse) with the amount of data and the amount of parity, so to do it for a reasonable-sized block device would take days. I'm not sure if there is a way, mathematically, to optimize changing a file, otherwise any write would take a full parity recompute.

There are alternative parity schemes normally used on block devices: both RAID5 and RAID6 are parity schemes. Most RAID systems (both software and hardware) support them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.