NetBSD-Users archive

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

Re: BSD disklabel partition letters in NetBSD



On 9/25/2018 10:52 AM, Michael van Elst wrote:
On Tue, Sep 25, 2018 at 05:05:44PM +0200, Rocky Hotas wrote:

only if none is written to disk,
a fictious label is generated from other data like an MBR.

Sorry, I can't understand this. Maybe it's related to the following
description:

disklabel is a data structure. If there is none on the disk, it is
generated from other information.

The problem comes from the fact that the term is severely overloaded.
There is a "data structure", a "portion of the medium" and a "software
program" that all share the name "disklabel".

The (fictitious) data structure needs to be explicitly written to the
medium -- by a sysadm's deliberate actions (most typically, by disklabel(8)!).
Otherwise, it is a purely ephemeral concept.

The disklabel would be used and 'd' would still be the raw partition.
The disklabel would also be placed on sector 1.

So, two disklabels in total. But what would be the contents of the
disklabel in sector 1?

With MBR, the disklabel is usually placed on relative sector 1 of
the MBR partition tagged as 'NetBSD' (type 169).

Without MBR, it is placed on absolute sector 1 of the medium.

N.B. the sector number can also be platform dependent, most use sector 1
but some use other sectors.

But it isn't placed in any of these places unless/until the system is
DIRECTED to do so.  I.e., you can access a brand-new, never-before-powered-on
disk drive via the fictitious IN-KERNEL disklabel STRUCTURE.  But, need
never actually write it to the medium to allow such access (on a NetBSD box).

[I.e., write the entire medium -- except the label portion -- and mount it on
some foreign OS and they won't see ANY label in place!  But, the DATA that
you wrote will still be there!]


Home | Main Index | Thread Index | Old Index