On Apr 2, 2014 12:00 PM, "Paul Koning" <paulkoning at comcast.net> wrote:
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.
Yes, I believe there is an ioctl for writing disk labels. Some bit of
kernel code which sets the DKF_WLABEL flag to allow the section of code
above to pass its check.