Advertisement

Server admin inputs the wrong command, accidentally deletes his entire company

A missing variable deleted the entire server and its backups


computer_explosion

Incorrectly executing a single line of code can make all the difference between staying in business and losing it all. Server administrator Marco Marsala will attest; earlier this month he entered a short command that deleted all traces of his company as well as the websites he hosted for his customers.

Once the operation began, Marsala panicked and jumped on the server expert form called Server Fault to seek help. But instead of finding consolation, he was greeted by users who couldn’t believe that someone incompetent enough to execute such code would be managing servers in the first place.

The command in question is “rm –rf,” which when executed responsibly, allows users to quickly delete data by automatically overwriting all the warning prompts. The “rm” section of the string evokes the delete function; the “r” variable specifies the chosen directory, and the “f” variable forces the computer to ignore the usual warning prompts that pop-up when deleting data. If the user neglects to specify a directory, the computer will begin at the highest possible level or root folder, and delete everything.

“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,” wrote Marco Marsala. “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.”

Normally, administrators have back-ups in place to prevent this kind of catastrophe, but in Marsala’s case, the backup drives were mounted onto the computer and were also deleted. “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).”

Some Server Fault users suggested that Marsala may be able to recover the data, but his reputation will not recover. Rm –rf marks the data blocks as empty, breaking the block linking chain, but not overwriting the actual content. For the right price, data recovery services can usually retrieve the lost data, but it may take months. Other users were less sympathetic “you're going out of business. You don't need technical advice; you need to call your lawyer.”

Source: Independent.co.uk

Advertisement



Learn more about Electronic Products Magazine

Leave a Reply