Subject: Apple UFS and FFS?
To: None <port-macppc@netbsd.org>
From: Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen <lhp+news@toft-hp.dk>
List: port-macppc
Date: 09/02/2004 12:48:54
while impatiently waiting for 2.0, I've been playing a bit. I write this 
in part to report my findings, and in part to ask some questions.

I have an iMac DV SE on which I have been running Mac OS 9 and NetBSD 
1.6 for a while. Now I've installed OS X as well.

Here's my partition map shown from netbsd-pdisk:

Partition map (with 512 byte blocks) on '/dev/disk0'
 #:                type name               length   base      ( size )
 1: Apple_partition_map Apple                  63 @ 1        
 2:      Apple_Driver43*Macintosh              54 @ 64       
 3:      Apple_Driver43*Macintosh              74 @ 118      
 4:    Apple_Driver_ATA*Macintosh              54 @ 192      
 5:    Apple_Driver_ATA*Macintosh              74 @ 246      
 6:  Apple_Driver_IOKit Macintosh             512 @ 320      
 7:       Apple_Patches Patch Partition       512 @ 832      
 8:           Apple_HFS uden navn        13126297 @ 1344      (  6.3G)
 9:     Apple_UNIX_SVR2 A/UX Root         4322904 @ 13127641  (  2.1G) 
S0 RUFS k
0
10:     Apple_UNIX_SVR2 Swap              2097152 @ 17450545  (  1.0G) 
S1  SFS K
0
11:     Apple_UNIX_SVR2 Usr file system  20971520 @ 19547697  ( 10.0G) 
s3   FS  
 
12:           Apple_HFS uden navn 5       1046528 @ 40519217  (511.0M)
13:           Apple_UFS Unreserved 1     21300850 @ 41565745  ( 10.2G) 
s3   FS  
 
14:     Apple_UNIX_SVR2 Unreserved 2     21300849 @ 62866595  ( 10.2G) 
s4   FS  
 
15:           Apple_HFS uden navn 8      35935746 @ 84167444  ( 17.1G)
16:          Apple_Free                        10 @ 120103190

Device block size=512, Number of Blocks=120103200 (57.3G)
DeviceType=0x0, DeviceId=0x0
Drivers-
1:  23 @ 64, type=0x1
2:  36 @ 118, type=0xffff
3:  21 @ 192, type=0x701
4:  34 @ 246, type=0xf8ff

The disklabel is:
# /dev/rwd0c:
type: ESDI
disk: Maxtor 6Y060L0  
label: fictitious
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 119150
total sectors: 120103200
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

10 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:   4322904  13127641     4.2BSD      0     0     0   # (Cyl. 13023*- 
17312*)
 b:   2097152  17450545       swap                      # (Cyl. 17312*- 
19392*)
 c: 120103200         0     unused      0     0         # (Cyl.    0 - 
119149)
 d:  13126297      1344        HFS                      # (Cyl.    1*- 
13023*)
 e:   1046528  40519217        HFS                      # (Cyl. 40197*- 
41235*)
 f:  21300850  41565745     4.2BSD      0     0     0   # (Cyl. 41235*- 
62367*)
 g:  20971520  19547697     4.2BSD      0     0     0   # (Cyl. 19392*- 
40197*)
 h:  21300849  62866595     4.2BSD      0     0     0   # (Cyl. 62367*- 
83499*)
 i:  35935746  84167444        HFS                      # (Cyl. 83499*- 
119149*)
 j:        10 120103190    unknown                      # (Cyl. 119149*- 
119149)

Using System Disk 2.3.1 while running booted in Mac OS 9 (not 
Classic/Blue Box) I've managed to set the boot command to boot 
hd:8,ofwboot.xcf hd:9,/netbsd

I can now boot into NetBSD by default, or hold down the option key and 
boot either Mac OS X (partition #8) or Mac OS 9 (partition #12).

I have noticed that I can mount the Apple_UFS partition in NetBSD 
without any apparent problems. Is it safe to do so? Are Apple UFS and 
FFS 100% compatible?

Could I change all the Apple_UNIX_SVR2 partitions to Apple_UFS 
partitions and still run NetBSD on them? That would make the entire 
NetBSD disk space accessible from MacOS X, which would be very 
convenient.


-Lasse