Date: Mon, 18 Nov 2002 13:00:37 -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.0211181238341.74299-100000@InterJet.elischer.org> In-Reply-To: <20021118195627.GA3309@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 11:23:14AM -0800, Julian Elischer > <julian@elischer.org> wrote: > > > what are the warnings? > > what version of disklabel.c? > > Here's script output: > > Script started on Mon Nov 18 21:46:07 2002 [...] > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 63, size 8899947 (4345 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 553/ head 254/ sector 63 > bash-2.05b# disklabel da1s1 [...] > # /dev/da1s1c: [...] > sectors/unit: 8899947 [...] > > 8 partitions: > # size offset fstype [fsize bsize bps/cpg] > c: 8899947 0 unused 0 0 # (Cyl. 0 - 553*) > e: 8899947 0 4.2BSD 0 0 0 # (Cyl. 0 - 553*) > bash-2.05b# disklabel -r da1s1 > # /dev/da1s1c: [...] > sectors/unit: 8899947 [...] > > 8 partitions: > # size offset fstype [fsize bsize bps/cpg] > c: 8899947 63 unused 0 0 # (Cyl. 0*- 553*) > e: 8899947 63 4.2BSD 0 0 0 # (Cyl. 0*- 553*) > partition c: partition extends past end of unit > Warning, partition c doesn't start at 0! > Warning, An incorrect partition c may cause problems for standard system utilities > partition e: partition extends past end of unit > bash-2.05b# ident /usr/src/lib/libc/gen/disklabel.c > /usr/src/lib/libc/gen/disklabel.c: > $FreeBSD: src/lib/libc/gen/disklabel.c,v 1.16 2002/08/16 15:33:20 bmilekic Exp $ This is only for reading /etc/disktab. > bash-2.05b# ident /usr/src/sbin/disklabel/disklabel.c > /usr/src/sbin/disklabel/disklabel.c: > $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk $ > $FreeBSD: src/sbin/disklabel/disklabel.c,v 1.63 2002/11/18 04:58:11 julian Exp $ ok so it's new.. I assume this is what you compiled into disklabel. The problem is basically from historical confusion.. When 386BSD first came out, the disklabel was in absolute blocknumbers. looking nback at it we should have fixed this ages ago with a flag but I digress. The only way to access hte whole physical disk was via teh 'd' partition which was 'magic' and covered the entire device. this meant that the blocknumbers needed to be absolute. After a while it became possible to access the physical drive directly using (say) /dev/ad0 or /dev/da0 so teh 'd'partition "went away". At this point we should have defined a flag to say that the disklabel was "relative" to whatever partition it was in, but we didn't. this measn that we can not tell teh differenc from looking at it if the partition is relative or absolute.. 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. 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.0211181238341.74299-100000>