[hfs-user] HFS-Plus and Wrappers

Patrick Dirks pwd@apple.com
Thu, 2 May 2002 00:29:57 -0700


--Apple-Mail-1--932275202
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=ISO-8859-1;
	format=flowed

Only if you let some Disk Utility loose on it and it figures out those =
blocks aren't supposed to be marked in use because they're not claimed =
by any file...

Why don't you look at a freshly initialized HFS+ volume to see what all =
this is supposed to look like.  See if you can account for every bit set =
on the volume - should be an interesting exercise!

-Pat.

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

> Thanks for the reply !
> 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. Any idea what happens if I don't mark the blocks of the =
embedded volume as 'bad blocks' but just mark=A0them as allocated in the =
allocation bitmap of the HFS-Wrapper ?
> Could this be a potential cause of any problems ?
> =A0
> TIA,
> Nandini=A0
> =A0
> =A0
> ***Every day is a new beginning..a brand new start, to bring joy and =
fulfilment to the sad and weary heart***
>
> ----- Original Message -----
> From: Patrick Dirks
> To: Entwicklung
> Cc: darwin-development@lists.apple.com ; studentdev@lists.apple.com ; =
hfs-user@lists.mars.org
> Sent: Thursday, May 02, 2002 9:13 AM
> Subject: Re: [hfs-user] HFS-Plus and Wrappers
>
> 1. You'll probably need at least 3: the ReadMe (or whatever file you =
like to have shown) and the Desktop DB and Desktop DF. The latter two =
are there to make the Finder happy; if they're not present the Finder =
will try to create them and will end up creating them somewhere in the =
bowels of whatever system happens to be running because they can't be =
created on the read-only disk. The wrapper also has no space available, =
typically. Altogether much better to have a skeleton Desktop DB and =
Desktop DF there. You can copy them from any freshly initialized HFS =
floppy: the Desktop DB will have a few blocks of valid data in a small =
file, the Desktop DF file should be zero length in all likelihood.
>
> I'm not entirely sure why the System and Finder files are there; they =
might be there to placate simple-minded software that checks for them =
when deciding whether the volume is potentially bootable. If your =
wrapped HFS+ volume is unbootable anyway, I bet you can get away without =
them.
>
> 2. Yes, there are two completely unrelated sets of Desktop DB and =
Desktop DF files. The ones in the wrapper are ordinarily ignored because =
it's the "wrapped" HFS+ volume that's actually mounted. The ones in the =
wrapper can be empty - their content is largely irrelevant.
>
> 3. The ReadMe file is stored as an ordinary file on a plain HFS =
volume. Nothing special (that's the whole point - it's there for the =
consumption of systems that only know about HFS).
>
> 4. You can not only write anything you like in the ReadMe file, you =
can call the file anything you want, have anything else you want besides =
(wanna throw in a QuickTime movie of yourself? No problem!). It's =
strictly cosmetic, solely for the benefit of the poor human who suddenly =
can't find the hard drive's contents on this system.
>
> The most interesting part of the wrapper volume is the pointer to the =
HFS+ volume embedded. I believe the blocks used by the HFS+ volume are =
usually specified as used up by the "Bad block" file on the wrapper =
volume, so the wrapper volume looks like a large volume with a few =
files, no free space, and a ton of bad blocks.
>
> Hope that helps,
> -Pat Dirks.
>
> On Wednesday, May 1, 2002, at 11:46 PM, Entwicklung wrote:
>
> Hello Listers,
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Recently there =
was a bit of discussion on HFS-Wrappers on the hfs-user mailing list and =
how it allows a computer with HFS (but no HFS Plus support) to start up =
or display a ReadMe to the user to improve the user-experience.
> The tech. notes (TN 1150: HFS Plus Volume Format) says that the HFS =
wrapper volume contains five files in the root folder - a ReadMe, System =
and Finder, Desktop DB and Desktop DF.
> =A0
> I'm a third-party developer creating an HFS-Plus volume (non-bootable) =
interested in extending the functionality of my HFS-Plus volume to =
include a Wrapper as well. I want to know whether:
> =A0
> 1)=A0these 5 files=A0are actually necessary or it would suffice if =
only the ReadMe is present ?
> 2) would this mean that the Desktop DB and DF files would be present =
twice (on an Apple-initialized volume) ? - once in the HFS-Wrapper and =
once in the HFS-Plus catalog ?
> 3) is there any documentation from Apple which describes how this =
ReadMe file is stored up in the Wrapper's catalog (I gathered it's not =
hidden) in order to function as expected ?... reverse-engineering
> can be painful sometimes..
> 4) are the contents of the ReadMe file fixed or could I write anything =
I want into it ?
> =A0
> Would be glad of any tips/suggestions !
> -Nandini
> =A0
> =A0
> ***Every day is a new beginning..a brand new start, to bring joy and =
fulfilment to the sad and weary heart***
>

--Apple-Mail-1--932275202
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=ISO-8859-1

Only if you let some Disk Utility loose on it and it figures out those
blocks aren't supposed to be marked in use because they're not claimed
by any file...


Why don't you look at a freshly initialized HFS+ volume to see what
all this is supposed to look like.  See if you can account for every
bit set on the volume - should be an interesting exercise!


-Pat.


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


<excerpt><fontfamily><param>Arial</param><smaller>Thanks for the reply =
!</smaller></fontfamily>

<fontfamily><param>Arial</param><smaller>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. Any idea what
happens if I don't mark the blocks of the embedded volume as 'bad
blocks' but just mark=A0them as allocated in the allocation bitmap of
the HFS-Wrapper ?</smaller></fontfamily>

<fontfamily><param>Arial</param><smaller>Could this be a potential
cause of any problems ?</smaller></fontfamily>

=A0

<fontfamily><param>Arial</param><smaller>TIA,</smaller></fontfamily>

<fontfamily><param>Arial</param><smaller>Nandini=A0</smaller></fontfamily>=


=A0

=A0

<fontfamily><param>Arial</param><smaller>***Every day is a new
beginning..a brand new start, to bring joy and fulfilment to the sad
and weary heart***

</smaller></fontfamily>

----- Original Message -----

<bold>From:</bold>
<underline><color><param>1999,1999,FFFF</param>Patrick =
Dirks</color></underline>

<bold>To:</bold>
=
<underline><color><param>1999,1999,FFFF</param>Entwicklung</color></underl=
ine>

<bold>Cc:</bold>
=
<underline><color><param>1999,1999,FFFF</param>darwin-development@lists.ap=
ple.com</color></underline>
; =
<underline><color><param>1999,1999,FFFF</param>studentdev@lists.apple.com<=
/color></underline>
; =
<underline><color><param>1999,1999,FFFF</param>hfs-user@lists.mars.org</co=
lor></underline>

<bold>Sent:</bold> Thursday, May 02, 2002 9:13 AM

<bold>Subject:</bold> Re: [hfs-user] HFS-Plus and Wrappers


1. You'll probably need at least 3: the ReadMe (or whatever file you
like to have shown) and the Desktop DB and Desktop DF. The latter two
are there to make the Finder happy; if they're not present the Finder
will try to create them and will end up creating them somewhere in the
bowels of whatever system happens to be running because they can't be
created on the read-only disk. The wrapper also has no space
available, typically. Altogether much better to have a skeleton
Desktop DB and Desktop DF there. You can copy them from any freshly
initialized HFS floppy: the Desktop DB will have a few blocks of valid
data in a small file, the Desktop DF file should be zero length in all
likelihood.


I'm not entirely sure why the System and Finder files are there; they
might be there to placate simple-minded software that checks for them
when deciding whether the volume is potentially bootable. If your
wrapped HFS+ volume is unbootable anyway, I bet you can get away
without them.


2. Yes, there are two completely unrelated sets of Desktop DB and
Desktop DF files. The ones in the wrapper are ordinarily ignored
because it's the "wrapped" HFS+ volume that's actually mounted. The
ones in the wrapper can be empty - their content is largely irrelevant.


3. The ReadMe file is stored as an ordinary file on a plain HFS
volume. Nothing special (that's the whole point - it's there for the
consumption of systems that only know about HFS).


4. You can not only write anything you like in the ReadMe file, you
can call the file anything you want, have anything else you want
besides (wanna throw in a QuickTime movie of yourself? No problem!).
It's strictly cosmetic, solely for the benefit of the poor human who
suddenly can't find the hard drive's contents on this system.


The most interesting part of the wrapper volume is the pointer to the
HFS+ volume embedded. I believe the blocks used by the HFS+ volume are
usually specified as used up by the "Bad block" file on the wrapper
volume, so the wrapper volume looks like a large volume with a few
files, no free space, and a ton of bad blocks.


Hope that helps,

-Pat Dirks.


On Wednesday, May 1, 2002, at 11:46 PM, Entwicklung wrote:


Hello Listers,

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Recently there =
was a bit of discussion on
HFS-Wrappers on the hfs-user mailing list and how it allows a computer
with HFS (but no HFS Plus support) to start up or display a ReadMe to
the user to improve the user-experience.

The tech. notes (TN 1150: HFS Plus Volume Format) says that the HFS
wrapper volume contains five files in the root folder - a ReadMe,
System and Finder, Desktop DB and Desktop DF.

=A0

I'm a third-party developer creating an HFS-Plus volume (non-bootable)
interested in extending the functionality of my HFS-Plus volume to
include a Wrapper as well. I want to know whether:

=A0

1)=A0these 5 files=A0are actually necessary or it would suffice if only
the ReadMe is present ?

2) would this mean that the Desktop DB and DF files would be present
twice (on an Apple-initialized volume) ? - once in the HFS-Wrapper and
once in the HFS-Plus catalog ?

3) is there any documentation from Apple which describes how this
ReadMe file is stored up in the Wrapper's catalog (I gathered it's not
hidden) in order to function as expected ?... reverse-engineering

can be painful sometimes..

4) are the contents of the ReadMe file fixed or could I write anything
I want into it ?

=A0

Would be glad of any tips/suggestions !

-Nandini

=A0

=A0

***Every day is a new beginning..a brand new start, to bring joy and
fulfilment to the sad and weary heart***


</excerpt>=

--Apple-Mail-1--932275202--