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.

Bruce



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to