kern.geom.debugflags=16 does NOT allow me to write to device

Test Rat ttsestt at gmail.com
Sun Aug 7 07:32:37 UTC 2011


Peter Schuller <peter.schuller at infidyne.com> writes:

[...]
> In addition, geom(4) still has:
>
>      0x10 (allow foot shooting)
>              Allow writing to Rank 1 providers.  This would, for example,
>              allow the super‐user to overwrite the MBR on the root disk or
>              write random sectors elsewhere to a mounted disk.  The implica‐
>              tions are obvious.
>
> In addition, geom/geom_subr.c has:
>
> 	/* If foot-shooting is enabled, any open on rank#1 is OK */
> 	if ((g_debugflags & 16) && pp->geom->rank == 1)
>                       ;
>
> I wonder if the problem is that it's not of rank 1 because I'm writing
> to the slice's first second rather than the MBR... That's now feeling
> pretty likely and can perhaps explain lots of confusion that seems to
> exist based on Googling.
[...]

The issue still seems unanswered. For example, this guide

  http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition

silently avoids explaining why zroot on MBR & BSD should be exported.

If gpart is ever fixed I still think shooting the foot on rank > 1 is
useful for things like testing FS for corruption without accidentally
destroying partition table if operating on rank == 1.


More information about the freebsd-fs mailing list