Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Aug 2004 14:40:30 -0400
From:      Allan Fields <bsd@afields.ca>
To:        freebsd-geom@freebsd.org
Subject:   Re: GEOM and NetBSD compatibility question
Message-ID:  <20040815184030.GD21307@afields.ca>
In-Reply-To: <200408142223.i7EMNdY00919@Mail.NOSPAM.DynDNS.dK>
References:  <200408142223.i7EMNdY00919@Mail.NOSPAM.DynDNS.dK>

next in thread | previous in thread | raw e-mail | index | archive | help

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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:
>=20

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 579799987=
19
> GEOM: Configure da0s2d, start 0 length 250999209984 end 250999209983
> GEOM: Configure da0s2e, start 52344910848 length 5100273664 end 574451845=
11
> GEOM: Configure da0s2f, start 57445184512 length 534814208 end 57979998719
> GEOM: Configure da0s2g, start 80520693760 length 5368709120 end 858894028=
79
> GEOM: Configure da0s2h, start 85889402880 length 10737418240 end 96626821=
119
> GEOM: Configure da0s2i, start 32256 length 134217728 end 134249983
> GEOM: Configure da0s2j, start 33420246528 length 5368709120 end 387889556=
47
> GEOM: Configure da0s2k, start 32346504704 length 1073741824 end 334202465=
27
> GEOM: Configure da0s2l, start 38788955648 length 12750648832 end 51539604=
479
> GEOM: Configure da0s2m, start 69783275520 length 10737418240 end 80520693=
759
> 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 2509992=
09983
>=20
> 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 161061273=
59
> GEOM: Configure da0s4g, start 16106127360 length 10737418240 end 26843545=
599
> GEOM: Configure da0s4h, start 26843545600 length 154372388864 end 1812159=
34463


> 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

--=20
 Allan Fields, AFRSL - http://afields.ca
 2D4F 6806 D307 0889 6125  C31D F745 0D72 39B4 5541

--FL5UXtIhxfXey3p5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQFBH64d90UNcjm0VUERAhqLAKDEI0g+N6BZBDCSCj8RggrM6d8+PwCfR/yS
8V7Wt0rCd6neTBDO3PvmOII=
=07wb
-----END PGP SIGNATURE-----

--FL5UXtIhxfXey3p5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040815184030.GD21307>