A man appears to have deleted his entire company with one mistaken piece of code.
By accidentally telling his computer to delete everything in his servers, hosting provider Marco Marsala has seemingly removed all trace of his company and the websites that he looks after for his customers.
Mr Marsala wrote on a forum for server experts called Server Fault that he was now stuck after having accidentally run destructive code on his own computers. But far from advising them how to fix it, most experts informed him that he had just accidentally deleted the data of his company and its clients, and in so doing had probably destroyed his entire company with just one line of code.
The problem command was "rm -rf": a basic piece of code that will delete everything it is told to. The "rm" tells the computer to remove; the r deletes everything within a given directory; and the f stands for "force", telling the computer to ignore the usual warnings that come when deleting files.
His backups were also mounted at the time. That's a nightmare scenario, right there.
(Score: 3, Informative) by butthurt on Saturday April 16 2016, @01:58AM
The newspaper account says that
Yet (had this happened) the advice to "turn off everything right now and hand your disks over to a reputable data recovery company" could work. The reason is that rm [oracle.com] "removes the directory entry," typically by calling unlink(2) [oracle.com]. The storage space is then deemed available, and can be overwritten when files are created or enlarged.
This is different from what we call "wiping" in which the contents of a file are overwritten by a command such as srm. The reasons it's desirable to turn off the power immediately are that an orderly shut-down involves some writing of files, and because file-systems are sometimes mounted asynchronously in which case there's a chance the unlinking might not have been fully written to disk.