On Apr 2, 2014, at 2:11 PM, Glen Slick <glen.slick at gmail.com> wrote:
...
I think this is related to the routine partition_check() in the kernel
source file src/sys/sys/ufs_disksubr.c which is used, for example, by
the routine rastrategy() in the source file src/sys/pdpuba/ra.c
I'll have to see if I can find the copy of the source files where I
modified this to work around this issue when I needed to do this.
Possibly I just commented out this section of the partition_check()
routine:
/*
* Check for write to write-protected label area. This does not include
* sector 0 which is the boot block.
*/
if (bp->b_blkno + pi->p_offset <= LABELSECTOR &&
bp->b_blkno + pi->p_offset + sz > LABELSECTOR &&
!(bp->b_flags & B_READ) && !(dk->dk_flags &
DKF_WLABEL))
{
bp->b_error = EROFS;
goto bad;
}
So how do you write a label? Some ioctl? It may be that this means that writing the
whole floppy requires some extra trickery: plain writes for all except the protected area,
and some magic writes for the protected area.
paul