From owner-freebsd-current Mon Nov 18 15: 0:18 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E71037B401 for ; Mon, 18 Nov 2002 15:00:16 -0800 (PST) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFE3E43E9C for ; Mon, 18 Nov 2002 15:00:14 -0800 (PST) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.168.4]) by sccrmhc02.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021118230013.BWDL21905.sccrmhc02.attbi.com@InterJet.elischer.org>; Mon, 18 Nov 2002 23:00:13 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA75867; Mon, 18 Nov 2002 14:58:00 -0800 (PST) Date: Mon, 18 Nov 2002 14:57:58 -0800 (PST) From: Julian Elischer To: Vallo Kallaste Cc: freebsd-current@freebsd.org Subject: Re: Warning messages emitted by disklabel -r In-Reply-To: <20021118211552.GA3911@tiiu.internal> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 18 Nov 2002, Vallo Kallaste wrote: > On Mon, Nov 18, 2002 at 01:00:37PM -0800, Julian Elischer > 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