HFS+ volumes can be embedded inside an HFS (non-plus) wrapper volume. There's some explanation of this on Wikipedia and in the HFS+ specification technote. Basically all HFS+ volumes back in the Mac OS 9 through 10.3/10.4 days were of this type, and can't be cloned with partclone.
This patch-series enables support for these volumes. It reaches inside the wrapper volume, finds the real HFS+ volume, and applies an offset to all read operations and bitmap entries. It's complicated a bit by the fact that HFS wrappers aren't necessarily an even multiple of the HFS+ block size, so we have to support tiny blocks when there's a wrapper.
These patches also clean up the HFS+ code a bit:
Uses proper endian-swapping functions, instead of just unconditionally swapping, so partclone.hfsp could plausibly work on either big or little-endian systems.
Uses dynamic block sizes in place of hardcoded 4096, so partclone.hfsp could support volumes >2TB in size.
Checks that HFS+ volumes actually have the correct signature, so we don't attempt to clone volumes that wouldn't make sense.
HFS+ volumes can be embedded inside an HFS (non-plus) wrapper volume. There's some explanation of this on Wikipedia and in the HFS+ specification technote. Basically all HFS+ volumes back in the Mac OS 9 through 10.3/10.4 days were of this type, and can't be cloned with partclone.
This patch-series enables support for these volumes. It reaches inside the wrapper volume, finds the real HFS+ volume, and applies an offset to all read operations and bitmap entries. It's complicated a bit by the fact that HFS wrappers aren't necessarily an even multiple of the HFS+ block size, so we have to support tiny blocks when there's a wrapper.
These patches also clean up the HFS+ code a bit: