&gt;  It seems to me that the real issue is that &quot;rm -rf&quot; should by default not recurse into mounted filesystems, but should at most try to unmount them.<p>There is a --one-file-system argument that skips directories not on the same filesystem.  You could add this layer of protection by adding it to an alias in your shell.