Subject: Re: Sharing drives between NetBSD and MacOS
To: None <port-macppc@netbsd.org>
From: John Valdes <valdes@uchicago.edu>
List: port-macppc
Date: 01/18/2001 18:56:51
On Wed, Jan 17, 2001 at 09:32:41PM -0800, William O Ferry wrote:
> 
> > >   So to share a drive between NetBSD and MacOS [...]
> 
> 	A word of warning, however.  I later found that Mac OS X seems
> to really dislike this setup.  I installed the public beta and the
> first boot of my install took a VERY long time.  I later learned it
> had found the NetBSD partition and decided to fsck it.  It took so
> long because it was converting all of the directory something-or-others
> (I don't recall) from 512 to 1024.  Needless to say when I tried to
> boot NetBSD the next time it thought the filesystem was blank.  Many,
> many GB of data lost..  =(

Hmm, this wasn't my experience (though admittedly I've only had my
system up w/ both MacOS X & NetBSD for a day so far :) ).  I have
MacOS X public beta and NetBSD installed on the same disk and have
booted between the two w/o any filesystem problems.  If I boot MacOS X
while holding down the "v" key (so I can see the good ol' kernel &
daemon boot messages), I can see that MacOS X tries to fsck/mount my
NetBSD partition, but it doesn't seem to recognize its filesystem type
and gives up.  Perhaps this is due to the round-about way I created my
NetBSD partition?

Specifically, here's the procedure I used (this was as part of my
first attempt to setup a quad-boot system on a single hard drive; it
seems to work, but most certainly isn't the best way to do it):

1) Starting with a clean drive, I used Apple Drive Setup (2.0.1) to
   partition my drive, creating 2 HFS partitions, 2 HFS+ partitions, a
   Apple_UNIX_SVR2 A/UX root and an Apple_UNIX_SVR2 A/UX swap
   partition.

2) I installed MacOS 9 and MacOS X public beta each into its own HFS+
   partition, and LinuxPPC into the A/UX root partition.  One of the
   HFS partitions serves as a boot partition, and the other was to
   temporarily hold a copy of the LinuxPPC Q4 distribution for
   installation, since I didn't have a copy of the CD.

3) After installing LinuxPPC, I changed the partition type of the 2nd
   HFS partition holding the Linux distro to Apple_UNIX_SVR2 using
   perldisk under Linux.

4) I then tried installing NetBSD 1.5 in the HFS converted to
   Apple_UNIX_SVR2 partition, but NetBSD didn't recognized it as a
   UNIX partition, so under MacOS, I used Bob Nestor's modified pdisk
   (ftp://murphy.dyndns.org/pub/map/pdisk.sea.hqx) to rename the UNIX
   partition so that the proper NetBSD flags would be set on the
   partition.

5) I then tried reinstalling NetBSD again.  This time, it recognized
   the partition, but sysinst insisted on repartitioning the whole
   drive, so I quit from sysinst (w/o partitioning or installing
   anything) and manually newfs'ed the UNIX partition.  I used newfs
   w/o *any* options (in particular, I didn't use "-O"), just the raw
   partition name ("newfs /dev/rwd0h").  I then fsck'ed and mounted
   the partition, untar'ed the filesets, etc...

Having done this, I've booted between NetBSD (well, not completely
yet; the GENERIC kernel is panicking at the moment when it apparently
tries to mount the root filesystem; I can mount the filesystem using
the INSTALL kernel w/o any problems, however) and MacOS X PB (and
Linux and MacOS 9) a few times w/o seeing any filesystem corruption.

Perhaps creating the NetBSD filesystem using newfs w/o the "-O" flag
(so it creates a 4.4BSD ffs, correct?) prevents MacOS X from
recognizing it?  What newfs options does sysinst use when it creates
the root filesystem?  (Perhaps too this is why the kernel panics when
it tries to mount it?  I know the NetBSD/m68k root has to be 4.3BSD
ffs (ie, "newfs -O"), but this is because the MacOS Booter can't read
4.4BSD ffs and not a kernel limitation, correct?)  Is OS X's UFS
identical to the 4.4BSD ffs, or is it the 4.3BSD ffs or its own
variant?

John