Subject: Re: Partitions and superblocks
To: Bob Nestor <rnestor@metronet.com>
From: Stephen C. Brown <sbrown@shellx.best.com>
List: port-mac68k
Date: 03/03/1997 19:54:36
>>> 2. Go back to the Finder. Drag any MacOS partitions you may have created to
>>> the Trash to unmount them.
>>
>>Actually, the above is unnecessary, at least in my experience.  It's just
>>a little disturbing to have them still available as Mac volumes when
>>you've just converted them to NetBSD volumes.  I'm fairly sure they're
>>unmounted upon NetBSD boot, so they should be fine when they come up there.
>>I also don't remember having any trouble installing onto them after
>>having run Mkfs on them.
>
>Mkfs should really do this before changing the partition and it should
>also make sure that there aren't any open files on the MacOS volume when
>it trashes it.  Unfortunately I'm not much of a MacOS programmer and
>didn't know how to do this at the time.  If someone has some pointers or
>code snippets that will show me how to do this I'd be happy to add this
>to mkfs.

As far as unmounting the disk, you can just use the UnmountVol() routine.
A quick look at the references(i.e. "Obiwan") shows the syntax as:

OSErr=UnmountVol(volName_StringPtr,vRefNum_integer);

I just double-checked IM and it says UnmountVol() calls FlushVol,
closes all open files, and releases the in-memory structures.
That should be just what you need.

Stephen Brown,
sbrown@best.com

p.s.  I have used UnmountVol() before in a homegrown install utility
        that I wrote back in my university days.  Basically it was
        doing UnmountVol() and a DiskEject() to do the auto-floppy
        swap shuffle ;-).....

>
>thanks,
>-bob