Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Oct 2011 19:03:52 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Warren Block <wblock@wonkity.com>
Cc:        freebsd-current@freebsd.org, Benjamin Kaduk <kaduk@mit.edu>, Arnaud Lacombe <lacombar@gmail.com>
Subject:   Re: aliasing (or renaming) kern.geom.debugflags
Message-ID:  <81391.1318014232@critter.freebsd.dk>
In-Reply-To: Your message of "Fri, 07 Oct 2011 12:53:22 CST." <alpine.BSF.2.00.1110071236270.2450@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <alpine.BSF.2.00.1110071236270.2450@wonkity.com>, Warren Block write
s:

>>>> Which is the exactly right question to ask.
>>>>
>>>> The procedure documented is clearly flawed.
>>>
>
>Well, yes.  The goal is to unprotect the device, regardless of what may 
>already be on it.  Then the user can overwrite it with the memory stick 
>image.

Unprotect from what ?  from being already mounted ?

If you cannot open a geom provider for writing, then it is because
some piece of code in the kernel thinks it already owns the device
and don't want you to muck about with it.

Overriding this check is just asking for panics...


What I usually do in cases like this is:

	(umount /dev/${whatever} || true) > /dev/null 2>&1

And if that isn't enough, or not possible, then the user needs
to undo whatever he did to the device...


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?81391.1318014232>