Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2002 14:57:58 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Vallo Kallaste <kalts@estpak.ee>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Warning messages emitted by disklabel -r
Message-ID:  <Pine.BSF.4.21.0211181327050.74299-100000@InterJet.elischer.org>
In-Reply-To: <20021118211552.GA3911@tiiu.internal>

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


On Mon, 18 Nov 2002, Vallo Kallaste wrote:

> On Mon, Nov 18, 2002 at 01:00:37PM -0800, Julian Elischer
> <julian@elischer.org> wrote:
> 
> [snip]
> > In pre-geom days we had a "realhack" (TM) that would fiddle the 
> > label if you read it direct from the disk. In other words 
> > it "fixed"  it to always look (ummmm relative I think) even  if you
> > read it from the raw disk, even if it was in absolute form on the disk.
> > 
> > Geom (quite correctly) declared this to be a "gross hack" that it would
> > not perpetuate. As a result, when you read the raw label you see the
> > "uncorrected version". It's possible that disklabel itself
> > should be extended to figure out  if the label is absolute of relative
> > and DTRT.
> 
> Ok, seems not to be over my head. It's confusing to users, that's
> the only thing I have to say now. Thank you for explanation.0

Geom has some hacks to cope with this..
namely:
in geom_bsd.c:

/*
 * For reasons which were valid and just in their days, FreeBSD/i386 uses
 * absolute disk-addresses in disklabels.  The way it works is that the
 * p_offset field of all partitions have the first sector number of the
 * disk slice added to them.  This was hidden kernel-magic, userland did
 * not see these offsets.  These two functions subtract and add them
 * while converting from the "ondisk" to the "inram" labels and vice
 * versa.
 */
static void
ondisk2inram(struct g_bsd_softc *sc)
{
[...]

however I have not (so far) seen any code to intercept direct reads

also there is a posibility (I have not checked enough yet) that 
MAYBE teh ondisk2inram should modify the device size as well.
It currently modifies just the partition starts.


> -- 
> 
> Vallo Kallaste
> kalts@estpak.ee
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0211181327050.74299-100000>