tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: disklabel(8) allows addressing non-existent space



>>>> Plus, one thing I wondered about: Is there a clean way to
>>>> determine the "mother" partition (i.e. c or d)?
>>> If you mean RAW_PART, the kern.rawpartition sysctl is what you
>>> want.  If you mean the equivalent of c on i386 ("the NetBSD MBR
>>> partition"), it doesn't exist at all on many ports, so, no, there
>>> isn't.
>> kern.rawpartition is exactly what I've been searching for, thank you!
> hm, I just found out: It isn't.  What I'm looking for is the
> 'encapsulating' device of the disklabel, i.e. in case of an mbr, the
> mbr partition 'c', and in case of a 'raw' disk label, the whole hard
> disk (so perhaps 'd' on x86, 'c' on sparc).

As far as I know there is no clean way.  This isn't that surprising,
because i386's c partition isn't a very clean thing in the first place.
You could maybe get a workable approximation in most cases by using
partition 2, since I think ports that have it use 3 for RAW_PART and 2
for what you want, while ports that don't use 2 for RAW_PART.

Of course, if it matters to you, you should check that.  It's accurate
for the ports I'm familiar with, but that's very far from all of them.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index