GEOM and NetBSD compatibility question

Allan Fields bsd at afields.ca
Sun Aug 15 11:40:31 PDT 2004


On Sun, Aug 15, 2004 at 12:23:39AM +0200, Barry Bouwsma wrote:
> I had looked at this a couple years ago, without really finding
> a solution, and now I'm experiencing this again when trying to
> use my NetBSD partition under FreeBSD-CURRENT and GEOM.

Which, all things considered, isn't an entirely outlandish proposition.

> I've applied a hack (first proposed a couple years back) which
> allows GEOM to recognize the NetBSD ID.  However, GEOM is getting
> confused by the NetBSD disklabel.

Can you email the patch (and/or post url to list)?

I think it should be possible to access both NetBSD and OpenBSD
labels/partitions from FreeBSD as GEOM is designed to accommodate
such layouts.

> GEOM displays the FreeBSD disklabels as relative offsets to the
> absolute offset of the DOS partition.  However, it displays the
> NetBSD disklabel offsets as absolute offsets, yet it treats them
> as relative offsets, and that just don't want to work right.

Understandably, there are some differences that need to be sorted
out.  All of the BSDs have diverged on disklabel support.  Even
DragonFly now has some differences in how it handles labels (while
FreeBSD can currently read them still(?) it doesn't work the other
way around from my experience).

For simplicity, each should probably now have a separate ID from
FreeBSD(165).

> It's a property of the NetBSD disklabel that the `d' partition
> covers the whole disk.  Additionally, I use the additional

right

> available partitions to map parts of the disk outside of the
> NetBSD DOS partition (the other FreeBSD partitions) so that I
> can access them from NetBSD, which otherwise can't access any
> part of the disk outside its DOS partition.

Yup, so it would make sense to have a way to sanely handle these
cases, like where a partition of a NetBSD|OpenBSD slice is really
equivalent to (or worse, slightly differing from) another slice
entry (dos/bios partition), GEOM might want to know about that.


> Here's what GEOM has to say about the NetBSD partition of my
> disk:
> 

Can you fill this out as to which slices are which:
s1: FreeBSD
s2: NetBSD?
s3: ?
s4: ?
Or is the important point that s2 is the NetBSD label?

> GEOM: Configure da0s2a, start 51539604480 length 268435456 end 51808039935
> GEOM: Configure da0s2b, start 51808039936 length 536870912 end 52344910847
> GEOM: Configure da0s2c, start 51539604480 length 6440394240 end 57979998719
> GEOM: Configure da0s2d, start 0 length 250999209984 end 250999209983
> GEOM: Configure da0s2e, start 52344910848 length 5100273664 end 57445184511
> GEOM: Configure da0s2f, start 57445184512 length 534814208 end 57979998719
> GEOM: Configure da0s2g, start 80520693760 length 5368709120 end 85889402879
> GEOM: Configure da0s2h, start 85889402880 length 10737418240 end 96626821119
> GEOM: Configure da0s2i, start 32256 length 134217728 end 134249983
> GEOM: Configure da0s2j, start 33420246528 length 5368709120 end 38788955647
> GEOM: Configure da0s2k, start 32346504704 length 1073741824 end 33420246527
> GEOM: Configure da0s2l, start 38788955648 length 12750648832 end 51539604479
> GEOM: Configure da0s2m, start 69783275520 length 10737418240 end 80520693759
> GEOM: Configure da0s2n, start 134249984 length 32212254720 end 32346504703
> GEOM: Configure da0s2o, start 57979998720 length 268435456 end 58248434175
> GEOM: Configure da0s2p, start 96626821120 length 154372388864 end 250999209983
> 
> GEOM: Configure da0s3a, start 0 length 268435456 end 268435455
> GEOM: Configure da0s3c, start 0 length 11803276800 end 11803276799
> GEOM: Configure da0s3e, start 268435456 length 10737418240 end 11005853695
> GEOM: Configure da0s3f, start 11005853696 length 797423104 end 11803276799
> GEOM: Configure da0s4c, start 0 length 181215934464 end 181215934463
> GEOM: Configure da0s4e, start 0 length 10737418240 end 10737418239
> GEOM: Configure da0s4f, start 10737418240 length 5368709120 end 16106127359
> GEOM: Configure da0s4g, start 16106127360 length 10737418240 end 26843545599
> GEOM: Configure da0s4h, start 26843545600 length 154372388864 end 181215934463


> Of course, I can't mount any of da0s2? as a filesystem.
> da0s2 works fine for what would be da0s2a.  Years ago when
> I tried this, the NetBSD swap partition turned out to be
> translated by GEOM into the NetBSD /usr and as a result,
> I've been wary of -current until now.

And I'd also be wary of unsing a NetBSD partition from FreeBSD, at
this point: it's not -current per se, but the differences in formats.
Have you looked at the NetBSD disklabel code for anything that
stands out?

> I had tried a while back to hack in an absolute/relative
> offset toggle, but never was able to make all of GEOM
> make use of it.  Meaning nothing, as I'm no programmer
> nor hacker and have no idea what I'm doing.

By toggle do you mean it can turn on/off with differing
disklabel ID or just manually?

I'm sure some of the experienced GEOM hackers know more.


> thanks
> barry bouwsma

-- 
 Allan Fields, AFRSL - http://afields.ca
 2D4F 6806 D307 0889 6125  C31D F745 0D72 39B4 5541
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20040815/e69047aa/attachment.bin


More information about the freebsd-geom mailing list