Subject: Re: APPLE_UFS on i386?
To: Charlie Allom <charlie@rubberduck.com>
From: Darrin B. Jewell <dbj@netbsd.org>
List: current-users
Date: 03/24/2003 12:34:03
If the disk was created on OSX on macppc, then it has an apple
partition map instead of a fdisk style partition table or a
traditional NetBSD disklabel.  Unfortunately, our disklabel code
is machine dependant and so our i386 platform does not compile
in support for macintosh partition maps.

I don't know of a simple way around this without tweaking some code,
or screwing up the existing apple partition map by placing an i386
style netbsd disklabel on the disk.

If you were to get an in core disklabel working that knew where
the partition was, then you should be able to mount it using
APPLE_UFS and FFS_EI.  However, When I originally tested this
combination, it was with a drive image created on darwin/i386
and which had an fdisk style partition table, so I didn't
encounter the situation you are seeing.

It would be nice to have platform independant disklabel support, or
at least cross platform disklabel support that could easily be
reconfigured at compile time, but no one has stepped up to that
plate yet.

Good luck.  Let me know if I can provide any further information.

Darrin

Charlie Allom <charlie@rubberduck.com> writes:

> Hi Darren,
> 
> Could you give a simple intro as to how to mount a UFS partition that
> was created in OS X?
> 
> I have APPLE_UFS and FFS_EI enabled in my kernel.
> 
> I would imagine that disklabel would pick up the OS X disklabel? It
> does not:
> 
> # disklabel wd2
> # /dev/rwd2d:
> type: ESDI
> disk: WDC WD1200JB-75C
> label: fictitious
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 16
> sectors/cylinder: 1008
> cylinders: 16383
> total sectors: 234375000
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0           # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0 
> 
> 4 partitions:
> #        size    offset     fstype  [fsize bsize cpg/sgs]
>  d: 234375000         0     unused      0     0         # (Cyl.    0 -
>  232514*)
>  disklabel: boot block size 0
>  disklabel: super block size 0
> 
> 
> #
> # dmesg|grep wd2
>  wd2 at pciide2 channel 0 drive 1: <WDC WD1200JB-75CRA0>
>  wd2: drive supports 16-sector PIO transfers, LBA addressing
>  wd2: 111 GB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 234375000
>  sectors
>  wd2: 32-bit data port
>  wd2: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5
>  (Ultra/100)
>  wd2(pciide2:0:1): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66)
>  (using DMA data transfers)
>  wd2: no disk label
>  findroot: can't open dev wd2a (6)
>  wd2: no disk label
>  wd2: no disk label
>  wd2: no disk label
> 
> 
> $ grep -aE 'FFS_EI|APPLE' /netbsd | grep -a CFG
> _CFG_###> options     APPLE_UFS   # Apple UFS support in FFS
> _CFG_###> options \011FFS_EI\011\011# FFS Endian Independent support
> 
> Regards,
>   C.
> -- 
>  charlie@rubberduck.com
>  http://rubberduck.com/yeled/  - PGP Available