[hfs-user] HFS-Plus and Wrappers

Mark Day mday@apple.com
Thu, 2 May 2002 08:49:27 -0700


On Thursday, May 2, 2002, at 12:13 AM, Entwicklung wrote:

> Regarding 'bad blocks' - I haven't really marked any 'bad blocks' until 
> now and am not too sure I know how it is done... will have to read up 
> on that.

You create one or more records in the Extents Overflow B-tree for file 
ID 5 (kHFSBadBlockFileID), fork 0 (i.e. the data fork).  Since there is 
no entry for the bad blocks "file" in either the MDB or catalog, the 
first record would have its startBlock set to 0 (i.e. offset of 0 blocks 
into the "file").  If you need other discontiguous bad block extents, 
you would create additional records.

> Any idea what happens if I don't mark the blocks of the embedded volume 
> as 'bad blocks' but just mark them as allocated in the allocation 
> bitmap of the HFS-Wrapper ?
> Could this be a potential cause of any problems ?

It might confuse older disk repair utilities that only see the wrapper, 
or are trying to repair the wrapper as a plain HFS volume.  For 
read-only media, it probably isn't a serious problem.  For writable 
media, you would run the risk of having such a utility "repair" the 
bitmap by unsetting the bits for the embedded volume, and potentially 
overwriting part of the embedded volume when writing to the wrapper.

-Mark