rm -rf /
Written on 2008-11-10.
… does not work. At least not today on a Debian/Sid system. Looks like there are some things, not even root is allowed to do:
root@sid:~# rm -rf / rm: cannot remove root directory ‘/'
If you’re curious what happens when you wipe your disk on a running system:
root@sid:~# cd / root@sid:/# rm -rf *`
does the trick.
Update: That’s with plain rm not safe-rm.
Update 2: I looked through the code of
rm.c to find that
protected by default – as a simple
rm --help also shows:
$ rm --help Usage: rm [OPTION]... FILE... Remove (unlink) the FILE(s). [...] --no-preserve-root do not treat `/' specially --preserve-root do not remove `/' (default)
This entry was tagged debian