On Mon, 18 Nov 2002, Vallo Kallaste wrote:
> On Mon, Nov 18, 2002 at 01:00:37PM -0800, Julian Elischer
> <[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED]
>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message