Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Oct 1998 16:01:46 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, mike@smith.net.au
Cc:        freebsd-current@FreeBSD.ORG, jkh@time.cdrom.com, shimon@simon-shapiro.org
Subject:   Re: Show Stopper? Failure to Install 19981014
Message-ID:  <199810170601.QAA03864@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810170601.QAA03864>