How To Destroy A Filesystem

rmrf

The G1 ‘execute every command you type‘ bug naturally spawned ‘rm -rf /’ jokes. rm is the Linux command for deleting files. The -r and -f flags will cause it to remove files recursively and ignore confirmation. Executed as root it will annihilate the entire filesystem. Won’t it? [Jon Hohle] decided to test exactly how destructive the command was to *nix systems. How functional would the system be afterwards? He tested it side by side with the Windows equivalent, both ‘format c:’ and ‘del /F /S /Q’. He wanted to see what protections were available and what would be left working. Linux ended up completely broken while Windows, thanks to file locking, actually shutdown cleanly… and never came back. Some OSes, like Solaris, refuse to run the command ‘rm -rf /’ to prevent accidents.

29 thoughts on “How To Destroy A Filesystem

  1. Strange, I tried to format the system drive on a windows machine that I was decommissioning one time and I seem to remember windows refusing to allow it to run, even under an administrator account… this was under NT 4.0 I think?

  2. I tried this on my Ubuntu system (I was going to do a reformat upgrade to 8.10 anyways, so I decided to have fun with my existing install) and it deleted a lot of stuff (first my desktop icons, then my background, then other stuff) but it never completely destroyed the system. I was quite sad, I thought it’d be a nuclear meltdown and instead just a few user files deleted.

  3. Unfortunately formatting the system drive doesn’t work on any version of Windows :(

    To be honest it really is shocking that other OS’s haven’t implemented proper compulsory file locking, since it adds quite a lot to the reliability of a system if it’s binaries can’t be patched/overwritten/upgraded while they’re executing.

  4. I actually did this once, completely on purpose (ubuntu), meaning to mount and cp another filesystem in.. turns out mount and cp were both deleted, game over.

    Got it back up and running from a livecd though.

  5. I once fell from my chair and right onto the return button while typing an rm-command, and sadly it said “/” at the time of my mishap. but lucily, my old iBook was so incredible slow at deleting (encrypted filesystem and two digit load average :D), that it barely emptied /bin.
    thankfully, the shell was still in memory (although deleted from disk), so I could copy the essential files from another computer.

    What struck me as odd was, though, that dpkg/apt-get does not seem to have any kind of “repair”-functionality, that looks through the installed packages file lists, and in case of missing files/wrong checksums for binaries etc, does a reinstall. I had to figure out the broken packages manually, and dpkg -r –force them away, only to reinstall them again.

  6. The windows equivalent would be rmdir not del, del as is shown stops dead on locked files.
    I wonder how many decades it will take before people will get familiar with rmdir, and other ‘new’ commands introduced after win98..

  7. Is this such a big surprise? When you delete important shit, other important shit dies….

    Sure, OS’s such as Windows have protections against it, but for Linux/Unix/BSD its just a way to cull the idiots…

    Hardly hackaday.com quality… Hell, hardly digg.com quality.

  8. This article is full of fail.

    Who the hell approves this shit? if anything.. it’s proof you’re all either Windows users or Ubuntu zealots.

    “Linux would not continue with the command until the root password was entered.”

    Wrong. You don’t enter your root password, you enter your users password.

    Deleting all the files in ones C:\ drive is not the equivalent of rm -rf / under Unix, for one, multiple drives are mounted under / on Unix.

    Anyway, notta-hack god dammit! ban these idiots from posting stupid stories already!

  9. Yeah this isn’t exactly a “hack” it reminds me when I trashed the “macintosh hard drive” on an old school machine running like 5.0 mac os or something and a stupid security program that all you had to do was unclick “guard” in control panels. Boy the computer did not like that. It was funny seeing the computer person trying to fix it. All that would show up was the infamous bomb logo in the white box.

Leave a Reply to Chris HansenCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.