[hfs-user] Differences - HFS/HFS+
Tue, 2 Apr 2002 10:51:59 -0800
On Tuesday, April 2, 2002, at 06:33 AM, Entwicklung wrote:
> I'm trying to extend an HFS-volume to an HFS+ volume.
> Going by the specifications I've gathered the major differences which
> would play a role in the construction of an image.....
> 1) Difference in Allocation Block Size
> 2) Difference in basic structure of B-Tree components , MDB Vs. Volume
> Header etc. (incl. respective fields, kind of fields etc.)
> 3) Difference in NodeSize of the catalog
> 4) Thread records must be maintained even for files in HFS+
> Anything else I've left out / overlooked ?
The keys in index nodes of an HFS Plus catalog are variable sized (based
on the actual length of the string part of the key). If the keys are
longer than they need to be (i.e. you have bytes in the key beyond the
end of the string), the disk isn't technically corrupt, but it is
wasteful, and some repair utilities will complain.
If you're modifying an existing HFS Plus catalog, this leads to a
behavior that may be surprising. Deleting a file or directory can cause
the catalog B-tree to grow. If you end up deleting the first key in a
leaf node, that key needs to be replaced in its parent (an index node),
and perhaps other ancestors. If the replacement key is longer, there
might not be room in the index nodes, so they may have to split.
For mastering read-only volumes, you may not have to worry about that.
You could just build up the leaf sequence directly, and then each of the
levels of index nodes.