Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Dec 2000 00:30:58 -0500
From:      "Brian F. Feldman" <green@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Matthew Thyer <Matthew.Thyer@dsto.defence.gov.au>, Mike Smith <msmith@FreeBSD.org>, "John W. De Boskey" <jwd@bsdwins.com>, freebsd-current@FreeBSD.org
Subject:   Re: write(2) returns error saying read only filesystem when trying to write to a partition 
Message-ID:  <200012100531.eBA5UwD14791@green.dyndns.org>
In-Reply-To: Message from Bruce Evans <bde@zeta.org.au>  of "Sat, 09 Dec 2000 03:15:07 %2B1100." <Pine.BSF.4.21.0012090244260.9572-100000@besplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans <bde@zeta.org.au> wrote:
> On Fri, 8 Dec 2000, Matthew Thyer wrote:
> 
> > Mike Smith wrote:
> > > > The program works on Compaq True64 UNIX v 4.0d
> > > > It also works on Solaris 7 (only tested sparc).
> > > >
> > > > So it seems FreeBSD is broken here.
> > > 
> > > FreeBSD just behaves differently.  If you want to write to the whole
> > > disk, open the whole-disk device, not the 'c' partition.
> > 
> > Thanks Mike, /dev/da18 works fine for me although I notice that
> > /dev/da18s1 does not.  There seems to be some inconcistencies
> > in this area.
> > 
> > Please tell me (and for the benefit of the list) as to why
> > I cant use /dev/da18s1c ?
> 
> Because metadata (i.e,. label) write protection actually works on
> /dev/da18s1c.
> 
> It is supposed to be possible to turn off write protection using the
> DIOCWLABEL ioctl, but IIRC this only works if the data written over
> the label area is a valid label (if there is already a label there,
> as there must be for /dev/da18s1c to exist), so labels can't be
> cleared by writing zeros to them (zeros don't give a valid label).
> 
> Labels can be cleared by zeroing them using the whole-disk device.
> All subdevices of the device should be closed before starting, and none
> except the whole-disk device should be opened before finishing, to
> ensure that the old in-core copy of the label isn't used.
> 
> Someone broke dd(1) to always turn off write protection of labels, to
> hack around a bug in the alpha disklabel code (someone broke the label
> for the whole-disk device by making it a real label to hack around a
> non-understood bug that is said to break sysinstall; real labels are
> write protected, so the whole-disk device can't be used to bypass the
> write protection).  Since overwriting labels doesn't work quite right
> even when write protection is turned off, I'm not sure how the breakage
> helps.

O'Brien said that it was totally necessary to be able to do it.  If it's the 
hack that the alpha users need, it's not really my place to try to analyze 
the how and why of alpha breakage to determine whether it's proper or not if 
I have no alpha systems.

--
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green@FreeBSD.org                    `------------------------------'




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?200012100531.eBA5UwD14791>