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

Peter Schuller peter.schuller at infidyne.com
Thu Apr 22 21:29:48 UTC 2010


>> Somewhere in the 7.x -> 8.x transition, debugflags was incremented.  You
> need to set it to 17 now.

I saw some references to that Googling, but it doesn't work:

% sysctl -w kern.geom.debugflags=17


       prometheus:/tmp(0)
kern.geom.debugflags: 17 -> 17
% ktrace disklabel -B /dev/ad9s1


       prometheus:/tmp(0)
disklabel: Class not found

And kdump still shows:

 15535 disklabel CALL  open(0x800c02040,O_RDWR,<unused>0xa1a5)
 15535 disklabel NAMI  "/dev/ad9s1"
 15535 disklabel RET   open -1 errno 1 Operation not permitted

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.

Anyone has thoughts on what the proper action here? Or do I need to
patch my kernel to update my label? :)

(I could pop it out of geom/zfs temporarily and hope the other disk
doesn't go. But as a matter of principle I don't want to go that
route...)

-- 
/ Peter Schuller


More information about the freebsd-fs mailing list