My very first internship in college at a real-time Unix shop, I did an ‘rm -rf’. Spent the rest of the afternoon learning how to use tar to restore from backup.
Why panic, no great loss...
Always change directory to root ‘/’ before running rm -rf. Make sure you have su - root first. Now you are talking unix.
I used to do contract firmware development at Slacker.com and when I had JUST started the firmware build system built the firmware on the server, and you just copied the output file down to your PC and flashed it to your device. Part of this build process involved creating a root filesystem in a directory and adding files to it. The first step cd’d to that directory, and then ran an “rm -rf *” to clean the old root filesystem before it started copying the new files to it. Well, IT had borked my permissions, so the “cd” failed, but the rm -rf * worked. Deleting all the files on the server. This happens, I see what has happened, and I trot over to IT. “I just wiped the server”. (condescendingly) “No you didn’t.”. (Tries to log in, can’t. Does some other checks, sees that server is blank). “What did you do?” I tell him the command I issued, tell him that the “cd” failed, looked like a permissions error. They pull out the tapes, and start a restore. It was very soon after this event that the build process changed, and we were now building our code locally. (Which we should have been doing all along).
They should have upgraded to Windows.
What happens when you run
sudo rm -rf —no-preserve-root /
https://www.youtube.com/watch?v=nkPpwH2HTOU
In the early 80’s, I was working with a consulting firm in NYC. I came in early and say an analyst crying by her computer terminal. She spent the weekend entering data for a utility rate case. The TECO text editor had a function -KT- Which saves all your work. KY, however, saved the current ‘buffer’ of work, erases all the other data, and overwrites the file without saving. Sad.
I don’t buy into this story. It has threads of plausibility, but I’m highly skeptical that all of this is true. There would have been multiple backups in multiple media formats, and works in progress would be saved to hundreds of different machines and backups. It may have been a pain in the ass to recover, but there was no way they lost everything from one command - as the result clearly shows.
I worked in IT, saw a lot of unfortunate errors. All right, who deleted the root account from the UAT machine? It was some rookie SA in India; fortunately, it’s not a production server.
Then there was the Oracle DBA who was asked to truncate one of the test instances, and truncated production instead. She was quite experienced, but she typed the command into the wrong window.
Saving this thread /pun>
RM *.* alert
How did we ever survive not having Git?
And this is the magic of a sneaker network.
Firewalls like this always work; software backup systems not so much.
I’d like to warn of trusting valued data to the now-ubiquitous USB “thumb” sticks. After the second “cannot read corrupted drive” message I bought a good external drive for a master repository and just use the thumbs for moving data and some redundancy.
When shopping for the external drive I was surprised to learn that many of them are scams - just USB sticks put in larger cases, so stick to name brands if you look to buy one.
Research saves assets and asses.