Man Accidentally Blew up his Entire Company With The Forbidden “rm -rf /” Command

Man accidently blew up his entire company just by running a few set of commands. Well, not literally blew up as in wiring the entire place with C4 explosives and then running a set of commands from a computer to set it off — like you usually see in Sci-fi movies — but this guy who by the way is a SysAdmin accidently deleted his company’s entire directory by running the destructive ‘rm -rf /’ command in root.

For those of you that are not very familiar with this command due to understandable reasons, ‘rm -rf /’ command when run in root, decimates the entire root directory and in the Linux file hierarchy, / is the mother load of all important system files and deleting it is… well, is really destructive and you can as well say bye bye to your system.

dont_drink_and_root_linux_shirt
The Sysadmin who has the misfortune of being the victim of such a disastrous event is called Marco Marsala who is working for a web hosting company that has over one thousand five hundred clients.

It is not far fetched to say that Mr. Marsala is in deep shit, and it all began when it tried to run a Bash script with the following command:rm -rf {foo}/{bar} but it instead was executed as rm -rf / due unidentified variables and when the execution was complete, Kaboom!! Everything disappeared.

dont_drink_and_root_linux_shirt
The poor guy posted this for help:

“I run a small hosting provider with more or less 1535 customers and I use Ansible to automate some operations to be run on all servers. Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar} with those variables undefined due to a bug in the code above this line.
All servers got deleted and the offsite backups too because the remote storage was mounted just before by the same script (that is a backup maintenance script).
How I can recover from a rm -rf / now in a timely manner?”

I know shit happens to tech people but this one is right up there with the worst of them and to make things sour for Mr. Marsala, these are some of the replies he got:

“If you really don’t have any backups I am sorry to say but you just nuked your entire company”,
And
“You’re going out of business. You don’t need technical advice, you need to call your lawyer”.

dont_drink_and_root_linux_shirt

Some were nice though and suggested that he shuts down everything and not try to overwrite anything but instead uses data recovery tools to recover at least some of his data. But in a situation like this even those provide a thin chance of recovering any significant amount information.
Luckily for Marco, things didn’t end up so bad as he later posted:

“luckily we recovered almost all data”.

A valuable lesson learned here and those of you who are SysAdmins, never run a random script without verifying it first and always have multiple offline backups — or even back ups of back ups just to be safe.

About The Author
Jesse Afolabi
Hardcore Linux fan, Jesse loves writing for tech and covers stories on Linux, Android and Ubuntu as well. He believes Ubuntu phones can be just as good as Androids.
2 Comments

Leave a Response