[issue1622] devfs doesn't create my ad4s3 (macbook)

Matthew Dillon dillon at apollo.backplane.com
Tue Dec 8 12:24:25 PST 2009

:It seems gpt starts numbering slices at 0, so the usual ad4s1 is ad4s0, ...=
:leading to the fact that the expected ad4s3 is at ad4s2.
:In any case, I'll update our GPT code to fix some other issues (for example=
:the slice type is always set to 1).

    Yah, I'm responsible for the numbering.  With GPT 's0' is index entry 0
    in the GPT.  I did it that way so the index number in the GPT table
    matched the slice number in the device name because it was really
    confusing when they were 1-off.

    I don't know what the best solution is but numbering from 0 has caused
    us other headaches so if you want to change it back to numbering from 1
    it's ok with me.  It will mess up anyone using GPT right now, thougg,
    they will have to fix up their fstab and such. 

:       40   409600      0  GPT part - EFI System
:   409640   293391      1  GPT part - Apple HFS
:   703031   400000      - =20
:  1103031   185671      2  GPT part - MS/Linux Basic Data
:  1288702   808417      - =20
:  2097119       32      -  Sec GPT table
:  2097151        1      -  Sec GPT header

     So e.g.             ^ index 0, 1 and 2 corresponds to s0, s1, and s2
     right now.

:# newfs_msdos /dev/ad0s2=20
:/dev/ad0s2: 185276 sectors in 46319 FAT16 clusters (2048 bytes/cluster)
:bps=3D512 spc=3D4 res=3D1 nft=3D2 rde=3D512 mid=3D0xf8 spf=3D181 spt=3D63 h=
:ds=3D256 hid=3D1103031=20
:Observe carefully that the bsec of the newfs actually matches the number of=
:sectors of the third partition, with gpt index 2.
:Alex Hornung

					Matthew Dillon 
					<dillon at backplane.com>

More information about the Bugs mailing list