Protection from the dreaded "rm -fr /"

Tillman Hodgson tillman at seekingfire.com
Sat Oct 2 14:05:55 PDT 2004


On Sat, Oct 02, 2004 at 09:16:08PM +0200, Michael Reifenberger wrote:
> On Sat, 2 Oct 2004, Giorgos Keramidas wrote:
> ...
> >>Exactly. Who would expect `rm -rf /` to actually succeed? It's not only
> >>dangerous, it doesn't work in a useful way ;-)
> >>
> >>If one is thinking about `rm -rf /`, `newfs` is probably the right
> >>answer.
> 
> newfs only works if the root is not mounted because otherwise the device is 
> locked. (Hmm is GEOM too anti foot shooting? But can't you reenable 
> foot-shooting via sysctl?) whereas `rm -rf /` works allwsys
> :-)

It'll never work, though, that's the thing. At some point it'll rm
something it itself needs and error out. There isn't a way to use `rm
-rf /` that /doesn't/ result in foot-shooting.

This isn't a sub-tree like /etc or /sbin (which are rooted in /), this
is only to treat / itself specially.

-T


-- 
"If knowledge creates problems, ignorance will not solve them"
    -- Isaac Asimov.


More information about the freebsd-hackers mailing list