From owner-freebsd-current Fri Oct 16 23:02:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA02329 for freebsd-current-outgoing; Fri, 16 Oct 1998 23:02:13 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA02324 for ; Fri, 16 Oct 1998 23:02:10 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id QAA03864; Sat, 17 Oct 1998 16:01:46 +1000 Date: Sat, 17 Oct 1998 16:01:46 +1000 From: Bruce Evans Message-Id: <199810170601.QAA03864@godzilla.zeta.org.au> To: bde@zeta.org.au, mike@smith.net.au Subject: Re: Show Stopper? Failure to Install 19981014 Cc: freebsd-current@FreeBSD.ORG, jkh@time.cdrom.com, shimon@simon-shapiro.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> Labels should always be written using the RAW_PART partition ('c' on >> i386's). If not, then they must be written using a partition that has >> offset 0. If not even that, then the 'a' partition must have offset 0. >> Unfortunately, newfs(8) writes labels to the same partition that it >> is newfs'ing. > >I checked the history for this; it appears to have done this for a long >time. Yes, it's unreasonhable for it to frob the minor bits to convert from the partition that it is newfs'ing to the raw partition. >There is also bogus code in sys/ufs/ufs/ufs_disksubr.c which checks the >start of the partition to which the label is being written, and if that >is not 0, uses partition 0 ('a') instead. It is this code which is >returning EXDEV. This is the same bogus code. This failure of newfs's label write shows that the test lp->d_partitions[part] (where `part' is the partition being used to write the label) in writedisklabel() is bogus. It makes labels written via the raw partition more equal than the same labels written via another partition. The EXDEV return code is correct. It's clear from the handling of this code in disklabel(8) that the special handling of the 'a' partition is the intended behaviour. It's just wrong on systems where the raw partition isn't 'a'. >> >Partitions are laid on disk in the order that you enter them. The 'a' >> >partition is always reserved for the partition you mount on /. If you >> >> It's not reserved. It's just the default. > >It's reserved by sysinstall. Some of us don't use sysinstall. >> This is easy to fix by changing the (whole) test in writedisklabel() to >> `lp->p_partitions[RAW_PART] == 0'. Even that is probably only necessary >> to give the right errno (this condition is enforced in several places). >> This might wake bugs in other code where partition 0 is magic. > >Exactly. More to the point, why has this symptom only just recently >manifested? Because newfs was broken in rev.1.9 of newfs/newfs.c (before 2.0.5R). Unfortunately, the breaker didn't seem to have investigated the failure mode, so I didn't know how to fix it when I backed out the breakage in rev.1.22. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message