Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Oct 1998 22:17:14 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        mike@smith.net.au, shimon@simon-shapiro.org, freebsd-current@FreeBSD.ORG, jkh@time.cdrom.com
Subject:   Re: Show Stopper? Failure to Install 19981014 
Message-ID:  <199810170517.WAA00708@dingo.cdrom.com>
In-Reply-To: Your message of "Sat, 17 Oct 1998 14:51:01 %2B1000." <199810170451.OAA00376@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >It appears to be caused by not entering the root filesystem first.
> >There's a test in the disklabel code which checks to see if the
> >partition you have open to write the label starts at 0, and if not then
> >it defaults to the 'a' partition.
> 
> 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.

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.

> >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.

> >don't enter this partition first, it won't be at the beginning of the 
> >disk, and any attempt to rewrite the disklabel will fail.
> >
> >Due to the way that sysinstall interacts with libdisk, this is 
> >difficult to get "right".  We probably need a bandaid which insists 
> >that if you want to create an 'a' partition you must lay it down first.
> 
> 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?

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



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?199810170517.WAA00708>