Hi.

I recently made some space on my old iBook G4 (1.2 GHz, late 2004 model)
to put a few extra partitions, for a Linux, an OpenBSD 4.9, and a shared
data partition using FAT32.

During the installation process, I briefly struggled with the disklabel
tool before realizing that my problems came from the fact that it gave
me an incorrect automatic layout to begin with: the root partition was
starting one sector *ahead* of the OpenBSD partition itself. I fixed the
layout manually, but the "boundstart" displayed by disklabel is still
incorrect on my running system, as you can see from those outputs of
pdisk and disklabel respectively:


# pdisk wd0
Edit wd0 -
Command (? for help): p

Partition map (with 512 byte blocks) on 'wd0'
 #:                type name        length   base     ( size )
 1: Apple_partition_map Apple           63 @ 1
 2:     Apple_Bootstrap untitled      1954 @ 39935392
 3:           Apple_HFS Untitled  39673184 @ 262208   ( 18.9G)
 4:     Apple_UNIX_SVR2 LinuxRoot 10742188 @ 39937346 (  5.1G)
 5:     Apple_UNIX_SVR2 swap        585938 @ 50679534 (286.1M)
 6:     Apple_UNIX_SVR2 Shared     2441407 @ 51265472 (  1.2G)
 7:          Apple_Free Extra       262144 @ 64       (128.0M)
 8:             OpenBSD OpenBSD    4898241 @ 53706879 (  2.3G)

Device block size=512, Number of Blocks=58605120 (27.9G)
DeviceType=0x0, DeviceId=0x0

Command (? for help): q

# disklabel wd0
# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: TOSHIBA MK3025GA
duid: c2997bcd646b6636
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 58140
total sectors: 58605120
boundstart: 53706878
boundend: 58605119
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:          4499968         53706880  4.2BSD   2048 16384    1 # /
  b:           398241         58206879    swap
  c:         58605120                0  unused
  i:         39673184           262208     HFS
  j:          2441407         51265472   MSDOS


I read some documentation and source files to try to figure out where
this problem comes from, and I stepped across a very suspicious line of
code, in "src/sys/arch/macppc/macppc/disksubr.c"
<http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/macppc/macppc/disksubr.c?annotate=1.69>.

Line 144: "hfspartoff = part->pmPyPartStart - LABELSECTOR;"

And, if I'm not mistaken, LABELSECTOR is equal to 1 on MacPPC, and
hfspartoff is used to initialize the boundstart 6 lines later... So
coincidence or real bug ?  :)

-- 
Mathieu OLIVIER  <moliv...@users.sourceforge.net>

Reply via email to