Slashdot Mirror


Man Deletes His Entire Company With One Line of Bad Code (independent.co.uk)

Reader JustAnotherOldGuy writes: Marco Marsala appears to have deleted his entire company with one mistaken piece of code. By accidentally telling his computer to delete everything in his servers, the hosting provider has seemingly removed all trace of his company and the websites that he looks after for his customers. Marsala wrote on a Centos help forum, "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)." The terse "rm -rf" is so famously destructive that it has become a joke within some computing circles, but not to this guy. Can this example finally serve as a textbook example of why you need to make offsite backups that are physically removed from the systems you're archiving?"Rm -rf" would mark the block as empty, and if the programmer hasn't written anything new, he should be able to recover nearly all of the data. Something about the story feels weird.

460 comments

  1. Three words by MPAB · · Score: 4, Insightful

    Offsite, offline BACKUPS

    1. Re:Three words by Anonymous Coward · · Score: 0

      3 Words: What An Idiot

    2. Re:Three words by Anonymous Coward · · Score: 0

      Why would he do a back-up by mounting remote drives? There are other protocols that are much safer (like rsync), and literally dozens of COTS products that handle that sort of thing reliably..

    3. Re:Three words by Anonymous Coward · · Score: 0

      If they were mounted they aren't "offline", retard.

    4. Re: Three words by Anonymous Coward · · Score: 0

      He included the word "offline". So, you other ACs are fucking retarded idiots.

    5. Re:Three words by Nutria · · Score: 1

      Multiple off-site backups. Multiple, rotating off-site backups. Weekseven if something happens to the on-site tapes you've still got backups.

      Honestly, WTF is it about the PC/Internet mentality that makes sysadmins soooo stupid? Enterprises figured this out FIFTY YEARS AGO.

      --
      "I don't know, therefore Aliens" Wafflebox1
    6. Re:Three words by Anonymous Coward · · Score: 0

      Maybe 'cos the whole story is fabricated.
      The rm -rf thing is plausible, fucking up recovery with dd was overdoing it.
      Accidently pointing all domains to goatse.cx would be more believable.

    7. Re: Three words by SumDog · · Score: 1

      He capitalized the wrong word. BACKUPS instead of OFFLINE

    8. Re:Three words by Aighearach · · Score: 4, Insightful

      That's all great, but even a less complete, sloppy backup system would be an improvement here.

      Another thing people don't understand about cloud hosting... you should still have your own self-managed, non-cloud server that holds your images and ideally runs your service during the low-traffic hours. Whatever your daily lowest traffic 6 hours is, in most cases, should be traditionally hosted. Cloud is super-duper-awesome-webscale for the peak traffic, no way around that if you have peak traffic hours.

      Personally, I can re-deploy (including the latest database backup) from my dev workstation using a simple rake task.

      Another problem is; relying on your hosting company for backups. Never do that. The same fire/earthquate/bash script/volcano that makes the backup necessary, would destroy it! Expect the hosting company to have insurance, don't expect them to care if your data gets lost. Especially if it "user error."

      This has nothing to do with "PC/internet mentality" and everything to do with the latest anti-waterfall, anti-planning, 80% is all that matters mindset. Traditionally, this was easily solved because there was an engineering mindset.

    9. Re: Three words by thegarbz · · Score: 1

      I tried offline backups once, but I couldn't figure out how to get the data off my computer and on the backup without first putting the backup online.

    10. Re: Three words by Anonymous Coward · · Score: 0

      He included the word "offline". So, you other ACs are fucking retarded idiots.

      So he included the word "offline". So what? He obviously doesn't understand what "offline" means, and apparently neither do you. If the drive is mounted and accessible then its not offline.

      More important, is his claim of "rm -rf {foo}/{bar} with those variables undefined". How would that delete files on another computer?

    11. Re:Three words by lgw · · Score: 2

      I have to disagree here a bit. Not with the idea of doing backups -- everyone should -- but that's looking at the half problem the wrong way. It's the right solution for customer data, but not for all the code and other materials that make your web site happen.

      I've seen this problem a lot: all the work product that makes a web presence happen gets done on the hosted server. That's beyond stupid - that's failing to even understand your job.

      All the work that goes into your hosted web site -- your store, your code that aggregates or helps the customer in whatever way makes you valuable, all that stuff -- needs to live in a version control system you control locally. Ideally github, so backups are free, but not everyone can do that. Your entire web presence other than customer data should be pushed from where the real work is done, and of course there should bee a way to revert as well.

      When you look at it that way, it's obvious that a key place to replicate your customer data to is close to the machines you do your build/push work from (not the same machines, unless you have strong read-only protection, but close). That way, if your hosting provider takes your site down on a whim, a couple of scripts you already have give you the same web site with the same data at a new hosting provider. That also makes you safe against physical server failure, rm -rf, and anything else that happens in the cloud.

      This isn't rocket science, it the minimum standard that separates amateur from professional.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    12. Re: Three words by GameboyRMH · · Score: 1

      It's true, if you have only one offline backup there are short periods of total risk involved. If you have more than one offline backup though, you just do one at a time and there's never any window of time when all your backups could be taken out by a lightning strike/malware/hilarious accidental deletion.

      With newer versions of rm you can also use --preserve-root to prevent this sort of thing from happening.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    13. Re:Three words by TheRaven64 · · Score: 1

      In this context, the guy is the cloud provider. His customers, if they're sensible, will have their own backups and so will be able to recover, but they also won't trust his business much if that's their recovery strategy from his incompetence.

      Even with online backups, there's no way that this should happen. The backup system should be taking read-only snapshots at periodic intervals, so even if you rm -rf you'll only delete the live data and be able to revert to the snapshot from an hour ago.

      --
      I am TheRaven on Soylent News
    14. Re: Three words by GameboyRMH · · Score: 5, Informative

      Addendum - just checked a CentOS server, and rm --help says that --preserve-root is enabled by default, and has to be overridden with --no-preserve-root.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    15. Re:Three words by tnk1 · · Score: 1

      Offsite, tape backups aren't even really all that necessary. You just need any backup that you can't use one command in the system to delete all of your data.

      You could use AWS S3, and just use something like Glacier to back up your data. Since it takes like 4 hours for it to be rotated back into being online, you have about the same effect.

      Also, while offsite backups are useful, for a host with 1,535 customers, who are all making changes, even if you have a daily offsite tape backup, you could find yourself missing a lot of changes. I suppose it is better than losing all of the sites, but I'd think that some simple precautions to ensure your online backups were not immediately delete-able with one easy command would pay much higher dividends.

    16. Re:Three words by flopsquad · · Score: 5, Funny

      Offsite, offline BACKUPS

      Would not have helped in this situation. His typo resulted in this command:

      "rm -rf --no-preserve-root --write-zeroes --shred-mbr --exec-all-ssh-hosts --douse-hydrofluoric --high-velocity-eject-removable-media --carpet-bomb-offsite-backup --salt-earth"

      Which, I mean, who hasn't accidentally done that? The keys are like right next to each other.

      --
      Nothing posted to /. has ever been legal advice, including this.
    17. Re:Three words by ShanghaiBill · · Score: 2

      Traditionally, this was easily solved because there was an engineering mindset.

      You seem to be implying that data loss was less common in the "Good ole' days", when all sys admins were highly trained engineers. That is almost certainly untrue, and based on false nostalgia. Backups are much easier today, with reliable high-capacity storage, journaling file systems, ubiquitous connectivity, and plenty of off-the-shelf software solutions.

    18. Re:Three words by Megane · · Score: 4, Informative

      Because he is a retard.

      All servers got deleted and the offsite backups too because the remote storage was mounted just before by the same script

      Clearly a case of a fool thinking that a sync (copying data to another place regularly) is a backup. It's not a backup if you can easily copy corrupted data to your only copy. Or, in this case, if you can easily delete the data from your "backup" copy.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    19. Re:Three words by The+MAZZTer · · Score: 1

      Three words (Score:1, Redundant)
      Offsite, offline BACKUPS

      Make them Redundant backups too? Good idea.

    20. Re:Three words by Aighearach · · Score: 2

      Some projects I worked on in the 90s still have tape archives of that data.

      You can easily have a situation where the backup tools have improved, and there is less overall data loss now, but that the mindset now is sloppy and leads to a lot of errors of types that were less common in the past.

      In the past when you did it sloppy, you'd get called out on it; and sometimes it still sucked, because PHB. But when that was the case, it was at least known and accepted that it was technically inferior to not have correct engineering. These days, the average shop believes that 80% is enough, and that 95% completion is too much and a waste of money. In the old days, there was technical consensus that 100% of the desired functionality... was desired.

    21. Re: Three words by Anonymous Coward · · Score: 0

      How would that delete files on another computer?

      NFS, CIFS, etc. etc.

    22. Re: Three words by Anonymous Coward · · Score: 0

      The poster, MPAB used the word "offline" in HIS post. I know what OFF FUCKING LINE means, and apparently he does too. Your reading comprehension sucks balls, just like the ACs who responded to him with "idiot" and "retard", you retarded fucking idiot.

    23. Re:Three words by Aighearach · · Score: 2

      In my experience, most of the customers of small hosting companies are paying for fully managed servers, which includes the backups. Most of the customers won't have any backup other than the code they started with. And they wouldn't know how to make a backup any more than they would know how to shoot a fireball spell out of a chopstick.

      This is compounded by human nature applying "trust" based on the quality of the personal relationship you have. If you have a nice conversation, by the end they really really want to give you their root password, have you move all their stuff over for them, and just tell them when it is finished. And then their DNS hasn't propagated yet, and they get really upset and become unsure if they should "trust" you, and get indigestion, and start calling every hour.

      The "mounted backup" part is just a bridge too far. Later in the comments he says he swapped of/if on a dd command, so now how does he prep the disk for recovery, which seems to verify the troll.

    24. Re:Three words by hey! · · Score: 1

      Four words: filesystem with automatic snapshots.

      I've never admined a major customer linux installation myself, but as a developer I've been called into rescue customers who messed up their databases, and let me tell you being able to root through the transaction log and undo mistakes like "delete * from foo where conditionThatIsAlwaysTrue" is a lifesaver. Oracle, which is a company I despise for a number of reasons, does a really good job of that.

      The rule for production systems should be "never work without a safety net".

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    25. Re:Three words by Salgak1 · · Score: 1

      Three MORE words:

      Teh Burning Stoopid . . .

    26. Re:Three words by cyber-vandal · · Score: 1

      Where did you work where that mentality didn't exist? I worked for quite a few very large organisations back in the day and "put it live, we'll fix the bugs as we go" was the order of the day, usually after 2 years of shambolic waterfall development and ever-changing requirements.

    27. Re:Three words by billyoc903 · · Score: 5, Funny

      I have this aliased to 'sl'. Keeps me on my toes.

    28. Re:Three words by geekmux · · Score: 2

      Offsite, offline BACKUPS

      Would not have helped in this situation. His typo resulted in this command: "rm -rf --no-preserve-root --write-zeroes --shred-mbr --exec-all-ssh-hosts --douse-hydrofluoric --high-velocity-eject-removable-media --carpet-bomb-offsite-backup --salt-earth" Which, I mean, who hasn't accidentally done that? The keys are like right next to each other.

      Man, I haven't laughed out loud like that in a long time. Thank you for that.

    29. Re:Three words by Aighearach · · Score: 1

      If you had changing requirements, you weren't doing waterfall. Sorry.

    30. Re:Three words by Anonymous Coward · · Score: 1

      Well, there are two ways I can think of to accidentally trigger that command.
      One is when you are trying to remember how to exit vi and are trying different shortcuts.
      The other one is if you slip and press that hotkey in emacs.

    31. Re:Three words by ShanghaiBill · · Score: 1

      In the past when you did it sloppy, you'd get called out on it

      I have been in tech for 30+ years, and I have seen no evidence whatsoever that sys admins were less sloppy in the past, nor do I believe that management was better at "calling them out" when they made mistakes. Backups and reliability in particular are way better today.

      Every generation tends to believe that young'ins are dumber and lazier than they were. They are usually wrong.

    32. Re:Three words by Triklyn · · Score: 4, Interesting

      ... are you suggesting that there's someone out there that knows how to shoot a fireball out of a chopstick?

      please elaborate on that

    33. Re:Three words by Anonymous Coward · · Score: 1

      If you properly cooked the earth, you wouldn't need to salt it.

      --sf

    34. Re:Three words by MachineShedFred · · Score: 1

      Or, how about "test before running EVERYWHERE"

      Spin up a VM, run your script. If the VM eats itself, you're out of a few minutes of time instead of your entire company and legal jeopardy from your customers.

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    35. Re: Three words by MachineShedFred · · Score: 1

      The script was deployed via Ansible. He ran it on everything at once.

      And everyone knows that blind deletes via automated scripts are a fantastic idea.

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    36. Re:Three words by Cramer · · Score: 1

      Come on, who hasn't done that at least once in their long carrier? Hell, I've done it on purpose a time or two. (it's actually rather rare for it to actually finish, or it used to be... shortly after rm and libc are deleted, things start Going Wrong(tm).)

    37. Re:Three words by Anonymous Coward · · Score: 0

      Some projects I worked on in the 90s still have tape archives of that data. That seems legally risky, most companies have a data retention policy of max 2 years to avoid legal issues.

    38. Re: Three words by kurkosdr · · Score: 1

      Or, an OS which offers decent automation tools, so you won't have to hand cruft bash scripts as if it's 1989 again. There is a reason Windows Server still makes Microsoft money despite linux supposedly being the OS of choice for servers.

    39. Re:Three words by Eloking · · Score: 1

      Which, I mean, who hasn't accidentally done that? The keys are like right next to each other.

      I'm quite sure this is from an old bash.org post.

      --
      Elok
    40. Re:Three words by Darinbob · · Score: 1

      Three words. Blame the intern.

    41. Re:Three words by Anonymous Coward · · Score: 0

      The fact that he tried to recover the data, and mentioned that he used dd on the wrong volume, destroying it, made it appear to stand out as a troll post.

    42. Re:Three words by mwvdlee · · Score: 1

      Why would you ever need or even want to mount your backup storage?

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    43. Re:Three words by Anonymous Coward · · Score: 0

      Although, if the envelope you open says "Prepare three envelopes", you've already used the 'Blame the intern' option.

    44. Re:Three words by RabidReindeer · · Score: 1

      Probably waterfall as in "Git 'er Dun!", shovel in changes to System X, ram them into production, sorry, no time to clean up or put in reliability, security or backup/recovery processes, got to get the next waterfall "Dun!" Then after a while, someone comes and complains that System X doesn't do what it needs to do, drag it back out and send it over the waterfall again.

    45. Re:Three words by Anonymous Coward · · Score: 0

      You don't? We learned that shit in middle school.

    46. Re:Three words by Hognoxious · · Score: 0

      Fucking bullshit, unless you know:
      1) what the data is
      2) who it's about
      and last but not least
      3) where it's located.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    47. Re:Three words by Anonymous Coward · · Score: 0

      If you had changing requirements, you weren't doing waterfall. Sorry.

      Yeah, you were. It's called never having enough time at the start to gather requirements so everything missing is a CR into the project. No waterfall project I've ever been on has gone smoothly because of this. Moving to a company that did Agile, and did it properly, was a freaking eye opener.

    48. Re:Three words by Archangel+Michael · · Score: 2

      Minimums:

      3 Copies
      2 Locations
      2 Formats
      2 Mediums

      Copies, two local, one remote
      Locations, geographically distinct
      Formats Natural, Raw, compress etc
      Mediums, SATA, USB, Tape, SAN manufacturer etc.

      By Minimum I mean bare minimum. the reality is, there should be cascading copies being made, and Long Term Arching able to restore to a set point in time. For Copies you'll need at least three, more likely more version (date specific). You should separate your copies geographically so that when California gets the big one, or Hurricane Global Warming washes eastern seaboard clean or Tsunami wipes out the Pacific Rim, you can resume business relatively quickly somewhere else. Different formats so that you can get the data you need in a way that makes it easy. You'll want the important parts of the SQL database in a non-database (XLS) format. And you'll want to isolate yourself from medium failures, a date bug in SAN, or Trying to find a floppy drive (old school) to put the floppy in.

      The problem with this guy, was that he was too cocky and didn't have proper backups. IMHO if he did "Live > Local Backup > Offsite Backup he would have been fine. You backup your live data locally, and then make a copy of that backup to remote / offsite. Three copies, two locations, two media, two formats. Done

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    49. Re:Three words by Anonymous Coward · · Score: 0

      did they not squash root ?

    50. Re:Three words by RabidReindeer · · Score: 1

      Past, present. You get called out on sloppy when it all goes to hell. Then it's your fault, you were sloppy.

      The rest of the time, if you try and be meticulous, you're being "unproductive". Nobody got time for unproductive. Costs too much money, too.

    51. Re: Three words by Anonymous Coward · · Score: 0

      If the *only* backup media is mounted during an update ther is no backup.

    52. Re:Three words by Anonymous Coward · · Score: 0

      search only brings up that post

    53. Re:Three words by RabidReindeer · · Score: 1

      A version control system is nothing more than a specialized form of differential backups.

      And something had better be backing up the VCS itself!

    54. Re:Three words by Tuidjy · · Score: 1

      I have not done that one, but I did something close.

      When I came to the US, in the early 90s, I brought all the code I had ever written with me. It included some pretty interesting stuff (I did a lot of assembly programming in Bulgaria, in the late 80s) so it was compressed, encrypted, and contained a second, hidden archive that contained the really 'interesting' stuff.

      I forgot the password... and I forgot it in the dumbest possible way - it was a longish English phrase, and my English at the time was bad enough that I did not know how to spell one of the words. By the time I needed some of the stuff, I had learned the correct spelling, and could not get to my code.

      Much, much later, around 2012, I found the hard drive, and miraculously, it worked. I brute forced it, which I could have done much earlier, but it was never important enough, and it turned out that I had misspelled 'gnarly'. I had some good times going through my 30 year old stuff, as well as seeing what I considered indispensable software at the time. It's hard to believe that we used to write programs that did useful stuff and were less than 256 bytes long.

      --
      No good deed goes unpunished...
    55. Re:Three words by riis138 · · Score: 1

      Yup, its IT 101. Something about this seems fishy.

      --
      Somewhere, something incredible is waiting to be known. -Carl Sagan
    56. Re:Three words by bruce_the_loon · · Score: 1

      Whenever I think of what waterfall development can do to a project, the opening sequence of The Mission comes to mind. https://www.youtube.com/watch?v=xceFQWV3lMM

      --
      Trying to become famous by taking photos. Visit my homepage please.
    57. Re:Three words by mlts · · Score: 1

      I'd say backups and reliability are not easier or harder... but different. Back in the 1990s, there were drive failures, but there were the people who manage to get root and wipe the box for the hell of it. Because of this, people would back up to tape, physically write protect the cartridges so they couldn't be erased, and put them in a safe or have them go offsite.

      When things changed about ten years ago where active hacks were not as common, the focus went to dealing with drive, path, and other hardware failures. For this case, having RAID and a secondary SAN offsite that did async replications.

      Now, with ransomware, people are realizing that RAID isn't a backup, even if it allows for deduplication. That secondary array just will happily take the zeroing commands and apply them.

      Maybe there might be a renaissance for tape. Hard disks are not really a backup medium because malware can zero it out almost instantaneously. Same with shares. Optical is cheap, but in general, the capacity is too small for all for most things. Which brings tape. If someone could bring a tape drive with LTO-6 or 7 capacity to the market at a consumer level price ($1000-1500), has built in encryption, decent backup software, LTFS, compression, and can work on a USB 3 port without shoe-shining itself to oblivion, it just might be a popular seller.

    58. Re:Three words by crunchygranola · · Score: 1

      If you had changing requirements, you weren't doing waterfall. Sorry.

      The corollary to this is that nobody ever did waterfall, really - and that is pretty much the truth.

      They just pretended they were doing it. Agile methods admit the truth.

      --
      Second class citizen of the New Gilded Age
    59. Re: Three words by Anonymous Coward · · Score: 0

      Fireball spell, he said.

    60. Re:Three words by fyngyrz · · Score: 1

      Why would you ever need or even want to mount your backup storage?

      I bought my storage from realdoll.com, you insensitive clod!

      --
      I've fallen off your lawn, and I can't get up.
    61. Re:Three words by myowntrueself · · Score: 1

      Offsite, offline BACKUPS

      You'd have to add 'multiple redundant' to that.

      This guy did have offline backups which were online in order to actually do a backup. If he had two independent sets of backups he'd have been ok. Or, you know, check that the variables weren't empty in the shell script.

      --
      In the free world the media isn't government run; the government is media run.
    62. Re: Three words by Anonymous Coward · · Score: 0

      Is offline means printing all files and websites on paper, right? :P

    63. Re:Three words by Anonymous Coward · · Score: 0

      Yer gotta be kiddin' me. Fiddy-tree hunnert. It ain't hard, see?

    64. Re:Three words by myowntrueself · · Score: 1

      Also, while offsite backups are useful, for a host with 1,535 customers, who are all making changes, even if you have a daily offsite tape backup, you could find yourself missing a lot of changes. I suppose it is better than losing all of the sites, but I'd think that some simple precautions to ensure your online backups were not immediately delete-able with one easy command would pay much higher dividends.

      To be fair, the customers should be making changes, keeping those in a revision control system, backing that up, and uploading to the hosting provider. Never rely on the hosting provider for backups.

      --
      In the free world the media isn't government run; the government is media run.
    65. Re:Three words by Anonymous Coward · · Score: 0

      Wow am I really explaining this?

      You run a local backup to another machine nightly, then every Friday you run another backup to removable media that you take offsite. To do any less then this means you do not have a real backup plan in place.

    66. Re:Three words by Anonymous Coward · · Score: 0

      shambolic = sham + symbolic
      i think that cyber-vandal knew that is what not real waterfall

    67. Re:Three words by cerberusti · · Score: 1

      I did a chmod 700 / home/me on a production server a couple of years ago as root after setting another user up (note the space typo).

      Total downtime was about two minutes, as I figured it out pretty quickly when it did not complete immediately and I hit up to look at my last command.

      A chmod 777 which I let get about as far made it work temporarily, and fortunately RPM actually has a setting to restore permissions... but it was very inconvenient as there are rather a lot of permissions not set by that. I ended up setting up another server and not daring to restart that one.

      rm I am careful enough with that I have never had a problem, but I also stare at that command for a minute before I hit enter if I am root.

      --
      I'm a signature virus. Please copy me to your signature so I can replicate.
    68. Re: Three words by Anonymous Coward · · Score: 0

      "rm -rf" on root is technically undefined behavior according to POSIX. Anything could happen. I forget the exact reason, but I think it was something to do with any rm call that would so happen to attempt to remove some system directory, dev, or something, is undefined. Something like that.

    69. Re:Three words by E-Rock · · Score: 1

      This. A replica is not a backup.

    70. Re: Three words by Anonymous Coward · · Score: 0

      Yep.. And you get it up to the cloud by burning the paper.

    71. Re:Three words by budgenator · · Score: 2

      You'll only get the chopstick wand fireball spell when you achieve level 5 Sys-Admin.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    72. Re:Three words by AmiMoJo · · Score: 1

      Something like Google Nearline or Amazon S3 would be ideal for this. Easy to set up, scales and it's cheap.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    73. Re:Three words by budgenator · · Score: 1

      Format C: press any key to continue

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    74. Re: Three words by Anonymous Coward · · Score: 0

      A few years ago, one of my co-workers intended to run "uname -a", but ran " hostname -a"... as root. On Solaris, it actually changed the hostname to "-a". A few critical pieces of production code behave differently depending on the hostname and "-a" caused strange errors that were misleading.

    75. Re:Three words by swb · · Score: 1

      As I remember it, we went to backups a hell of a lot more in the 1990s than we do now. I think some of it may have just been a software reliability thing where PC based networks and software were just a whole lot less reliable -- direct-access (often shared) databases that shit on files from time to time, applications that wrote gibberish and other types of problems.

      I don't think I ever worked in IT where even PC servers weren't backed with RAID, even if it was tiny 5x1 GB arrays in 1995. They were mostly reliable at surviving disk failures, but I can remember a specific HP model that required the system offline to rebuild a failed drive -- there was no auto-rebuild mode, you had to hit a function key or boot with a floppy to get the thing to rebuild.

      I'm amazed to this day at the people who insist on automated replication as a solution for anything but site failure. It's like nobody thinks that the most *likely* problems aren't going to be catastrophic storage system failures, but some other failure mode that results in all those problems happily replicating everywhere. I do like asynchronous replication of virtual machines (with adjustable retention history, so I can get the previous version with no issues), but that's usually a software product not a storage feature -- storage doesn't do it will unless you have the patience for a zillion VM-size volumes and replicate them separately.

      I agree that an LTO-6 capacity drive that would do USB3 would be great. Flash density is getting to the point where it would probably make it a lot more user friendly to just have 128 GB flash on the tape with a detailed index to allow for faster access and some level of random access to the data, or at least write buffering.

    76. Re:Three words by LinuxIsGarbage · · Score: 1

      How about a special interface for harddrives. Basically like this
      Flip a switch and the drive is writable to complete the backup. Flip the switch and the drive can only be mounted read-only.

    77. Re:Three words by Rei · · Score: 1

      When I was just learning Linux, a friend told me the trick for playing wav files by running "dd if=/path/file.wav of=/dev/dsp". Neat, I thought! But I didn't try it out right away, and by the time I did I didn't remember the name of the sound device. "But that's easy," I thought, "I just want the first sound device, so sda, right?" "dd if=/path/file.wav of=/dev/sda"...

      Yeah, that wasn't a good day...

      For most people back then it wouldn't have been that bad because that was pre-SATA and most people used IDE drives (/dev/hd*). But lucky me, I had a Seagate Cheetah which I was very proud of (10k RPM, wow!), and so had all my most important files on it... :

      --
      "Well, then fire it up and show me what this..." (sigh) ... "coccoon can do."
    78. Re:Three words by Anonymous Coward · · Score: 1

      Sounds like old-school Solaris to me. Nowadays Linux does one better by adding --nuke-from-orbit but it's not POSIX compliant. Also, it requires systemd for some reason.

    79. Re:Three words by david_thornley · · Score: 1

      At home, I've got a lot of stuff in a local Mercurial repository. It's version control. It isn't a backup, because if anything hoses the disk I'm using it hoses the repository as well. It needs to (and in my case does) have backup.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    80. Re:Three words by david_thornley · · Score: 1

      If the customers were IT-savvy enough to keep their own transaction backups, they'd probably be IT-savvy enough not to trust any service where the idiot running it can run one command and wipe out all the data, including the backups.

      It's simply not practical to expect every small organization to have an IT person. Such organizations have to trust somebody.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    81. Re:Three words by Anonymous Coward · · Score: 0

      It's hard to believe that we used to write programs that did useful stuff and were less than 256 bytes long.

      It kind of makes you wonder why computers are so slow...

    82. Re:Three words by magarity · · Score: 1

      Format C: press any key to continue

      That one's foolproof; I have yet to ever format C: because my keyboard doesn't have an any key.

    83. Re:Three words by lgw · · Score: 1

      Sure. It's nice if you can use github, since that's your offsite backup, but lot of people can't. The main thing is, your local site is the "backup" of the production server, at least if you can launch a new prod server quickly with a script.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    84. Re:Three words by Locke2005 · · Score: 1

      I have never done the "rm -rf" cliche, but I have done something stupid: Rebooted a Sun server while logged in remotely from a workstation, not anticipating that I would have to go to the server room anyway and log in locally to bring it back up because I would no longer be able to log in remotely.

      --
      I've abandoned my search for truth; now I'm just looking for some useful delusions.
    85. Re:Three words by Locke2005 · · Score: 1

      I didn't write 256 byte long code, but I did write EPROM code that ran a hand-held terminal with only 256 bytes of ram built into the microcontroller.

      --
      I've abandoned my search for truth; now I'm just looking for some useful delusions.
    86. Re:Three words by Anonymous Coward · · Score: 0

      ZFS is your friend. No Oracle needed. Snapshots built in.

    87. Re:Three words by Anonymous Coward · · Score: 0

      "... a retard ..."

      You are an asshole.

    88. Re:Three words by Anonymous Coward · · Score: 0

      choo choo!

    89. Re:Three words by spire3661 · · Score: 1

      There is no logical way around "Trust, but verify". If you are a business that uses computers, you NEED an IT person like you need an accountant. They dont have to be in-house, but you better have one at the ready.

      --
      Good-bye
    90. Re:Three words by spire3661 · · Score: 1

      Can anyone explain why the verbose arguments require 2 dashes?

      --
      Good-bye
    91. Re: Three words by spire3661 · · Score: 1

      Get the fuck out of here.

      --
      Good-bye
    92. Re:Three words by Anonymous Coward · · Score: 0

      Ah Christ, I've had a long week, I'm laughing my ass off.

    93. Re:Three words by flopsquad · · Score: 1

      Which, I mean, who hasn't accidentally done that? The keys are like right next to each other.

      I'm quite sure this is from an old bash.org post.

      Right you are.

      <tatclass> YOU ALL SUCK DICK
      <tatclass> er.
      <tatclass> hi.
      <andy\code> A common typo.
      <tatclass> the keys are like right next to each other.

      --
      Nothing posted to /. has ever been legal advice, including this.
    94. Re:Three words by Mr0bvious · · Score: 1

      What's that? Have your backups mounted on the same machine?

      Hmm backups are supposed to save your ass in situations like this. Hence the reason to have it offline (and more than one copy).

      The error/incompetence was not the 'rm -rf', that shit happens all the time. It was the lack of any *real* backup.

      Having the one backup mounted on the same machine (IMO) is a misnomer.. That's what I call a "second copy", that's just as vulnerable to loss as the original copy (for some loss vectors).

      So, yeah I expect there's been a number of us do such a silly thing before.. But it's still incompetence.

      Even I have 2 offsite backups of my own personal data on a week rotation system. It's really not difficult to do.

      This guy was looking after the data for over 1500 people... That's incompetence.

      --
      Never happened. True story.
    95. Re:Three words by flopsquad · · Score: 1

      There is an exhaustive discussion here, but the crux of the biscuit is the parser (and conventions about how it should do its thing).

      --
      Nothing posted to /. has ever been legal advice, including this.
    96. Re:Three words by mlts · · Score: 1

      This. Or, if one wanted to be more sophisticated, have a drive controller that would not allow writes to blocks once they were written to. Combine this with the UDF filesystem, and you now have quite usable WORM media.

      Ironic thing, it used to be that all SCSI drives had a jumper to flip them read-only. I used this for anonymous FTP servers back in the 1990s to ensure that even if the server was breached, the files wouldn't be able to be tampered with.

    97. Re:Three words by Eloking · · Score: 1

      Which, I mean, who hasn't accidentally done that? The keys are like right next to each other.

      I'm quite sure this is from an old bash.org post.

      Right you are.


      <tatclass> YOU ALL SUCK DICK

      <tatclass> er.

      <tatclass> hi.

      <andy\code> A common typo.

      <tatclass> the keys are like right next to each other.

      I FUCKING knew it!!!

      Brb I'll go check some old memory, been too long.

      --
      Elok
    98. Re:Three words by mlts · · Score: 1

      The thing about automated replication... salespeople sell it as "cool", and "not your father's tape drive", and people who are not familar with IT, but have the purse strings buy it. People are proud that they toss the tape silos and have new forms of SAN storage like Tintris. It has its uses -- for example, when dealing with virtual machines and upgrades.

      Backup options just seem to have gotten worse over the years, especially for home users.

      Now for blue-sky stuff:

      With SSDs coming down in price, I've wondered about having a LTO tape drive which would have SSD space about twice the size of the tape volume (and a good amount more to help with wear levelling, sector relocation, etc.) When a write is done, the drive can be configured to return that the write was successful either when the write finished with the SSD, or when the write to the tape is complete. Upon eject, the entire SSD is TRIMmed with something like "blkdiscard -s", which generates a new volume encryption key, making all existing data inaccessible. This way, if a tape has sensitive stuff on it, as soon as the drive is power cycled or the tape ejected, the data on the SSD would be gone after all I/O is complete.

      For reading a tape, the SSD could act as a cache, so if one restores a file multiple times or does random read I/O, the drive can just read the entire tape onto the SSD, then hand the data from that.

      As an added bonus, this makes LTFS into a very usable filesystem.

      Of course, there would be some options needed, so that one could turn off the read/write SSD cache if the data written or read is hyper-sensitive and shouldn't hit anywhere but the tape. However, by adding random access and letting the tape drive do the rest, this would not just make the drive faster, but could allow someone to buy it, hook it up to a laptop via USB 2.0 and reliably back it up, with the cache ensuring that the tape drive runs at full tilt 100% without any slowdowns or shoe-shining.

    99. Re: Three words by valdezjuan · · Score: 1

      I did something similar back in the day. I was still getting used to Solaris and ran killall, thinking I was on a Linux server (which just returns the usage). That was a pretty awkward day as I made a mad dash to the colo.

    100. Re:Three words by well_in_theory · · Score: 2

      Suicide Linux; where any typo (as in resulting in command not found) instigates a full 'sudo rm -rf /'. Available as a debian package. https://qntm.org/suicide

    101. Re:Three words by Anonymous Coward · · Score: 0

      Never happened to me. I always mv do a del/ directory instead and later 'rm -rf -- del/' which leave no room of error; I make sure I really want to delete what's in here, and it cannot delete anything outside of del/.

    102. Re: Three words by Anonymous Coward · · Score: 0

      A local IT person can make mistakes too, someone is trusted regardless of their location.

    103. Re: Three words by Anonymous Coward · · Score: 0

      -vrygd would be 5 arguments
      --vrygd would be 1 argument

      Also words tend to have multiple letters that are the same.

    104. Re:Three words by YukariHirai · · Score: 1

      Four words: filesystem with automatic snapshots.

      That's very good to have, but should not by any means be all you're relying on. Probably wouldn't have helped the guy in this story, given all the other boneheaded things about his setup.

    105. Re:Three words by Cytotoxic · · Score: 1

      Yeah, I did that setting up my first ever hosts security in Linux back in the old slackware days. I was on a remote terminal session and being careful - making one change at a time.

      So the first thing I did was put DENY ALL in an empty hosts file. A millisecond before I hit save I had a thought.... ooops. And the walk of shame to the console ensued. Didn't make that mistake again.

    106. Re:Three words by DrJimbo · · Score: 1

      Can anyone explain why the verbose arguments require 2 dashes?

      It is to prevent name-space collisions when you "stack" short options as in "-rf" (which means the same thing as "-r -f"). The convention often used is that multiple letters after a single dash are stacked single character options while multiple letters after two dashes is a single verbose option. This convention makes things easier for the user and the designer because neither one has to worry about being able to spell out a verbose option with single character options.

      --
      We don't see the world as it is, we see it as we are.
      -- Anais Nin
    107. Re:Three words by mwvdlee · · Score: 1

      You do know constant plugging and unplugging of storage will wear out the connectors, right?

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    108. Re: Three words by invictusvoyd · · Score: 1

      It will still "rm" a lot of other data which if not backed up could be unrecoverable.

    109. Re: Three words by stealth_finger · · Score: 1

      You get a pen and write down the 1/0s

      --
      Wanna buy a shirt?
      https://www.redbubble.com/people/stealthfinger/shop?asc=u
    110. Re:Three words by jabuzz · · Score: 1

      Given in the UK that it is a legal requirement to retain the last seven years of financial records in case HMRC decides to do a tax inspection, and I imagine that most countries are the same.

      Also in the higher education sector (where I work) all research data has to be keep for at least 10 years. Again I imagine most sane countries are also the same.

      In addition law firms have requirements for retention of documents that go well beyond two years. There is good reason why documents going back decades could be appropriated from Mossack Fonseca.

    111. Re:Three words by Anonymous Coward · · Score: 0

      The line of code was good, his understanding of it was not.

    112. Re: Three words by Billly+Gates · · Score: 1

      What do you mean leave tape 10 years ago! Shoot I have to manually come into work every day for LTO3 tapes on our Windows Server 2000 and 2003 backup systems. Data worth millions. Nothing important or anything

    113. Re:Three words by swb · · Score: 1

      I'd like a few things...

      A tape cartridge with enough solid state storage such that the drawbacks of LTFS like slow seek times can be avoided for frequently read files and the ability to re-coalesce data on the tape to avoid holes created by deleting files from a linear mechanism.

      A filesystem that does hierarchical storage management, where stale data is dumped off to tape drives but where links remain in the original file system allowing access to the data as if it was on disk. This allows you to have a much larger data pool in a unified filesystem. A changer would help here, but I could live with a prompt telling me to insert tape X.

    114. Re:Three words by Rei · · Score: 1

      Haha, reminds me of when I was coding for a LP MUD. I ended up getting into a sort of "wizard battle" with other coders... one person would make a "dest" (kick you off the server) tool, the other would write a tool to counter it, the other would write a tool to counter that, and so forth. It gets complicated fast. Anyway, I was trying out a new tool and due to a bug it thought I was attacking myself, and dested me in response and then fell on the floor. It then proceeded to dest anyone else in the room on sight. Said room just happened to be the login room, so nobody could log back in - and the person who had access to the server for a reboot was rarely available.

      Not good! However, from my FTP access I was able to determine that there was still one coder logged on, in a different room and blissfully unaware of what had transpired, still actively uploading and changing files. But I had no way to contact him. However, I noticed that I had write access to the directory where he was modifying files, so I created a file with a name like "AMMON - DO NOT LOG OFF OR GO TO THE LOGIN ROOM - PLEASE READ ME.txt", with a summary of the problem and the solution to fix it. About 20 minutes later he noticed the file, destroyed my buggy object, and everyone could log back on.

      All I can say is that I'm glad it happened with that version of the object, because the next version I had been planning to make was going to try to counter attempts to hide from the player search function by means of rapidly teleporting from room to room and object to object, looking for characteristics that matched the target - a sort of hunter-killer drone. Needless to say, that version got cancelled ;)

      --
      "Well, then fire it up and show me what this..." (sigh) ... "coccoon can do."
    115. Re: Three words by Eunuchswear · · Score: 1

      In other words the story is bullshit -- which is perhaps why it is no longer on server fault.

      http://serverfault.com/questions/769357/recovering-from-a-rm-rf

      --
      Watch this Heartland Institute video
    116. Re:Three words by Anonymous Coward · · Score: 0

      The ironic thing is that Windows had a HSM filesystem, and it wound up being tossed in Windows Server 2008 and newer. You could create a file share, assign a tape partition to it, and it would do exactly what the above poster wanted, except without the ability to deal with holes from deleting files. Backups were handled by having two tape drives, one tape drive reading the filesystem, the other writing the backups.

      Tape is quite useful, but because it isn't the "in" thing and can't be hawked by the suit wearing orangutans that sell SAN storage and cloud stuff, it gets viewed as useless... well, until the shiny new products get completely trashed by ransomware.

    117. Re:Three words by david_thornley · · Score: 1

      And we're now in the problem of a non-IT person trying to judge an IT person. The idiot's clients doubtless thought he was a decent one.

      What would really help here is certification. If I wanted an accountant, I'd go to a CPA, so I'd be sure of getting at least a mediocre one. When I need a lawyer, I ask the local bar association for a referral, and get one who may be mediocre but is at least adequate for what I need legal help for. If there were a certification process that would say "this IT guy is not an idiot", it would help the non-IT people.

      I know there's a lot of arguments about it, but this is one case where it would be very useful.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    118. Re:Three words by Ol+Olsoc · · Score: 1

      In this context, the guy is the cloud provider. His customers, if they're sensible, will have their own backups and so will be able to recover, but they also won't trust his business much if that's their recovery strategy from his incompetence.

      So you back up in the cloud, then back up just like you used to before the cloud?

      This cloud is an amazing thing that allows us to add another level of work.

      Do you back up your local backups in the cloud, and back up your cloud backup locally? We need to get the cloud in the cloud, now that would be the ultimate.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    119. Re:Three words by Fetko · · Score: 2

      SysAdmin hardcore mode.

    120. Re:Three words by tigersha · · Score: 1

      You forgot --nuke-the-site-from-orbit

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    121. Re:Three words by spire3661 · · Score: 1

      Just no. CPAs are certified because of how OLD the profession is and the mountain of actual malfeasance they have caused. Its a very different thing. CPAs have incredibly detailed rules about how to do their work. They have a standard model they must follow. That would kill good IT. You would hamstring us all so idiots dont have to think.

      --
      Good-bye
    122. Re:Three words by doccus · · Score: 1

      This cloud is an amazing thing that allows us to add another level of work....

      The "paperless society" .. Hyuk! Remember that? Added another entirely redundant level of work.

    123. Re: Three words by thegarbz · · Score: 1

      No it won't. It will not delete a single file. It will throw a warning in the console and remind you that it's a dangerous operation and ask you to retype the command with --no-preserve-root.

    124. Re: Three words by Anonymous Coward · · Score: 0

      The time comes to mind when I ran an update sql query forgetting to include the where clause...

    125. Re: Three words by Cabriel · · Score: 1

      Sounds like something Dana would have done. :) Oh Kesac. The man, the Myth, the Legend.

      If this doesn't make sense, you probably aren't who I was expecting.

    126. Re:Three words by Ol+Olsoc · · Score: 1

      This cloud is an amazing thing that allows us to add another level of work....

      The "paperless society" .. Hyuk! Remember that? Added another entirely redundant level of work.

      I have many containers of the paperless society. And at work, as one piece of paper was eliminated, two took it's place.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    127. Re: Three words by dgallard · · Score: 1

      The more apt analogy is of course to forget the WHERE clause in: DELETE FROM ;

    128. Re:Three words by Anpatt7 · · Score: 1

      Aw, I wanted to do that...

      --
      If we start ignoring all of our constitutional rights because of terrorism, then what are we fighting for at that point?
    129. Re:Three words by TheRaven64 · · Score: 1

      A good backup strategy has both on-site and off-site backups. If either is broken then the other can be used to recover.

      --
      I am TheRaven on Soylent News
    130. Re:Three words by Ol+Olsoc · · Score: 1

      A good backup strategy has both on-site and off-site backups. If either is broken then the other can be used to recover.

      So now instead of the cloud as your everything solution, you have to do exactly what you did before, and add the cloud as just extra work.

      Quite the bill of goods.

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    131. Re:Three words by Anonymous Coward · · Score: 0

      filesystem with automatic snapshots

      Although this is still defeated by 'cat /dev/zero > /dev/sda' (had a housemate who accidentally did this when trying to wipe his external drive). Yes it's unlikely in a production environment, yet I'm sure someone will still find a way.

    132. Re:Three words by TheRaven64 · · Score: 1

      Where were you doing off-site backups before?

      --
      I am TheRaven on Soylent News
    133. Re:Three words by MoarSauce123 · · Score: 1

      Yep! And before rfing anything make yet another backup locally, even if it on low tier consumer grade storage. Plus, no matter what it is, never run a command on all servers. Easy to say now, but I bet we all got burned by our own sloppy work. And those who have not, now is the time to craft check lists and start using them.

    134. Re:Three words by Ol+Olsoc · · Score: 1

      Where were you doing off-site backups before?

      local multiple backups under my control stored in another building.

      Accountability, not just another customer. It works pretty well

      --
      The shepherds did so well protecting the flock that the sheep no longer believed that wolves existed.
    135. Re:Three words by david_thornley · · Score: 1

      so idiots dont have to think.

      No, so people not in IT don't have to learn a lot about IT. A bad IT person can do a lot of harm, and a non-IT person is going to have a lot of trouble telling a good one from a bad one. This is a real problem, and it would be nice to have some approach towards solving it.

      If you don't like the idea of certification, do you have another idea to allow an entrepeneur to recognize a competent IT person?

      Certifications don't have to come with smothering rules. As I said, I got a lawyer referral from the local bar association, and this means I got somebody reasonably competent (probably not brilliant). My lawyer needs to know what's going on, and how to get me through the court system without serious mistakes. He does not follow rigid rules; his job is to get me not convicted for a misdemeanor I didn't commit.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  2. Repeat after me... by Anonymous Coward · · Score: 0

    ..."In the cloud" does not mean "Is backed up."

    1. Re:Repeat after me... by Hylandr · · Score: 1

      Adding to AC's astute observation: ..."In the cloud" does not mean "Is backed up." ...'Deleted' from the cloud does not always mean 'deleted'. ;)

      --
      ~ People that think they are better than anyone else for any reason are the cause of all the strife in the world.
    2. Re:Repeat after me... by Anonymous Coward · · Score: 0

      a little butt-hurt there mr. sensitive? you're sure plural there mr. presumptious.

    3. Re:Repeat after me... by NatasRevol · · Score: 2

      For most users the cloud is more reliable and more accessible than anything they'll ever be able to do in a SO/HO environment.

      The problem is that medium sized (1000+ employees) seem to think this too.

      And then have no backups, version control or anything else because some PHB said 'put it in the cloud, and stop arguing with me.' to the IT engineers who wanted local & remote backups, version controls, redundancy of hardware, network and power, etc, etc, etc.

      --
      There are two types of people in the world: Those who crave closure
    4. Re:Repeat after me... by Anonymous Coward · · Score: 0

      Butt hurt? WTF are you even talking about? You're just another moron.

    5. Re:Repeat after me... by Anonymous Coward · · Score: 0

      Since "in the cloud" means on another fucking machine (and not just a mounted filesystem), it certainly does.

    6. Re:Repeat after me... by Anonymous Coward · · Score: 0

      Please tell that to the management people. I worked in a company, which CIO mandated virtualization to be the solution for everything. In practice that dumbass then "replicated" one mission critical system into few vmware images running on a single server HW. And he also designed the Oracle SQL server backups to be done by cloning the full vmware images from the host system when the guest OS was running them. Not so surprisingly the service has had some data losses..

    7. Re:Repeat after me... by YukariHirai · · Score: 1

      It's where the principles of Murphy's Law and Schroedinger's Cat intersect - Murphy Schroedinger's Data, if you will.

      Data stored in the cloud both exists and doesn't exist simultaneously; if you need the data it got accidentally deleted and there's no way to retrieve it, and if you delete the data because you don't want it seen, it turns out there's another copy and it will be all over the open internet shortly.

  3. --no-preserve-root by zopper · · Score: 5, Informative

    Does he use --no-preserve-root by default? I think that it is there for many years. Of course, if his servers are running on something from 2004, then his rm might be without this safeguard...

    1. Re:--no-preserve-root by Anonymous Coward · · Score: 1

      That option doesn't work if you are trolling...

    2. Re:--no-preserve-root by mysidia · · Score: 1

      This prevents the root itself from being deleted, but you can still do rm -rf /* even with no --no-preserve-root There are iterations which still accidentally cause a full system deletion, even with this safeguard in place.

    3. Re:--no-preserve-root by piojo · · Score: 1

      You can't prevent the computer from doing what the user tells it to in all cases.

      For what it's worth, removing "*" recursively is a weird use case (99% of the time, you would just delete the directory), so "rm -r $foo/*" -> "rm -r /*" is unlikely to occur. (For a vaccine, 99% is a pretty damn good rate of protection.)

      If "rm *" or "rm foo/*" were disallowed by all shells (if "rm" were removed as a command and only implemented as a shell builtin), this problem could be eradicated. A more difficult workaround would be to use a programming language with stronger typing, so arguments would not be computed by string interpolation. For example, if the guy's code had run "dir = Path.Combine(foo, bar)" and then deleted the contents of that dir, an exception would have stopped execution before ever getting to the line that does the deletion.

      --
      A cat can't teach a dog to bark.
    4. Re:--no-preserve-root by mysidia · · Score: 1

      For what it's worth, removing "*" recursively is a weird use case (99% of the time, you would just delete the directory),

      Is that 99% supposed to be based on actual research? I have seen developers commit many accidents involving the rm command and shell globbing. Also, many newbies using Shell globbing when it is not needed, and command options when they are not needed such as "-r", Or running as a root user when they should not be.

      One example is the user types 'rm -rf * .o' when they intended to key 'rm -rf *.o'

      If their Current Working Directory happens to be /, then it's equivalent to rm -rf /*.

    5. Re:--no-preserve-root by allo · · Score: 1

      A shell is not built to prevent you from shooting yourself into the foot. It's built to optimize the aiming, but let's you decide where you aim at.

      But nothing prevents you from using an alias or function in your shell or replace rm by a script, which calls rm.real. You may find yourself at getting the habit to type rm.real all the time. Ask yourself, why people use "-f" all the time. They get used to it, because distros alias "rm" to "rm -i", but "-f" overrides this.

    6. Re:--no-preserve-root by piojo · · Score: 1

      I think we mostly agree. You'll note I didn't suggest making it harder to recursively delete "*/". I suggested disallowing it completely. Directories could be removed recursively, but not emptied recursively. "rm -r $foo" does not present the same problem as "rm -r $foo/*" when foo is undefined. "rm -r /$foo" would still present a problem, but --preserve-root mitigates that, plus who would store an absolute path as a relative path like that? (Okay, I'm sure it happens every day, but it reduces the likelihood of this problem.)

      --
      A cat can't teach a dog to bark.
    7. Re:--no-preserve-root by piojo · · Score: 1

      Yes, that's what I'm saying. The cases where you legitimately want to recursively delete a directory's contents, but not the directory itself or its dotfiles, are much rarer than the cases where you just need "rm -r dir" without globbing.

      I just made up the 99% figure, but since you're not contradicting me or providing a contradicting use case, is that agreement?

      --
      A cat can't teach a dog to bark.
    8. Re:--no-preserve-root by mysidia · · Score: 1

      I just made up the 99% figure, but since you're not contradicting me or providing a contradicting use case, is that agreement?

      Nope. I figure it's closer to 50% of the time rm -rf $foo/ and 40% of the time rm -rf $foo/* and 10% of the time rm -rf $foo/*${something}*

    9. Re:--no-preserve-root by piojo · · Score: 1

      rm -rf $foo/*${something}*

      Oh, I didn't think of that one. However, it's still distinct from $foo/*, as the shell can tell the difference even when the variable is empty or unset (as long as "rm" is a shell builtin). However, that made me think of a much bigger problem: "rm $foo/*/" to get rid of directories. This is a common use case (for me), so I cannot think of a non-restrictive check will prevent this from wiping out the root folders when $foo is unset.

      What do you use "rm $foo/*" for? I find that if I want to empty a directory, I generally want it deleted as well.

      --
      A cat can't teach a dog to bark.
    10. Re:--no-preserve-root by mysidia · · Score: 1

      What do you use "rm $foo/*" for? I find that if I want to empty a directory, I generally want it deleted as well.

      Maybe don't want to delete the directory if it contains temporary or spool files, for example
      rm -rf $tmpdir/*

      Of course it would be possible to design new safeguards, But I think they're unlikely to be implemented...
      1. Shell modification: When a variable is unset Or set to Blank, the shell should return an error by default, instead of executing the command with a blank; require a declarative structure such as ${tmpdir:-""}
      OR Shell modification with /bin/rm modification:
      2. The shell is modified to export an environment variable containing the *ACTUAL* command line After variable expansion, and after compression of globbing E.g. /** to /*, but before "list of files" expansion.
      3. Rm is modified to check if a subdirectory of / is referenced; If so, the variable is inspected for shell globbing. Rm is modified to require a command line option to proceed with the delete if files in / or an immediate subdirectory were expanded by Shell globbing
      OR /bin/rm modification:
      4. Instead of just checking for "/" check for the 2nd level as well. Any directory directly under / has a --no-preserve-first that also has to be used, instead of just a --no-preserve root.

      5. This gets expanded with an /etc file listing critical system directories. Any recursive deletion of the root of a critical system directory requires a --no-preserve-system

    11. Re:--no-preserve-root by mysidia · · Score: 1

      A shell is not built to prevent you from shooting yourself into the foot. It's built to optimize the aiming

      It is a UI design defect however, that it makes it too easy to accidentally aim it in the wrong place and shoot. Even firearms generally have a trigger safety of some kind.

    12. Re:--no-preserve-root by allo · · Score: 1

      you cannot escape bad wildcards by just enumberating a few. Put a space on the wrong side of a * and you're fucked.
      But try "set -u" in bash and it will generate an error for uninitalized variables.
      Ansible should do so as well. (and uses double braces like jinja2, not single ones)

    13. Re:--no-preserve-root by allo · · Score: 1

      But you're thinking about a gun. That's what a filemanager is, if with gui or something like midnight commander. Using raw shell commands is more like working with the explosives than working with the gun. If you choose to use rather low level tools, because they are effective, you agree that you know how to use them.

      And even then you can alias rm to "rm -i". Just DO NOT use "-f" ever, then.

  4. a hard life lesson by Anonymous Coward · · Score: 0

    two words: offline backup

    It's amazing how such simple things seem to be so hard to sink in for way too many "professionals".

  5. Did you read anything? by Anonymous Coward · · Score: 0

    TFA and even TFS says he deleted all the backups too. In a hurry to try and get first post?

  6. Which command? by Anonymous Coward · · Score: 0

    "Rm -rf" would mark the block as empty, and unless the programmer hasn't written anything new, he should be able to recover nearly all of the data

    Which command does one type to do that? (Note: /root, /usr/sbin, /etc, etc. are gone...)

    1. Re:Which command? by danbob999 · · Score: 1

      He can boot on a CD or USB and recover most files.

    2. Re:Which command? by Anonymous Coward · · Score: 0

      There's loads of recovery software out there to do just this. The discs aren't even damaged, so this is a trivial case. Just mount your drives on some good machine, or depending on your setup just boot off of a live cd, and press go. This isn't brain surgery here. (though for him it may be, I suppose)

    3. Re:Which command? by Anonymous Coward · · Score: 1

      How does one boot the cloud from a CD?

    4. Re:Which command? by gmack · · Score: 1

      That will work unless the drive was on an SSD and the OS told the drive to TRIM the deleted blocks.

    5. Re:Which command? by Anonymous Coward · · Score: 0

      They aren't his disks....they're amazon's.

      Now what?

    6. Re:Which command? by Anonymous Coward · · Score: 0

      What is this software? I deleted a disc image on ext4 and couldn't recover it, though I dearly wanted to.

      How come ext3 and ext4 are journalling file-systems but they can't be rolled back?

    7. Re:Which command? by Anonymous Coward · · Score: 0

      How come ext3 and ext4 are journalling file-systems but they can't be rolled back?

      That's not what the journal is for. It's for recovery to a consistent state in the event of a crash, not for undoing 'deliberate' actions (e.g. commands that complete normally)

      If you want proper 'undo' for updates/deletes you need some sort of versioning file system.
      But that can lead to problems and is usually overkill (how many old versions do you keep, how much space do you allow them, how do you identify the 'right' old version etc.). Regular backups are the 'normal' solution.

  7. Wasn't he trolling? by anlag · · Score: 5, Insightful

    I saw the post on ServerFault, and while the original scenario could have happened, the OP's follow-up blunder to reverse the input and output parameters of dd when trying to preserve the disk seemed just a wee bit too unlikely. I looked at the article to see if there was any additional data to suggest this was real, but it seems entirely based on the SF thread. Until corroborated, I'm going to call bs.

    1. Re:Wasn't he trolling? by Anonymous Coward · · Score: 0

      Plus, one mistake of mixing up letters doesn't do any harm and if he actually did it backwards "dd of=/dev/sda if=/home/user/disk.img" that wouldn't do anything. The image file is empty and therefore nothing would be copied, which means all the data is still there.

    2. Re:Wasn't he trolling? by Anonymous Coward · · Score: 0

      Many moons ago, I worked in a department that did backups of an important (basically, "only") departmental computer to removable disk packs (the old "washing machine" drives) on a rotating basis. None of the disk packs were off-sited (I don't know why -- it would have been easy to at least send them to another building on the campus -- there were nearly 100 distinct buildings on this company's huge campus to give pretty good protection against fire or, it turns out, some protection against bonehead admins).

      One night, the admin screwed something up badly and wiped the physically mounted disks. "No problem, I'll restore from backups" was their response. However, by the next morning, the admin had managed to end up with three or four sets of disks which were all copies of the ones that had been wiped -- apparently there was just a bit of confusion about source and destination drives and when the system "didn't work" after the restore, they went back to the previous generation of backup since, obviously, the problem was that the backup was bad.

      Many man-years were consumed rewriting software that was lost (in many cases, someone had a listing of some version of the modules - but of course few up to date listings and no "snapshot" of consistent modules) and reentering data.

      That made me believe almost any story of stupidity.

    3. Re:Wasn't he trolling? by crunchygranola · · Score: 4, Interesting

      My operating theory is that the guy is constructing an alibi. Perhaps he has gotten wind of an investigation and wants to look like a hapless idiot and not someone engaged in destroying evidence.

      --
      Second class citizen of the New Gilded Age
    4. Re: Wasn't he trolling? by Anonymous Coward · · Score: 0

      An alibi? OMG - this is about Hillary's email server!

  8. Meh by Anrego · · Score: 2

    This is borderline bait at this point.

    Can this example finally serve as a textbook example of why you need to make offsite backups that are physically removed from the systems you're archiving?

    There are plenty of examples already and keeping a set of backups physically disconnected from running infrastructure is pretty well established practice, with random software bugs and screw ups being just one of many reasons. That said people will continue to have all their backups fully accessible (and destroyable) or just not back things up at all and things like this will continue to happen.

    Guy can possibly recover the data, but the company is probably still screwed reputation wise.

    1. Re: Meh by Anonymous Coward · · Score: 0

      I laughed when he said he has 1535 customers. I think the operative verb is had if this really happened.

    2. Re:Meh by thegarbz · · Score: 1

      There are plenty of examples already and keeping a set of backups physically disconnected from running infrastructure is pretty well established practice

      This seems to be more of a case for multiple backups instead of online vs offline backups. The way I read the summary it looks like the bug occurred after mounting the backup which could happen in any poorly coded scenario regardless of how secure you leave your offline backups.

    3. Re:Meh by Anrego · · Score: 1

      Right, at minimum there should be two sets, and both should never be connected at the same time for exactly this kinda reason.

    4. Re:Meh by im_thatoneguy · · Score: 1

      There are plenty of examples already and keeping a set of backups physically disconnected from running infrastructure is pretty well established practice

      Pixar circa ToyStory 2 springs to mind.

      https://www.techdirt.com/artic...

  9. manishs clearly has no idea... by Anonymous Coward · · Score: 0

    ... about unix filesystems. Or about all the other customers of this webhoster guy's hosting company.

    You'd have to completely freeze everything then spend a fsckton of time with fs debuggers. That, or you restore your offsite backups. Er, right. So those "offsite backups" weren't very offsite now then, hm?

    1. Re:manishs clearly has no idea... by gnupun · · Score: 0

      This is also a case of stupid OS design. It's not the 1970s anymore and having a file delete operation (rm) without undo means the OS is designed (or un-designed) by retards. Making a lame excuse about offline backups is just a diversion away from the real problem: lack of a file delete undo operation.

    2. Re:manishs clearly has no idea... by merky1 · · Score: 0

      Don't worry, systemd will correct this long standing bug, and we will rejoice that it has saved us from 30 years of computing standards.

      --
      --WooooHoooo--
    3. Re:manishs clearly has no idea... by DutchUncle · · Score: 1

      Disagree. At some level, a real command for a real delete has to happen. This should be like RDP being built on top of UDP. The script could just as easily be deleting prev.active.stuff, then renaming active.stuff to prev.active.stuff, rather than directly deleting active.stuff. Oh, wait, that would imply building a system with enough extra capacity to maintain a first generation hot backup - which is what the "undo" does anyway.

    4. Re:manishs clearly has no idea... by flargleblarg · · Score: 1

      Why would anyone ever want to rm -rf /? Much better to reformat the disk and run mkfs.

    5. Re:manishs clearly has no idea... by flargleblarg · · Score: 1

      Actually, that's stupid filesystem design, not stupid operating system design.

  10. Empathy by The-Ixian · · Score: 4, Funny

    I have that cold feeling in my stomach just reading this summary. ick.

    I did something similar (though not quite so destructive) nearly 20 years ago when I was first learning Linux.

    I my case I was trying to get rid of all the hidden files in root's (/root) home dir using 'rm -rf .*'

    Guess what that did?

    Yeah, that wasn't a highlight of my career...

    --
    My eyes reflect the stars and a smile lights up my face.
    1. Re:Empathy by Anonymous Coward · · Score: 0

      Since we're telling stories. Mine takes place over 20 years ago. I had developed a (bad) habit of using the DOS DELTREE command to quickly remove entire directories.

      I was installing a niche network analysis package on our file server which had an odd bug: if you tried to change the default install directory, the installer would fail and leave the new directory cross-linked to the root of the drive (C:\, in this case).

      Being me, I entered DELTREE cross-linked_directory , and then started to wonder why it was taking so long...

    2. Re:Empathy by c · · Score: 1

      I did something similar (though not quite so destructive) nearly 20 years ago when I was first learning Linux.

      Same here. Thought I was in /tmp, was actually in /, and did an "rm -rf *".

      Fortunately, things were a bit slower back then and glob ordering being what it is I was able to ctrl-C it before it got further than /bin. With rcp being in /usr/bin/, I was able to (carefully) recover from another system.

      --
      Log in or piss off.
    3. Re:Empathy by Scarred+Intellect · · Score: 1

      My turn.

      I was extracted a tarball into my home directory. I was done with it and the contents in my home directory and wanted to remove them. Knowing a tarball of foobar.tar.gz typically extracts to ./foobar, I typed:

      rm foo[TAB]* -rf

      I expected bash to fill in to the . in foobar.tar.gz, instead, somehow I hit a space between [TAB] and *, executing the command: rm foobar * /rf on my entire home directory (meant to execute rm foobar* -rf). And this was before I knew how to do data recovery.

      Similar misuse of rm -rf by a friend deleted a network drive containing my movie library, but I WAS able to recover that.

      I'm much more careful of the use of tab and * in the command line now.

    4. Re:Empathy by Anonymous Coward · · Score: 0

      cross links? In DOS? Huh?

    5. Re: Empathy by Anonymous Coward · · Score: 0

      Ok, does it not erase only files beginning with a point ??? What else does that erase ???

    6. Re:Empathy by cruff · · Score: 1

      Fortunately, things were a bit slower back then and glob ordering being what it is I was able to ctrl-C it before it got further than /bin. With rcp being in /usr/bin/, I was able to (carefully) recover from another system.

      I also did that years ago on a Sun 1 system, only got part way through /bin. Recovered the contents of /bin from a release tape. Learned to be a bit careful after that.

    7. Re:Empathy by amicusNYCL · · Score: 1

      Well, I have good news and bad news. The good news is that I've removed all of the hidden files.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    8. Re: Empathy by The-Ixian · · Score: 0

      . is a regex term that means "any single character"

      So... it DID delete all the hidden files. But it also deleted ../* erasing everything a level up from the directory as well (which was the root of that file system).

      --
      My eyes reflect the stars and a smile lights up my face.
    9. Re: Empathy by TheReaperD · · Score: 1

      They were available but, there was no commands or binaries to manipulate them supplied. They still don't have those commands; you have to use 3rd party tools.

      --
      "Be particularly skeptical when presented with evidence confirming what you already believe." -
    10. Re:Empathy by Anonymous Coward · · Score: 0

      Before anyone gets worried about all these idiots in this thread, let me re-assure you.
      -- I have NEVER had this happen to me ever.
      Lot's of people have never had this happen to them.

      As a matter of fact when I was hired one of the questions on the first interview was... Have you ever deleted your entire file system by accident using rm -rf ??
      And I said... no.
      I mean, who would hire an idiot like this?

    11. Re: Empathy by Anonymous Coward · · Score: 1

      No, it's NOT regex.

    12. Re: Empathy by alexhs · · Score: 1

      Try `ls .*`. You'll find that "." matches, but more importantly, ".." matches too. So, if you have the rights on the parent directory, `rm.rf .*` == `rm -rf ..`
      `rm -f .*` works just fine for non-directories, but you need to take care of directories separately.
      `rm -rf .[A-Za-z_0-9]*` will likely do the job, but if you've funny characters in second position, delete them specifically afterwards.

      --
      I have discovered a truly marvelous proof of killer sig, which this margin is too narrow to contain.
    13. Re: Empathy by Anonymous Coward · · Score: 0

      rm does not have any concept of regex and . is a literal. The ? is used as a wildcard.

      $ ls R?A*
      README

      $ ls R.A*
      ls: cannot access 'R.A*': No such file or directory

      The . only expands when it is the first character, because . is 'cwd' and .. is 'pwd', not because of any regex...so it's basically ./*, ../*, and .*

      $ ls .* .hidden .:
      README ..:
      test-dir

    14. Re: Empathy by The-Ixian · · Score: 1

      Well. whatever. The result was that .* matched ..* as well as everything in the directory.

      Sorry.

      --
      My eyes reflect the stars and a smile lights up my face.
    15. Re:Empathy by The-Ixian · · Score: 1

      A good manager will hire someone who has made a few catastrophic mistakes (and can admit to it) because a person like that, presumably, has A) learned a hard lesson and is not as likely to make other mistakes and B) will be more likely to admit to making a mistake instead of trying to cover it up.

      --
      My eyes reflect the stars and a smile lights up my face.
    16. Re:Empathy by Anonymous Coward · · Score: 0

      I've accidentally dropped an entire table before (had to stay up all night restoring the database from a combination of audit logs and week-old backed up data). I also have accidentally wiped all our entities off another platform when working on an API integration. Strangely, I did it in the UI while trying to delete a few test entries. Luckily, I was able to restore almost everything since it was generated data to begin with. Anything that was manually created, we were no longer using. I also knew a co-worker at another company that accidentally dropped the entire company database but we were able to restore enough of it. No one got fired in any of these cases, but plenty of teasing occurred.

    17. Re:Empathy by Darinbob · · Score: 1

      I did the "rm dir/ *" by mistake once. Ie, a misplaced space there. I hit ctrl-C immediately but it was too late. Student account so no backups but at least it wasn't course work.

    18. Re: Empathy by fhage · · Score: 1

      . is a regex term that means "any single character"

      Standard Unix shells like bash use the ? character as a match for any single character.

      I remove special files using 'rm -rf .??*'

      For over 25 years I've always aliased rm to 'rm -i' in interactive shells. I run my rm command and verify it covers the intended targets by hitting Y a couple of times, then I cntrl C.

      Up arrow, add a backslash to the front and hit return to complete the rm without prompts. When I'm drunk with confidence, I preface my 'rm' command with a backslash.

      Before command line editing I used; 'yes | !!' as the safe rm override.

    19. Re:Empathy by squiggleslash · · Score: 1

      My mistake was, on seeing lots of copies of /etc/passwd entitled "passwd~", "passwd.BAK", "passwd.bak", etc, thinking that "rm /etc/passwd*" would remove those files, because that means "remove anything beginning with passwd but with something on the end, right?"

      I'd say rookie mistake, but I'd been using *ix for something like seven years in one form or another, and other operating systems that used * (or in AmigaOS's case #?) for even longer, so there was really no excuse.

      --
      You are not alone. This is not normal. None of this is normal.
    20. Re:Empathy by Anonymous Coward · · Score: 0

      Aw, that's easy to recover from, just do 'mr -rf .*'

    21. Re:Empathy by jordan314 · · Score: 1

      I did something similar with a symlink to an SSH mounted server. rm -rf server/ instead of rm -rf server Then I learned 'unlink' is a better option http://stackoverflow.com/quest...

    22. Re:Empathy by microTodd · · Score: 1

      Hell, we've all done that. Check out this lovely gem:

      #!/bin/perl
      system("rm $foo/$bar");

      Not my finest hour, either.

      --
      "You cannot find out which view is the right one by science in the ordinary sense." - C.S. Lewis on Intelligent Design
    23. Re:Empathy by shawn2772 · · Score: 1

      Along with all the other old stories, I'll add mine, which I think is even funnier.

      I got a NeXTstation back in 1991, my first Unix box, though I'd used a few *nix variants in the lab at school -- but without root. The NeXTstation came with a 110 MB hard drive, which wasn't a lot of space even then, and what with the cool pre-installed apps, complete works of Shakespeare and some other stuff, arrived something like 80% full (in fairness to NeXT, the primary purpose of NeXTstations with such small drives was to run with NFS-mounted home directories, so it's not quite as ridiculous as it sounds). Well, my drive got full pretty quickly and I went looking for stuff to delete. I was having a hard time until I found this directory called "/usr/lib" that contained scads of big files with the extension "so".

      I knew I didn't use any "so" files, whatever they were, so I deleted them.

      Of course, the system kept running just fine for a while, at least as long as I didn't start any new apps. But it gradually become completely non-functional, and when I tried to reboot it failed to come up at all.

      Getting it fixed required a 90-minute drive to the University of Utah, to find someone who could netboot the thing from their cube and reinstall the OS. While explaining to me -- in excruciating detail -- just what shared libraries are and why they're important.

      I dropped a few hundred bucks on a whopping new 340 MB drive the next time I ran out of space.

    24. Re:Empathy by wbr1 · · Score: 1

      My worst gaffe was scripting a 20k home folder move to a new disk. This went fine, but I did not replace the path in the passwd file correctly. This resulted in about 5k calls to our call center as shell accounts and email broke. Fortunately I backed up the passed file first. Ahhhh 1998.

      --
      Silence is a state of mime.
    25. Re:Empathy by bloodhawk · · Score: 1

      I remember getting given my first computer from Tandy back in the 80's I was inquisitive and was testing what everything did. sadly one of the first commands I found on my DOS 3 1/4 inch floppy was format, tested and failed said it required a drive parameter so I typed Format a:

    26. Re:Empathy by sysrammer · · Score: 1

      Well, I have good news and bad news. The good news is that I've removed all of the hidden files.

      ...and the bad news is *all* of the files are now hidden.

      --
      His ignorance covered the whole earth like a blanket, and there was hardly a hole in it anywhere. - Mark Twain
  11. Fun thing about TRIM by CajunArson · · Score: 5, Informative

    While this guy was most likely using traditional HDDs where block level recovery is a possibility, for those of you using SSDs that have TRIM properly enabled, don't expect to be able to recover deleted files from the same drive unless you are really really fast.

    TRIM automatically zeros the blocks of deleted files and they are GONE aside from vague sci-fi and probably nonexistent NSA-type forensics.

    --
    AntiFA: An abbreviation for Anti First Amendment.
    1. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      My understanding is that TRIM adds the blocks to a list to be deleted later. How quickly that happens, I don't know. Even if they haven't been physically zeroed yet, you'd likely need a pretty knowledgeable drive recovery expert to move the data back to a recoverable area.

    2. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      Most Linux distributions do not actually enable immediate TRIM. E.g. Ubuntu only does batched trim once per week.

    3. Re:Fun thing about TRIM by sjames · · Score: 1

      That would be a real problem. SSDs don't typically provide low level access or documentation.

      Further, oddly enough, rm -rf would result in a lot of writes as metadata is updated.

    4. Re:Fun thing about TRIM by EmagGeek · · Score: 1

      TRIM automatically ONES the blocks of deleted files. The erased state of flash is all ones, not zeroes.

    5. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      Recovering from rm -rf /* should be quite easy. Almost the entire structure will still be preserved, only the inodes of / changed and all blocks now in the list for reuse.

      Even on SSDs with TRIM the trim is often only done in a batch process via cron (otherwise is slows the SSD down).

    6. Re:Fun thing about TRIM by Rockoon · · Score: 4, Informative

      When the OS sends a trim command, with it is information about what the logical sector should look like if an attempt is made to read it again. IIRC the options are zeros, ones, and random.

      Without trim the ssd has to preserve the entire logical block device its emulating, ie if you have a 64GB drive then even if it only has 4KB of "files" on it, the device still has to preserve all 64GB because it doesnt even know what a file is, let alone that you deleted one.

      With trim the ssd only has to preserve what the OS told it was important to preserve. So instead of preserving 64GB if data it only has to preserve your 4KB of data. Trim marks logical sectors as dont-preserve.

      What the SSD will not do is overwrite trimmed physical sectors just because they were trimmed. In fact, that data could linger there for years even with a high amount of read/write activity because SSD's only erases entire physical blocks, not just the subsectors within blocks that were trimmed.

      So recovering is not sci-fi. Recovery is a fact. What can't be done is recovering the data via commands that target the logical rather than physical device.

      --
      "His name was James Damore."
    7. Re:Fun thing about TRIM by ChumpusRex2003 · · Score: 1

      The standard is that a TRIMmed LBA should read as all zeros. This is so as to permit the use of TRIM in RAID arrays while preserving parity consistency.

      If the OS needs to TRIM an entire RAID stripe, it fires off a TRIM command to the data drives, and calculates parity for null data, and writes that to the parity drive.

    8. Re:Fun thing about TRIM by DutchUncle · · Score: 1

      That would be a real problem. SSDs don't typically provide low level access or documentation

      Maybe not to you, but to the NSA or people with a court order - and the SSD removed from the system and cracked open - many things are possible.

    9. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      I'll put your disagreement in half by saying that TRIM XORs the deleted blocks. Happy, everyone?

    10. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      so you are saying that on SSDs, they unnecessarily *write* zeros?

    11. Re:Fun thing about TRIM by sjames · · Score: 1

      I'm pretty sure that wouldn't be relevant to some dude that accidentally rm -rf /.

    12. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      It wouldn't be easy, but there are plenty of hackers (both white and black hat) that make their living hacking on things that are insanely complicated and deliberately obfuscated -- plus all the ones that do it for fun. The government went to a private consultant to unlock the infamous iPhone, not the NSA (or at least that's what they tell us).

      In the past many SSDs used Sandforce controllers, so cracking that would get you a decent share of the SSDs on the market.

    13. Re:Fun thing about TRIM by allo · · Score: 1

      nope.
      That's what the controller tells you.

      TRIM says the ssd "you do not need to delete anything, but zero out the block logically". Then the SSD may or may not reuse the block when it needs a new block to write to. Then it will be overwritten. When you try to read it, the ssd will tell you, it's empty, as it has the entry "block x is empty" in its metadata.

      An expert may even restore more from a SSD, because the next block written at this location will be some of the (currently) spare blocks TRIMed some time before, because of wear-leveling. But you need to unplug the SSD and read it without the controller part.

    14. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      TRIM automatically zeros the blocks of deleted files and they are GONE aside from vague sci-fi and probably nonexistent NSA-type forensics.

      The DATA SET MANAGEMENT (TRIM) ATA command *does not* necessarily zero the blocks (you mean NAND pages). This is a common misconception, and I'm still not sure where it stems from. What the DSM command chooses to do depends on what the SSD manufacturer chooses. When this matters is when the next read operation happens (whether it be NCQ or non-NCQ, doesn't matter) against the same NAND pages that were previously TRIM'd (I can't say LBA or LBA range because of how the FTL map works -- LBA 12345 before and after TRIM may actually refer to two completely different NAND blocks, based upon wear levelling and several other technologies).

      It's possible to determine what the behaviour is based on IDENTIFY DEVICE data, which allows an OS to essentially know what "model" the vendor chose to implement. Utilities like FreeBSD's camcontrol(8) will show you this setting in a user-friendly fashion (Linux might have something similar, not sure; Windows I doubt, but it could be something smartmontools/smartctl could implement with ease). Rather than explain it all here, I'll simply point you to the ACS-3 specification PDF and page and you can read it yourself. You want Section 7.5.3.2 (TRIM bit), which is under Section 7 (Command Descriptions), subsection 7.5 (DATA SET MANAGEMENT / command 0x06): http://www.t13.org/Documents/UploadedDocuments/docs2013/d2161r5-ATAATAPI_Command_Set_-_3.pdf

      Once you read that, you'll understand how it's not necessarily guaranteed that the underlying NAND content has been zeroed. Essentially, the DSM command removes a list of LBAs from the FTL map -- it doesn't necessarily zero out those NAND pages in the process. Is this a security problem? No, because the only way you'd be able to access the physical NAND pages would be to bypass the FTL (which AFAIK you cannot do aside from desoldering the actual NAND flash chips).

      The subsequent individual's reply stating that the options are "zeros, ones, or random" is not entirely accurate. The options are: "non-deterministic" (i.e. it could be the same data as what was previously there prior to DSM, it could be random, it could be the letter "Q" repeated, it could be an ASCII picture of a snake), "deterministic with static content/value" (what the content/value is isn't specified), or zero. In other words: 2 of the 3 choices are more or less up to the SSD vendor to decide for themselves. Aren't specifications fun when they don't really define behaviour? :-)

      Hope this was informative!

    15. Re:Fun thing about TRIM by Anonymous Coward · · Score: 0

      No, TRIM does not write zeroes. It only changes the logical/physical mapping inside the drive to a special "this block is zero" value. The original data will still be on the drive until reused. But good luck getting at it without replacing the controller/firmware of the drive.

      As for block level recovery on traditional drives that usually a pipe dream too. Since the invention of journaling filesystems the meta information of what blocks belong to which file in what order tends to get zeroed out block by block Meaning you have a billion 4k blocks with no idea in what order they go. The reason for this is that a single journal entry is limited in size and can only contain so much change. Erasing a whole file and freeing all the blocks is too much so the job gets split up and tracking the progress overwrites the metadata needed to un-delete files.

      On the other hand if you use a COW filesytem then un-delete should often be possible. All you have to do is find the old ROOT of the filesystem before something gets reused. But if you are using a COW filesystem why wouldn't you do nightly snapshots that can't accidentally be deleted?

  12. "code" by Anonymous Coward · · Score: 0

    "line of code". "programmer". Ok, media.

  13. beed there, done that by Anonymous Coward · · Score: 0

    At least the Google crawler didn't delete it.

    1. Re:beed there, done that by zarr · · Score: 1

      Oh, the old not-so-side-effect-free GET request story. Happens a lot, and makes me chuckle every time :-)

    2. Re:beed there, done that by Purity+Of+Essence · · Score: 1

      One day my web host decided to go out of business and it sent me scrambling to fix the damage. Unfortunately, my forums were not preserved anywhere. I had basic user account information from registration emails. I attempted to restore the public posts from Google caches and a lot of manual MySQL data entry. It was rough few days of pure panic. Between Google banning me for bot-like behavior and them updating their caches faster than I could copy them, I barely pulled it off with only a few lost posts. I'm never letting that happen again.

      --
      +0 Meh
  14. 1500+ customers and he can't afford by future+assassin · · Score: 1

    a couple cheap Kimsufi servers from OVH for remote backup in EU and In Canada?

    --
    by TheSpoom (715771) Uncaring Linux user here. I have nothing to add to this but please continue. *munches popcorn*
    1. Re:1500+ customers and he can't afford by SumDog · · Score: 1

      Read the article. He claimed to have off-site backups in other countries, but they were mounted.

      But also read the note under the summary. This whole story is probably bullshit.

    2. Re:1500+ customers and he can't afford by tnk1 · · Score: 1

      It probably is bullshit. Who fucking mounts servers in another country to do the backups to directly?

      You archive and compress that shit locally and then move it to the remote server. That prevents your daily backup from taking 48 hours to complete and helps considerably on those data transfer charges.

      Having a simple archive and transfer via FTP or something alone could have prevented him from deleting the remotes with one command. I have trouble believing he set up a NFS or other remote volume to another country. Holy iowait, Batman.

  15. Re:Who hasn't wrecked a system by Anonymous Coward · · Score: 0

    Indeed, it's something that happens to most eventually. I managed to take out an entire file server by accidentally running the script we use to populate diskless nodes on it. People were woken up, little sleep was had, backups were hastily restored, and my name will likely be prefixed with "pulled a" and used to describe pretty much any minor technical screw up for the remainder of my career (but hey, least I kept my job).. shit happens.

    The failure here was entirely in how backups were managed.

  16. insurance fraud at best by Anonymous Coward · · Score: 2, Interesting

    This has such a smell of BS around it. given the fact that backups are indeed offsite and that a company has more the 1 server etc.etc. Even my own simple setup consisting of a pc, laptop, tablet, qnap and some external HDD and sticks is impossible to delete with 1 script. total bollocks.

    Wonder if he found incriminating material or has gambling debts, far more plausible

    1. Re:insurance fraud at best by michelcolman · · Score: 1

      That actually does sound plausible. Got wind of an investigation, deleted everything, made it look like an accident. "Oh, I'm such a dufus, ran rm -rf * on all my servers and backups, then used dd the wrong way around, and then the cat jumped onto the keyboard and typed cat /dev/urandom > *, and then I pulled all the drives out to try to save them but accidentally dropped them from the tenth story, right into a garbage compactor truck, and you won't believe what happened next..."

    2. Re:insurance fraud at best by trogdor8667 · · Score: 1

      Where are my mod points when I need them? +1 hilarious

  17. Re: I'm Getting Surgery. by Anonymous Coward · · Score: 0

    I'll bet there's a coupon for that.

  18. guards? by wyHunter · · Score: 1

    Guards around the command asserting the variables?

  19. manishs by Verdatum · · Score: 4, Insightful

    Manishs, you seem to actually critically read articles before posting them, and you actually provide insight after the summary. What is up with that?

    1. Re:manishs by msmash · · Score: 3, Funny

      I hope you're not being sarcastic.

    2. Re:manishs by Nidi62 · · Score: 1

      Hey manishs, this is off topic, but I've noticed issues on 2 different computers and 2 different browsers (Chrome and Firefox) that the disable advertising box does not stay checked when moving between pages (or even refreshing the current page). If they aren't already aware, could you pass that on to whoever could use that info? Thanks.

      --
      The only thing necessary for evil to triumph is for it to be pitted against a slightly greater evil
    3. Re:manishs by Verdatum · · Score: 4, Informative

      I mean that I really do appreciate it. Keep up the good work!

    4. Re:manishs by msmash · · Score: 2

      Thanks :)

    5. Re:manishs by msmash · · Score: 1

      Thanks for pointing it out.

    6. Re:manishs by Nidi62 · · Score: 1

      I appreciate the response. I mostly only block ads when I'm browsing at work. Giant banner ads on the top and side of the page makes discrete slacking rather difficult :)

      --
      The only thing necessary for evil to triumph is for it to be pitted against a slightly greater evil
    7. Re:manishs by Anonymous Coward · · Score: 1

      I love that commentary on the article seems to be making a comeback.

      More so when it is descriptive, even at a basic level, and especially more so when it discusses the validity of the story.

      Keep it up guys.

    8. Re:manishs by Cut · · Score: 1

      "Rm -rf" would mark the block as empty, and unless the programmer hasn't written anything new, he should be able to recover nearly all of the data. Something about the story feels weird.

      As a heads up, "unless" should be "if" or "hasn't written anything new" should be "has written something new."

    9. Re:manishs by Szeraax · · Score: 1

      I agree. Some people ONLY want the data points of the news. If that is the case, I would read just ArsTechnica or one of the host of other tech news sites. I /. because I want to see what other tech people think about the news. Putting your opinion on a submission where it is CLEARLY not part of the article is something that I like and hope you will continue to do.

  20. 2 Big issues by silas_moeckel · · Score: 1

    Why in hell is is running scripts out of ansible? Why are those scripts not running on a QA system thats a block for block clone of production? Finally what idiot thinks that some mounted drives he copies stuff for is a backup system?

    Tape disk I do not care just treat disk as tape, plenty of backup system are more than happy to do just that. Rsync is not nor will it ever be a backup, snapshots are not a backup, some script some guy wrote that works ok is not a backup. Now they can all help to meet your RTO but at the end of the day it's not backed up till the device is offline sitting offsite.

    --
    No sir I dont like it.
    1. Re:2 Big issues by jcdr · · Score: 1

      man sync
      [...]
      -b, --backup
                                  With this option, preexisting destination files are renamed as each file is transferred or deleted. You can control where the backup file goes and what (if any) suffix gets appended using the
                                  --backup-dir and --suffix options.

    2. Re:2 Big issues by jcdr · · Score: 1

      Err, please read 'man rsync' of course :-)

      I also used the rsync batch mode to keep the last 6 months daily backup.

    3. Re:2 Big issues by silas_moeckel · · Score: 1

      That's still not a real backup strategy. Look all my backups are on mounted disks/arrays. It's great for RTO and can be part of one but at the end of the day you still need to get that data offline and offsite. So it might be more correct that rysnc is not a complete backup system.

      I've been down that road to many times it's far far too prevalent in the hosting and small business segments that think a single copy will be fine. Idiocy like a backup drive in a local system, because that shares no failure domains na. I sent it to this cloud provider what could go wrong.

      --
      No sir I dont like it.
    4. Re:2 Big issues by jcdr · · Score: 1

      Then use rsync batch mode to maintain multiple offline and offsite copy. That's still simple.

    5. Re:2 Big issues by silas_moeckel · · Score: 1

      It's still a piss poor backup. You have no central thing to orchestrate/monitor the backups. At the end of the day there are plenty of OSS backup tools that do the job right. Hell most of them use rsync or similar to do file level diffs. But that does not make rsync by itself a good or particularly viable backup strategy, when to get to even reasonable you have a pile of custom scripts.

      --
      No sir I dont like it.
    6. Re:2 Big issues by jcdr · · Score: 1

      Well, mostly agree, this depend of the situation.
      For some very simple situation a periodic rsync could be just enough (I agree this is a very light definition of 'backup').
      For more demanding situations there could be exiting backup management software using rsync that work very well.
      For a few others very unusual situations, not handled by existing backup software, a set of scripts around rsync could be a good solution.

  21. rofl by Anonymous Coward · · Score: 0

    always use sudo, disable root account. Well let's hope its a lesson learned /rofl...

    1. Re:rofl by Anonymous Coward · · Score: 0

      Else use Fido or Spot.

    2. Re:rofl by alvarogmj · · Score: 1

      yes, until you start doing "sudo x" instead of "x" for everything... At least for me, being root means to be in a "full alert" state of mind.

      Also, this supposedly was done by Ansible, why in hell was he issuing "rm -rf" commands from there? that is what the 'file' module is for

  22. What happened to NEWS for Nerds? by Jack9 · · Score: 2, Insightful

    This was a blatant troll on a forum and now because some idiot millennial wrote an op-ed piece, some idiot (manishs) put it on the /. frontpage?
    Are the admins now supporting the things the moderation system fights on their own site?

    This story is more of an embarrassment than the political vomit I've had to endure because _this_ story doesn't even qualify as news. e.g. What Company did he destroy exactly? You would think the incredibly obvious lack of facts would be a tipoff to someone.

    --

    Often wrong but never in doubt.
    I am Jack9.
    Everyone knows me.
    1. Re:What happened to NEWS for Nerds? by Anonymous Coward · · Score: 1

      Nevertheless, it's a welcome respite from AGW and women in STEM.

    2. Re:What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      What the fuck is up with everyone using "millennial" as a catch-all insult?

    3. Re: What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      Millennials are, in general, considered to be very rotten people. They often have excessive smugness, an outrageous sense of entitlement, unjustifiable arrogance, and a penchant for causing lots of problems for others. The same applies for their parents, the Baby Boomers. Yet while it took the Baby Boomers decades to develop a horrid reputation, Millennials have managed to become more disliked in less than a single decade! It's no wonder that many people use the term 'Millennial' as an insult. Millennials are considered very distasteful by many people.

    4. Re:What happened to NEWS for Nerds? by jschultz410 · · Score: 1

      This was a blatant troll on a forum ...

      ^^^^^^ THIS!!!

    5. Re:What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      > What Company did he destroy exactly?

      The name and data of the company was on one of the affected servers, so they too are lost forever.

    6. Re:What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      Get off my lawn.

    7. Re: What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      There is no such thing as a millennial. It's a fictitious concept used to refer to anyone you don't like. Honestly, I have never felt it necessary to slander members of a group, real or imagined. I don't insult my political or social opponents by calling them liberals, conservatives, socialists, or libertarians, or any ruder derivations, and I have have absolutely no idea why anyone would. To my mind, these sorts of petty slanders do nothing but injure the user's argument.

    8. Re: What happened to NEWS for Nerds? by Darinbob · · Score: 5, Insightful

      I make it a point to lump people into the category of "everyone". Then I can despise them all equally without picking and choosing favorites.

    9. Re:What happened to NEWS for Nerds? by Darinbob · · Score: 1

      I noticed IBM was offline. Maybe it was them.

    10. Re:What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      I'm fairly certain the article covered that.

      He destroyed **_his_** company, a small hosting company of about 1000 or so clients.

    11. Re:What happened to NEWS for Nerds? by HiThere · · Score: 1

      If you had done that, would you have wanted to let people know who you were, or who you worked for?

      I'm not saying you should believe the story, but pick legitimate points. There seems to be an improbable level of stupidity. (OTOH, I'm known some managers...let's just say most of the one's I'm thinking of wouldn't have thought to ask for help.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    12. Re:What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      hey, they did fire timothy so at least be happy about that. the new overlords are trying to make the site better...but yeah, manishs is the new timothy.

    13. Re: What happened to NEWS for Nerds? by david_thornley · · Score: 2

      It's not millennials who have excessive smugness, outrageous senses of entitlement, unjustifiable arrogance, and penchants for causing lots of problems for others. It's young people. Since millennials are currently young, they get all the blame. In twenty or thirty years, the millennials are going to be saying this about the currently young generation.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    14. Re:What happened to NEWS for Nerds? by twistedcubic · · Score: 1


      What the fuck is up with everyone using "millennial" as a catch-all insult?

      We apologize for this. Now get your millennial ass up off my lawn!

    15. Re: What happened to NEWS for Nerds? by Anonymous Coward · · Score: 0

      Millennials are, in general, considered to be very rotten people. They often have excessive smugness, an outrageous sense of entitlement, unjustifiable arrogance, and a penchant for causing lots of problems for others. The same applies for their parents, the Baby Boomers. Yet while it took the Baby Boomers decades to develop a horrid reputation, Millennials have managed to become more disliked in less than a single decade! It's no wonder that many people use the term 'Millennial' as an insult. Millennials are considered very distasteful by many people.

      Baby boomer here.
      Baby boomers got despised right away if they were also in that group known as "hippies".
      Thinking about people over the years that I've known, I think I would rather associate with the average hippie than with the average millennial because the hippies seemed to have fewer diseases. But OTOH, I would rather watch a millennial stare at his phone than listen to a hippie trying to speak on some topic.

    16. Re: What happened to NEWS for Nerds? by Ginger+Unicorn · · Score: 1

      i remember getting the old fogey hate treatment in the early 90's when it was all "generation x'ers are zombified by their tv and their video games". as it is every generation..these delinquent kids with their Elvis and their Hula hoops...etc etc

      --
      (1.21 gigawatts) / (88 miles per hour) = 30 757 874 newtons
    17. Re:What happened to NEWS for Nerds? by Jack9 · · Score: 1
      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
  23. Re:I'm Getting Surgery. by Anonymous Coward · · Score: 0

    Unless you also have your nerves re-routed, I doubt you'd taste anything. Also, you'd need to also transplant the Vas Deferens, prostate and testicles to be able to ejaculate.

  24. Hobbling the default rm command, etc. by John+Allsup · · Score: 1

    Hobbling the default rm command slightly would make a sense, possibly having a second command (oblit or something) for the really nasty stuff, would make sense. Many commands can be unnecessarily destructive, and those destructive commands are too easy to invoke by accident. Possibly requiring a --really and a --reallyreally switch on rm to enable things like rm -rf crossing filesystems, would make sense. I did once make a quick hack so that rm -rf would require an environment variable to be set in order to work, but then various scripts broke.

    --
    John_Chalisque
    1. Re:Hobbling the default rm command, etc. by Anonymous Coward · · Score: 0

      It already has a safeguard. What do you think the --no-preserve-root option does on rm?

    2. Re:Hobbling the default rm command, etc. by alvarogmj · · Score: 1

      He says it was from Ansible, and having worked with it, I fail to see why in hell would you run 'rm -rf' from it when there are modules for that.

    3. Re:Hobbling the default rm command, etc. by Dahamma · · Score: 1

      It already is hobbled. You can't delete / unless you add "--no-preserve-root".

      If you read more about this post, it was an obvious troll. The problem is it got picked up by a "tech" journalist with just enough UNIX knowledge to understand what "rm -rf" does, but not enough to notice the obvious flaws in the story...

  25. Re: I'm Getting Surgery. by Anonymous Coward · · Score: 0

    I thought that was simply implied. Duh!

  26. Not everything by Melkman · · Score: 1

    When an friend an I got started with Linux he wanted to remove his Slackware install from a dual boot PC. For fun he ran rm -rf / on that install. We had a good laugh when the message scrolled by of the OS trying and failing to remove files from the CDROM. That was until he realized that he had mounted his Windows partition too. It didn't fail to remove files there :-)
     

  27. Bad Coding by hattig · · Score: 1

    This guy has learned the hard way about losing data because he wrote bad code.

    He had a backup, but his code bypassed common sense and mounted the backup server's remote drives in the filesystem.
    Which he then wrote a script that ran as root that in this case deleted everything because it didn't sanitise inputs before running the 'rm' command.
    Ideally he would have built the path to be deleted, so he could check that it was sane, i.e., starts with "/users/" or similar, before passing it to 'rm'.
    Worse, is if he was using an off-the-shelf-hosting-package that did this. But when you do, assume it is broken, keep a wall between the systems it can touch, and your last hope (your backups).

    Backup systems should ideally be push only, with any delete action only occurring after validating the replacement. And let's be honest, in this day and age, you can keep multiple generations of backups, push them into Amazon Glacier to keep things cheap.

    I truly hope he was a low end hoster that gave ftp access for website uploads only, so the customers can re-upload their sites, once he reprovisions his servers. Although that's the best option, any databases (for example) would have been wholly reliant on his backup strategy.

    Sheesh, who makes their backups part of the system that is being backed up! It's meant to be isolated because of, frankly, the situation that occurred.

  28. Re:He should have been using SystemD. by Anonymous Coward · · Score: 0, Funny

    Spell it SystemD not systemd.

    That way it looks like an ASCII penis.

  29. Re: Why is everything "trolling" to people like yo by Anonymous Coward · · Score: 0

    Because of all the fakesand liars out there.

    Heck, once I told somebody that calling me a troll was lame, they tried to explain the meaning of the term, as if they were informing me about some usage of which I was not aware, and that I thought that the reference was to a mythological troll. It was quite the bit of cognitive dissonance.

  30. Always pull your backups by Anonymous Coward · · Score: 0

    Never allow push to a backup server... Stuff like this can happen, or intentional sabotage if someone pwns your production server. Making the backup server non accessible keeps things much safer. Also, always quadruple check any recursive deletion, and never do it with variables. If doing it by hand, type it with an echo in front first and then remove the echo once you like the command. This way, if you accidentally hit enter as you just typed the first /, "rm -rf /" just gets echoed instead of run.

  31. Re:Why is everything "trolling" to people like you by s.petry · · Score: 2

    You missed one.

    -- Some anonymous coward complains about people calling out trolling, trolling.

    The funny part is the person you responded to did not claim "trolling", they expressed a healthy skepticism. That last part is something more people should have. There are plenty of liars out there. Quite often they work for main stream media outlets and hold public offices.

    --

    -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

  32. set -eu by bolt_the_dhampir · · Score: 1

    So, he writes a bash script for an important backup job and doesn't "set -u" at the beginning to throw an error if you attempt to use an uninitialized variable? Really?

    1. Re:set -eu by allo · · Score: 1

      {foo} is no bash variable, but some other template language.

  33. Something similar by CanadianMacFan · · Score: 1

    I was working at a small development shop about 15 years ago and I came in one morning to find the main development server not working. Turned out that the previous night a developer on the other project ran "rm -rf" from the root directory on the Sun box and then tried to fix things before giving up and going home. No note, no call to the boss, nothing to indicate what had happened so I had to figure that out when I arrived around 8 AM. Oh, and no backups of their project. I at least had the latest version of the source code on mine on my laptop the but the history and development environments would have been toast.

    Since he toasted the box and it was the only Sun box around (small company) I had to install the OS again. But the only thing that saved us was the fact that rm deletes files and folders alphabetically (or at least at that time on the Sun boxes it did). So as soon as it started removing everything in /dev the machine was toast and it couldn't delete anything else. I first found this out by booting off the CD so I was able to mount the drives. We had our development environments and source code on separate drives (thankfully) so I copied anything that was useful off of the drive used for / onto one of them, installed the OS onto that drive while leaving the other drives alone, and then manually putting things back to where they were. Took less than a day and the owner was very thankful. Never heard a word from the guy that caused the mess though.

    Ever since then whenever I've created mount points for new drives on Linux/UNIX servers I've always made sure that they come after dev alphabetically.

    1. Re: Something similar by Anonymous Coward · · Score: 0

      What happened to the developer? Was he shit canned?

    2. Re:Something similar by phishybongwaters · · Score: 0

      rm -rf doesn't actually delete the files. It's the linux counterpart to windows "quick format" lets wipe out the table and index, but not the actual data. So....... you had it within your ability to recover the data.

    3. Re:Something similar by Anonymous Coward · · Score: 0

      So....... you had it within your ability to recover the data./i ...depending on the file system, and the storage device.

      And it's non-trivial even for rather primitive Unix filesystems. (I had to write an emergency "undelete" once, years back. Not fun.)

    4. Re:Something similar by sabt-pestnu · · Score: 1

      > rm -rf doesn't actually delete the files.
      > you had it within your ability to recover the data.

      For those of us who do not eat, drink, and sleep Linux (or UNIX...), would you please describe the built-in commands that you would use to recover the data?

      Or the forensic tools you would need to use (name some examples)?

      And does it change the recovery method/possibilities if the entire server is virtual, and that the blocks covering the deleted files may have been recovered by the host (dynamic VM storage allocation)?

      Not trolling you. Want to know.

      Deleted a critical file once. /vmunix. Most embarassing. 25 years ago. "Had to" restore from tape, not knowing an alternative.

    5. Re:Something similar by LQ · · Score: 1

      rm -rf doesn't actually delete the files. It's the linux counterpart to windows "quick format" lets wipe out the table and index, but not the actual data

      My understanding is that rm will unpick the daisy chain of linked blocks allocated to the files and move them to the free list. I don't think there is any easy way to reconstitute removed files. Do any of the fancy new *fs do anything different? Mind you, I once used unlink as root unwisely and was able to recover an entire directory tree from lost+found. But that's a whole different mechanism.

  34. He just did a "rm -rf My_IT_Career" by JoeyRox · · Score: 1

    Joke or not he's voluntarily entered himself into the timeless database known as Google, viewable with the not-so-secret incantation "google Marco Marsala"

  35. Re:Why is everything "trolling" to people like you by Anonymous Coward · · Score: 0

    On the other hand, if you read the server fault question, you'd know that the questioner both recovered all his data AND zero'd out his hard drives with dd. Obviously not trolling!

  36. Still value as a troll by Minupla · · Score: 4, Insightful

    I collect these stories for people who I mentor. Even if they're trolls, they work as cautionary tales, because lots of people have had similar smaller scale disasters (as evidenced by posts in this thread) and it's healthy for mentees to get a taste of what can happen when you (for example) forget to error check your script parameters.

    In a big way it doesn't matter if it's true or not, it could be true which makes it a teachable moment. I'm sure everyone who reads the story will run a mental checklist to see if they have a script somewhere that could EVER do it. Do they have their backups mounted when they should be rsyncing, etc.

    Min

    --
    On the whole, I find that I prefer Slashdot posts to twitter ones because I don't get limited to 140 chars before
    1. Re:Still value as a troll by Anonymous Coward · · Score: 0

      "it could be true which makes it a teachable moment"

      Yes, that's what liberals keep saying every time they make an outlandish claim that is later proven to be false. At some point, you have to wonder if it ever could be true, since it never actually is.

    2. Re:Still value as a troll by Anonymous Coward · · Score: 0

      Yeah, God forbid anyone should try to reason through their position in recognition that they may be mistaken. Instead they should stubbornly stick to their knee-jerk conclusions and go to any length of rationalization to defend them.

      "You will do me the justice to remember, that I have always strenuously supported the Right of every Man to his own opinion, however different that opinion might be to mine. He who denies to another this right, makes a slave of himself to his present opinion, because he precludes himself the right of changing it. The most formidable weapon against errors of every kind is Reason. I have never used any other, and I trust I never shall."
        – Thomas Paine, The Age of Reason

  37. One simple word: tarsnap by Anonymous Coward · · Score: 0

    There's where snapshots and boot environments usually help but sensible admins will not save on a good backup solution.
    tarsnap is both cheap and secure .. so there's no excuse.

  38. seriously.. by Anonymous Coward · · Score: 0

    sounds NOT like a sysadmin..
    like poor planning
    poor arch.
    poor documentation
    poor implementation
    poor accountability
    Poor company

  39. Not that it would have helped him by Anonymous Coward · · Score: 0

    I keep a file in my homedir:

    ---------- 1 root staff 0 Oct 21 2005 0000000%%%%%DANGER%%%%%%

  40. Backup with rsync instead of a mount by jcdr · · Score: 1

    That's so simple and effective, work on local network as well as on remote networks thank's to ssh.

    1. Re:Backup with rsync instead of a mount by allo · · Score: 1

      rsync --delete ......

  41. More Efficient by Anonymous Coward · · Score: 0

    Poor guy, he could have done it a lot faster with SaltStack.

  42. Corrections by ledow · · Score: 3, Insightful

    Man ALLOWS his entire company to be wiped out in one command.

    Man DESIGNS his entire company to be wiped out in one command.

    Man SETS UP his entire company to be wiped out in one command.

    Hint: I work in schools. Once I had a teacher delete their entire planning folder. Then (and DO NOT ask me why, because I don't understand it either), they emptied that folder from Recycle Bin. They rang up in the more embarrassed panic.

    And then it was explained that we still had copies of that folder in:

    a) Shadow Copies of the profile on the client.
    b) Network Copies of the profile that they were logged in as (and which fortunately hadn't logged off once they realised what they did).
    c) Shadow Copies of the profile folder on the server.
    d) Copies of the profile folder on all the other servers.
    e) Copies of all the servers on replica servers.
    f) Copies of the server VM's and storage in a primary backup location.
    g) Copies of the server VM's and storage in a secondary backup location.
    h) Copies of the server VM's and storage in a tertiary backup location.
    i) Several off-line and off-site copies of the server VM's and storage .
    k) Random, casual backups all over the place.

    And that's just for the crap that teachers think is important (i.e. a lesson plan they have to write every two weeks and which they can't re-use anyway).

    Fuck knows what this guy was thinking, but there's no one one command ANYWHERE should be able to do that many actions, let alone dangerous actions that you haven't evaluated properly. Honestly, some of those machines don't even TURN ON until the backup window, and even the backup devices have rollback and shadow-copy-like functionality on top of whatever the backup software gives (incrementals, etc.). And several are DELIBERATELY offline for almost their entire lives and have entirely disparate credentials so no one command could ever affect them.

    Not being funny, but we're talking a small school of 400 5-14 year olds here. He actually has more customers than I have users. And you just can't fuck about like that, so if he thinks he can, I honestly have zero sympathy and can only laugh.

    1. Re:Corrections by Anonymous Coward · · Score: 1

      but there's no one one command ANYWHERE should be able to do that many actions, let alone dangerous actions that you haven't evaluated properly.

      This is really a problem with the Enter key, not with rm. If you randomly press Enter, you never know what will happen. I think Enter should be removed from all keyboards. It's far too dangerous to keep around.

    2. Re:Corrections by Anonymous Coward · · Score: 0

      Overkill? I can think of quite a few disaster recovery architectures that don't require near the resources you are using but provide a similar level of confidence to restore in case of failure.
      If I found out it was a school in my district wasting resources this way someone would get fired.

    3. Re:Corrections by ledow · · Score: 1

      You might want to go ask some IT guy somewhere.

      In my country, you are legally obliged to provide attendance and visa and financial data for between four and ten years. No "Oh, but we lost the backup". You're legally obliged. Can't do it? No school.

      You're legally obliged to hold enough work to prove these kids can pass the exam coursework the teachers say they can. No ifs, buts, maybes, you lose it, they lose their qualifications forever.

      Add on testing, pupil tracking, MIS databases (including medical records, records of dealing with child abuse, etc. staff CRB checks, parental complaints, legal issues, etc.), staff salaries, pensions, decades of teacher planning, always-on web resources, VLE's, staff VPN's, mail, etc. and it quickly escalates.

      I've worked in London primary schools for the last 20 years. Backups like this (shadow copies aren't really backups, but still, it takes two seconds to turn the option on) are standard. There was a time when you physically separated admin and curriculum networks to prevent data transfer - twice the servers and cabling and switching (but now you VLAN and/or just permission properly).

      Secondary servers are the norm. Grandfather-father-son backups are the norm. Off-site backups are the norm. Every school I've ever worked in has them, with proper tape rotation already in place before I even walk in the door. And we're talking state schools with a couple of hundred kids below age 11.

      Some small schools ask the Boroughs to help them out and they have somewhat centralised services. Which all do this too. But most primary handle their own IT. And probably have at least one IT suite, several class sets of tablet computers, and quite possibly interactive whiteboards or touchscreens in every classroom. It's the norm for teacher interviews to expect to be able to turn up with Smartboard files and get started immediately.

      Now consider what that means in terms of daily expectations, and actually the stuff I've listed just about keeps you running.

      The school I *actually* work for now, a large private boarding school, has IBM BladeCenters, iSCSI storage, off-site VM replication, MDM, Cisco Meraki networking and wireless throughout and double-redundant fibre backbones on leased lines. I don't expect everything school to have those.

      But I assure you that every school I've ever worked in cycles tapes religiously and keeps several offsite, and has kit supplied which backs up and emails backup logs which school policy states must be checked and that the governors verify is taking place. And some of those literally didn't have enough money to buy exercise books.

      The cost of data loss like that far outweighs anything to do with the education of your child, even if it doesn't actually make it into the public domain.

    4. Re:Corrections by Anonymous Coward · · Score: 0

      sounds like you have a nice budget, congrats on using it well.

    5. Re:Corrections by phorm · · Score: 1

      Where I worked previously, we would generally disclaim having backups, until an important situation arrives (we did have them, but if people don't think we don't they're a bit less likely to do something stupid with their data).

  43. Re: I'm Getting Surgery. by Anonymous Coward · · Score: 0

    I guess you have a phone call to Thailand to make before you fly there, huh?

  44. Extremely timely article! by ErichTheRed · · Score: 2

    I just got put on a project at work as "the systems guy" for a project being built in Azure. This is in support of a reasonably critical system, and the development staff are salivating over the chance to self-deploy code and infrastructure. It sounds like this problem was caused by the first thing I noticed as a risk -- if you don't limit what Azure users can do, it's just like giving them the keys to the data center. And this isn't in an "evil BOFH control freak" sense, this is just the fact that everything in Azure is virtual and easily changed either manually or through automation. So, someone who's having a bad day could easily make a mistake and get rid of things they have permissions on -- it's possible in AWS too.

    It's a really different mindset than even a hosted IaaS service. There, if you do something stupid, at least the physical infrastructure doesn't get rolled up and carried off. Now hopefully you have backups if that happens and can just restore the VMs and storage as needed, but if developers are running the show I would highly doubt it. (In Marco's case, I would imagine this was caused by the classic "run as root, because I'm the boss" issue.

    So, in summary, all the (good) sysadmins worrying about the cloud taking their jobs need not worry. The rules of designing a safe computing environment have changed, but they haven't gone away entirely! I'd be a little worried if I were a savant-level EMC or Cisco guru right about now, but generalists with good heads on their shoulders are still in demand.

  45. Re:I'm Getting Surgery. by Anonymous Coward · · Score: 0

    Just great.

    Now, I bet you probably want to use the Ladies' room too.

  46. Three steps by frovingslosh · · Score: 2

    Put backup copies in truck.

    Drive them to the backup site.

    Repeat regularly.

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re:Three steps by Waffle+Iron · · Score: 2

      ... and don't underestimate the bandwidth.

    2. Re:Three steps by fustakrakich · · Score: 1

      You're just asking to get hit by a meteorite out there in the desert. Wouldn't it be safer to send two trucks out, in opposite directions for eight hours, turn around and come back for the next day's backups, and repeat?

      --
      “He’s not deformed, he’s just drunk!”
    3. Re:Three steps by Triklyn · · Score: 1

      no, asteroid or nuclear blast. safest would be dig a deep dark hole, and send it down with a guys and pack mules... as well as the 2 trucks going opposite directions.

      duh.

    4. Re:Three steps by fyngyrz · · Score: 1

      The zombies will get you either way. It's hopeless, really.

      --
      I've fallen off your lawn, and I can't get up.
    5. Re:Three steps by Triklyn · · Score: 1

      come on, did i ever say you didn't need to kit out your trucks road warrior style? and every dungeon needs some traps.

    6. Re:Three steps by david_thornley · · Score: 1

      Remember the article a day or so ago about accelerating a small space probe to 0.2c? That would take out your hole, your mules, your trucks, and your truck destinations. You need offsite backup on another planet.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    7. Re:Three steps by Locke2005 · · Score: 2

      "Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway." Andrew S. Tanenbaum

      --
      I've abandoned my search for truth; now I'm just looking for some useful delusions.
    8. Re: Three steps by Frankzy · · Score: 1

      Or as an absolute minimum on the opposite side of the planet

  47. Re:Why is everything "trolling" to people like you by Anonymous Coward · · Score: 0

    The funny part is the person you responded to did not claim "trolling"

    Wrong, the original commenter did claim "trolling".

    The original comment's title is the rhetorical question, "Wasn't he trolling?" (emphasis added)!

    See the word "trolling" in there? See how it's a rhetorical question? If we get rid of the word games, the title could be rewritten to simply, "He's trolling!"

  48. Don't run in root all the time,. USE sudo by Anonymous Coward · · Score: 0

    Don't run in root all the time, USE sudo

  49. Not buying this by phishybongwaters · · Score: 1

    Nope, not buying any part of this story, nope. No one is dumb enough to run that without a test. And how were the offsite backups even accessible? doesn't matter, because everything would be recoverable from the systems he "wiped". No, this is another bullshit story spread around by IT departments. this did not happen.

    1. Re:Not buying this by YukariHirai · · Score: 1

      The story probably is a fabrication, but it's not implausible. If there's one thing I've learned about humanity in all my years, it's that there is no limit to the stupidity it's capable of.

  50. No line of bad code by aglider · · Score: 1

    Just a bad brain!
    Can you spell "test"?

    --
    Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
    1. Re:No line of bad code by jittles · · Score: 1

      Can you spell "test"?

      Can you use it in a sentence please? Oh wait no never mind. I think I've got it! D-O-I-T-L-I-V-E???

    2. Re:No line of bad code by aglider · · Score: 1

      No, I cannot.

      --
      Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
  51. Re:Why is everything "trolling" to people like you by X-Ray+Artist · · Score: 1

    ...Somebody accidentally transposes two letters when using the dd command...

    Did you intentionally transpose your "dd"?

    --
    I would have a sig but I am too busy updating programs and restarting my computer
  52. Re: Why is everything "trolling" to people like yo by Megane · · Score: 1

    If they weren't on alt.religion.kibology back around '92 or so, they don't know shit about trolling.

    --
    #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  53. "trolling" word use by fbobraga · · Score: 1

    "trolling" are a very used adjective to claim someone is inferior, today. It's an Ad hominem heavy used tool, nowadays! The hell is, really, other people! :P

  54. Through posting to /. by Anonymous Coward · · Score: 0

    Every time I post something here, when I come back, the message is gone. And now I'm gone /. I don't now who or why you delete people's messages.

  55. ...and...?? by dentar · · Score: 2

    He admitted it publicly?

    --
    -- I am. Therefore, I think!
    1. Re:...and...?? by GlenRaphael · · Score: 1

      > He admitted it publicly?

      Not really, no.

      The question was posed by username "bleemboy", whose profile has been made private. The allegedly associated truename "Marco Marsala" is kind of generic. (there are three on LinkedIn, none claiming to be in the hosting business. Not to mention, if there WERE a "Marco Marsala" in the hosting business wouldn't you expect him to have registered his own name?)

      I find it deeply suspicious that none of the alleged "more or less 1535 customers" nor anybody USING any of the sites run by those customers has piped up in the comments at reddit or here or anywhere else to say "So THAT is what happened to my favorite site and the company hosting it!"

      --
      I play Nerd-Folk!
  56. Re:Why is everything "trolling" to people like you by s.petry · · Score: 1

    Thanks! I don't always read the subject and missed it. Can I call it an out of "body" experience? :^X The skepticism part is still correct.

    --

    -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

  57. We all knew this day would come by Anonymous Coward · · Score: 0

    and watch out for the sequels:

    powerplant IT worker cuts power to homes in Winter for 6 months. Thousands die. with one line of code
    Female IT worker causes multicar pileup - in car AI - one liner.
    Female Asian/black IT worker inadvertently fires last remaining male white IT professionals with one liner.
    Game Over.

  58. rsnap is popular. Should pull from read-only accou by raymorris · · Score: 4, Insightful

    Rsnap is a very popular backup system which uses network mounted drive as it's default/most common configuration. I constantly remind people on the rsnap mailing list about the existence of cryptolocker type malware.

    A much safer way to do it is to have the backup system PULL backups using a read-only account. That way no command on the live system can touch the backups, and the backup system can't change anything on the live system - either accidentally or maliciously.

    One solid backup / hot spare system that does it safely by default is Clonebox.

  59. Excellent troll ... by jschultz410 · · Score: 1

    I mean, he made /.'s front page. That's pretty darn good!

    1. Re:Excellent troll ... by __aaclcg7560 · · Score: 1

      Front page exposure always results in a Slashdotting. Oh, wait. Never mind.

  60. If the guy's name was Larry Ellison by Anonymous Coward · · Score: 0

    Declare a holiday tomorrow for all techies.

  61. Re: I'm Getting Surgery. by Anonymous Coward · · Score: 0

    I already do. But only to "surprise-fuck" the "ladies".

  62. Absolutely by Anonymous Coward · · Score: 0

    foo bar is right!

  63. Re:Why is everything "trolling" to people like you by NatasRevol · · Score: 1

    I don't like windows, but LOVE PowerCLI for managing VMware environments. And HATE using pyvmoni.

    I get to troll everyone.

    --
    There are two types of people in the world: Those who crave closure
  64. Never Include a literal / when scripting by Anonymous Coward · · Score: 0

    Seriously, You should never ever concatenate two variables with a literal slash. It is much harder for rm -rf ${PATH}${ext} to resolve to rm -rf / . While its almost promised that rm -rf ${PATH}/${EXT} will one day resolve to rm -rf /. I think we have all ben trolled. Another really good rule is never urn a remove command as root in a script.

    1. Re: Never Include a literal / when scripting by Anonymous Coward · · Score: 0

      Especially without some sort of condition checking. That would be hard indeed.

  65. Perhaps time for a change to rm by WindBourne · · Score: 1

    The likely hood of this happening is slim, but I sometimes wonder if a minor change is really not that bad.
    In this case, change rm to NOT allow /, until -t/--top is added. Then it is allowed.
    With this minor change, it could save noobs from themselves and would like not be used that often in the first place.

    --
    I prefer the "u" in honour as it seems to be missing these days.
    1. Re:Perhaps time for a change to rm by jittles · · Score: 1

      The likely hood of this happening is slim, but I sometimes wonder if a minor change is really not that bad. In this case, change rm to NOT allow /, until -t/--top is added. Then it is allowed. With this minor change, it could save noobs from themselves and would like not be used that often in the first place.

      They've got an even better one, and it's been in rm for a while. --no-preserve-root

    2. Re:Perhaps time for a change to rm by WindBourne · · Score: 1

      just looked that up. I have been Linux since 1 floppy days and did not know about that. Thank you.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    3. Re:Perhaps time for a change to rm by Dahamma · · Score: 1

      Yep, and apparently the troll who posted the original question to severfault didn't know about it, since when questioned how he managed to delete / without it... crickets.

      (the whole thing was pretty much proven to be a troll...)

    4. Re:Perhaps time for a change to rm by jittles · · Score: 1

      just looked that up. I have been Linux since 1 floppy days and did not know about that. Thank you.

      Just note that if you do /* it will not require the flag. It'll still nuke your entire disk.

  66. Chain of Mistakes by Greyfox · · Score: 3, Informative

    Recently the USPA was talking about stuff that kills skydivers. It's almost never just one mistake. It's a chain of mistakes where one single good decision anywhere in that chain would break the chain and prevent entirely preventable deaths. In the case of this story, if it had actually happened, which it didn't, the decisions made to violate best practices all along the chain (IE, running your bash scripts as root or as any user ID that has authority to delete anything on the file system, not pushing just pushing your backup data to isolated storage, not having numbered sequential backups, etc) would be so egregious that the story would simply be an example of Darwin at work. The conversation would go "Oh hey, did you hear about that guy who designed his system so badly that he was able to delete the whole fucking thing with one mistyped command? Yeah, the council of sysadmins voted to kill him. Said it was for the good of the species."

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  67. I feel for the guy by jomcty · · Score: 1

    Talk about a bad day at the office. As an IT professional, I feel for the guy.

  68. Theology Lesson by Miamicanes · · Score: 1

    On a Linux system, root is God(*)

    God is omniscient, omnipresent, and infallible.

    Therefore, when root deletes files, it's never a mistake, and the files should be immediately destroyed forever without question.

    (*) Unlike those heathen Windows systems, where there can be multiple gods, some of whom are more equal than others... and not necessarily in ways that are obvious to casual observers... ;-)

  69. Old Saying by Tablizer · · Score: 4, Interesting

    "To err is human. To really fuck things up, you need a computer."

    I prefer that any bulk or query-based "delete" command ask for confirmation along with basic feedback. Example pseudo-code:

    > delete *:*.*

    You are about to delete 832 folders and 28,435 files.
    Your choices are:
          1 - Proceed with deletion
          2 - List path details about the above folders and files
          3 - Cancel deletion
    Your Choice: __

    (end of example)

    It may be slower and/or more resource intensive, but that's better than mass boo-boo's.

    An optional command parameter could switch off verification, but verification should be the default. This is something Unix/Linux gets backward in my opinion: the default should be confirmation mode, not the other way around. In other words, a command switch should be required to switch off confirmation rather than requiring a command switch to turn confirmation on.

    Typical SQL doesn't have a confirmation mode, so I usually do a verification query on the WHERE clause before running the actual:

    -- check
    SELECT count(*) FROM myTable
    WHERE x > 7 AND foo='BAR'

    -- actual, keeping same where-clause
    DELETE FROM myTable
    WHERE x > 7 AND foo='BAR'

    I also often inspect at least some of the actual rows, not just the count. Thus, as a rule of thumb, do random spot-checks of actual data, and a total count before final command execution.

    1. Re:Old Saying by Anonymous Coward · · Score: 0

      An optional command parameter could switch off verification, but verification should be the default. This is something Unix/Linux gets backward in my opinion: the default should be confirmation mode, not the other way around.

      What exactly do you think the `-f` flag does???

      From the manual:

      -f, --force
                                  ignore nonexistent files and arguments, never prompt

    2. Re:Old Saying by hankwang · · Score: 2

      "This is something Unix/Linux gets backward in my opinion: the default should be confirmation mode, not the other way around."

      1. All Ubuntu versions and derivatives (and I think Centos/RHEL as well) alias rm to "rm -i" out of the box. Drives me crazy; with every install I have to hunt down whether those aliases were defined in .profile, .bash_profile, .bashrc, /etc/profile, /etc/bashrc, or somewhere in /etc/bash/*.

      2. Command-line tools that ask for confirmation suck for scripting. Especially if those prompts only occur under specific conditions (such as confirm overwrite).

    3. Re:Old Saying by iusty · · Score: 1

      With SQL is even easier. BEGIN TRANSACTION, run the command, and check how many rows it deleted/updated/inserted. If not the number expected, ROLLBACK.

    4. Re:Old Saying by Anonymous Coward · · Score: 0

      He deployed this on a script that was pushed out to all servers (i.e. not possible to do interactive) without testing it in a test environment first.
      And that's not even talking about the "backup" system.

    5. Re:Old Saying by Anonymous Coward · · Score: 0

      This makes sense for manual commands, but in this case, the rm -rf was part of an automated bash script that was replicated across dozens of servers. Manual verification just isn't practical in this case.

      That said, perhaps you could have flags for "--maximum-allowed-deletions" or "--maximum-deletion-size" or "--maximum-recursion-depth" that prevents the command from running if those limits are reached. Usually when you write an rm command you have some idea of how much you're expecting to delete, and there's not really any easy way of making use of that knowledge at the moment.

    6. Re:Old Saying by Anonymous Coward · · Score: 0

      That's what -f in rm is for. The -r means recursive, and the -f means "force" or "don't ask for confirmation". -rf combines those 2 options, and that's why you should always triple check what you're about to delete if you're running it as root.

    7. Re:Old Saying by Anonymous Coward · · Score: 0

      An optional command parameter could switch off verification, but verification should be the default. This is something Unix/Linux gets backward in my opinion: the default should be confirmation mode, not the other way around. In other words, a command switch should be required to switch off confirmation rather than requiring a command switch to turn confirmation on.

      How is this modded up to 4? What's described here is exactly how rm works. By default, rm will ask you to confirm you want to delete every single file, one at a time, before it's removed.

    8. Re:Old Saying by Tablizer · · Score: 1

      That's a good suggestion, but if the actual target quantity is far larger than expected, then buffering the (pending) changes can bring the system to a crawl. Not as bad as an erroneous delete, but still unpleasant.

      I might run a count first, then run it again using TOP N, LIMIT, or rownum n to sample some records before I do the final query. Steps vary per RDBMS vendor.

    9. Re:Old Saying by Anonymous Coward · · Score: 1

      Unix:

      You do know what you are doing

      and

      You meant what you said

    10. Re:Old Saying by Tablizer · · Score: 1

      By default, rm will ask you to confirm you want to delete every single file, one at a time, before it's removed.

      That's not practical when working with lots of files. The default should probably be summary statistics and/or review options, and then a confirmation. If the default is rarely useful, then people get into the habit of not using the default, which defeats the very purpose of a default. My description of the complaint could use better wording, I do admit.

      Putting some kind of "sanity limit" on a command is also a useful idea. For example, the hypothetical "rm -s5000" could mean stop if the command affects more than 5000 files and/or folders. This is not the same as stopping after 5000, but cancelling the entire command if it will impact more than 5000 if continued.

      A variation would be to prompt if more than the stated limit. If you run it in batch mode, then a prompt request would typically stop the batch process and/or wait for user confirmation. This is probably closer to what we really want.

    11. Re:Old Saying by La+Gris · · Score: 1

      One solution would be having prepared statements for shell commands instead of doing those risky string concatenations.

      And I have stopped using rm to delete files because this command is way too stupid and can take options from file-names.

      I use find command,
      run it dry once to show what is found
      then run find stuffs-to-trash -delete

      --
      Léa Gris
    12. Re:Old Saying by AbRASiON · · Score: 1

      I've read about rm for years and never seen this suggestion before.
      I don't understand why it's not put in place, that's a great idea to be honest. A simple solution and easily bypassed by impatient admins with a -now or -y in the command line for auto approval.

    13. Re:Old Saying by Anonymous Coward · · Score: 0

      By default, rm will ask you to confirm you want to delete every single file, one at a time

      No, it doesn't. Are you sure you don't have an alias rm='rm -i' on your system somewhere?

    14. Re:Old Saying by lastman71 · · Score: 1

      Yes confirmation before doing something is dangerous, and often rm is alias to 'rm -i', which let it prompt to you if you want do proceed.

      The point is: if you need to run it over 1500 server, you can't confirm one by one. And how many rm were in the script? So you'll be asked for 1500 x (number of rm comand in the script). No way.

      The problem is confirmation help a bit, but not very much. When I was young, I worked on VMS, where del command ask for confirmation. And I have spent the day doing test, where I had to delete some *.dat files in a directory, to run a program, to see if the files are produced correctly, repeat till the file are ok.

      What could possibly go wrong? Just change directory, where a lot of configuration file are (and you can immagine, for some reasons, many have a generic extension like .dat), and just restart to do test without thinking, and say yes out of habit.

      If you think that confirmation is a good tool to save data, you're dangerously wrong. As many here have already said:

      1) copy data somewhere else is not a backup, and not help you from corruption/deletion of data. As soon you syncronize the data on the copy, your data is lost.

      2) real backup save the history of your data.

      3) your backup data must not be accesible from the server, you should not be able to delete backup data from the same place where you can delete the same data.

      So, I agree, that you should make difficult to make mistake. And it is already the default in unix (or at least in recent modern linux distro). But is not enough. You should also able to undo eventual mistake. As a sysadmin, I have learn, that every time you do something, you should thing about how you will undo if something go wrong. Backup is the most important tool.

    15. Re:Old Saying by LordWabbit2 · · Score: 1

      Any and all updates or deletes I ALWAYS do a BEGIN TRANSACTION and ROLLBACK, even when on the dev box. I have had one or two "oh fuck" moments before and this helps. If I am really paranoid or the data is difficult to restore / recover I do a full backup first.

      --
      There are three kinds of falsehood: the first is a 'fib,' the second is a downright lie, and the third is statistics.
    16. Re:Old Saying by Wolfrider · · Score: 1

      --You do know you can override the alias by calling the path+exec?

      $ alias hostname
      alias hostname='hostname | cut -d '\''.'\'' -f 1'

      $ hostname # calls the alias
      thisbox

      $ /bin/hostname # calls the exec direct
      thisbox.fully.qualified.domain.name

      --Plus, bonus:

      $ for i in .profile .bash_profile .bashrc /etc/profile /etc/bashrc; do echo $i; grep 'rm -i' $i; done
      $ grep -R 'rm -i' /etc/bash/*

      > Command-line tools that ask for confirmation suck for scripting. Especially if those prompts only occur under specific conditions (such as confirm overwrite).

      --Agreed, but you can usually get around those by ' echo y| annoyingscript ', unless you have sudo in the mix... Then you might have to (shudder) use parenthesis or something ;-)

      --
      .
      == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
  70. Re: Why is everything "trolling" to people like yo by VAXcat · · Score: 1

    Or alt.folklore.urban. Some world class trolling occurred there, back in the day.

    --
    There is no God, and Dirac is his prophet.
  71. Re:Why is everything "trolling" to people like you by Anonymous Coward · · Score: 0

    Somebody accidentally transposes two letters when using the dd command, perhaps after many hours of panic and perhaps after days without sleep? It must be "trolling"!

    You are the one trolling here. No matter how many letters you transpose, 'dd' is still 'dd'.

  72. Same process had access to offsite and local data by QuietLagoon · · Score: 1
    Poor design of a backup system.

    .
    Offsite data should be offsite. Period.

    It should never be accessible by the day-to-day operational processes, and that includes the routine backups.

    He needs another backup step between the local and the offsite backups.

    I back up local data to a onsite staging area. Then, in a totally separate process, I back up the staging area to offsite facilities.

    I empathize with the guy....

  73. What's weird? by Anonymous Coward · · Score: 0

    "Rm -rf" would mark the block as empty, and unless the programmer hasn't written anything new, he should be able to recover nearly all of the data. Something about the story feels weird.

    He actually rm -rf'd on a production system. Probably hasn't the foggiest how to pull data off the drives.

  74. Should've used Windows... by Anonymous Coward · · Score: 0

    Where it would've done this without any user input at all.

    1. Re:Should've used Windows... by Tablizer · · Score: 1

      Clippy: "It looks like you just deleted your entire company. Would you like assistance crying?"

  75. Condolance cards by Danathar · · Score: 1

    Is there any address to send flowers?

    When will the funeral be?

  76. Been there, done that by Mondorescue · · Score: 1

    I did something similar to my server in 2005. It wouldn't have been so bad, except that (!) I hadn't made a backup in months and (2) the server hosted a disaster recovery project whose purpose was to guard against catastrophic data loss. A cobbler's bairns are aye the worst shod...

  77. I was that idiot when I was younger, as well by Anonymous Coward · · Score: 0

    This is back on a System V Motorola 8810 Box in the early 90's.

    Wrote me a clean up shell script to delete all files in a relative folder older than 2 days, tested it multiple times then dropped it into cron.

    Two days later no-one can log in and the box is dead. Now, I had backups and I restored the previous night - all's good but I was a loss to understand what happened (yeah, I mention I was an idiot?).

    Two days later, same thing. Finally the penny dropped. My cleanup script, when run via cron, had a relative path of root. Two days later it deleted all untouched objects older than 2 days FROM ROOT. AGAIN.

    Boy, did I feel like a complete muppet.

    Learned the value of good backups though.

  78. Re:rsnap is popular. Should pull from read-only ac by mlts · · Score: 2

    The best of all worlds is pull based backup software. However, the enterprise based programs are extremely pricy, well out of the range for a home user. The cheapest around would probably be Windows Fundamentals which is a descendant of Windows Home Server.

    What I've wound up doing on a small scale (this won't scale up past a few machines) is having a hardware NAS appliance. It had a samba share and account for every machine. The Windows boxes use Veeam to dump their data onto the individual shares. Every 15 minutes, the NAS pops a snapshot of each share, where several are kept for each hour/day/week/month/year, and the rest get tossed after a while. Every eight hours, the NAS backs itself up to an external HDD. This protects against ransomware in several ways. If ransomware just zaps the share, restoring the snapshot and bare-metal loading the machine isn't too bad. If ransomware takes its time and zeros files over an interval, because I have weekly, monthly, and backups over a duration, there is a good chance that I will still have the file around, either in a snapshot, or on the backup drive. Because each machine dumps to a separate share via a separate account, ransomware on one box can't destroy or access another machine's data.

    The ideal would be having the NAS maker writing an agent that sits on Windows and uses SSH or another time-tested protocol to pull backups. This would not just guarantee that backups are done, but are protected against ransomware.

  79. BS by Anonymous Coward · · Score: 0

    So an admin took 1500 companies off line permanently and we only hear about it from some random forum? Not very believable.

  80. Marco Marsala by Anonymous Coward · · Score: 0

    Sounds like a dago or a wop, what did you expect?

  81. rsync and LVM by Mybrid · · Score: 1

    LVM and rsync are your friend.

    The easiest way to backup physical is with rsync, LVM and snapshots. No rm required. None of my backup scripts have /bin/rm in them?

    If it is a VM just take a snapshot of the VM?

    Why would any backup script use "/bin/rm"?

    This sounds really fishy.

    Or really incompetent.

    Or both.

  82. Use Shell File-name expansion by iam_TJ · · Score: 1

    The usual way to do it using the shell file-name expansion is:

    bash/dash/sh: ls .[!.]*
    bash/csh/zsh: ls .[^.]*

    which will pick all the dot-files but not double-dot (link to parent directory). Only time this will be problematic is if there are files/directories named with the style "...three-dot-file".

  83. Sodium per diem by fyngyrz · · Score: 1

    You must be on a salt restricted diet. Nobody likes unsalted earth, or earth that only has the salt you added while cooking.

    Myself, I like to scorch it, salt it, scrape it into a squarish pile with four corners, dye it red, vibrate it until I'm sure the earth moved, and then chant "Tara! Tara! Tara!" I do all this wearing Birkenstocks. It's a thing.

    Tastes much better that way. Really.

    --
    I've fallen off your lawn, and I can't get up.
  84. Re:Why is everything "trolling" to people like you by Anonymous Coward · · Score: 0

    Not transposing letters, but I have managed to swap 'skip=' and 'seek=' when trying to work around a bad block error. The results were, to say the least, not good. Argh...

  85. Re:Why is everything "trolling" to people like you by HiThere · · Score: 1

    You had made a block copy backup via direct connection first, right? (I'm just assuming you can still do that, since it's been several decades since I had someone do it for me.)

    Backups are the best answer, but if you don't have backups, the first step should be to make a sector-by-sector backup. And I, personally, have had more success having a hardware guy do it for me in hardware. OTOH, I'm not sure I could even edit a disk anymore. The last time I needed to to that I was using MSWind95.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  86. Re:rsnap is popular. Should pull from read-only ac by fisted · · Score: 1

    Then again, rsnap is a seven kilolines perl script around rsync...

  87. Re:rsnap is popular. Should pull from read-only ac by shess · · Score: 1

    rsnapshot is 7klines of Perl script around rsync which does _pull_ backups.

  88. Re: Why is everything "trolling" to people like yo by DFarmerTX · · Score: 1

    I remember you.

  89. Foolproof backup strategy by Anonymous Coward · · Score: 0

    Fuck backups, fuck trolls, fuck that idiot, fuck slashdot, and FUCK YOU!!!!!!!!!!!

    1. Re:Foolproof backup strategy by FormOfActionBanana · · Score: 1

      a hosts file, properly configured, will do that for you more easily.

      --
      Take off every 'sig' !!
  90. Why not change the behavior of rm? by ndykman · · Score: 1

    So, first, people figured out that rm -rf / is bad, so they added an option that would disallow it by default, but you can turn it off, and rm -rf /* may still work.

    But, the command never makes sense. What does it mean to remove /proc? Or /dev? People quote the ideal that you could be able to do really dumb things to be able to do really great things, but why allow things that don't make any sense at all? "rm -rf /dev/null" for example. What does that mean? It's seems reasonable to say "rm -r /" or "rm -r /*" has no meaning, as it asks to perform an operation on filesystems where it has no defined semantics, and therefore, you can always forbid it. After all, you can still list all the directories and files you want manually to get the same effect.

    1. Re:Why not change the behavior of rm? by flargleblarg · · Score: 1

      Agreed. There is no reason ever to "rm -rf /" the whole filesystem. If you want everything wiped, you reformat the disk and start over with a new filesystem on it. Not only is this safer, it's cleaner and faster.

  91. Totally foolproof backup strategy by Anonymous Coward · · Score: 0

    Fuck backups, fuck that idiot, fuck slashdot, and FUCK YOU!!!!!!!!!!!!!!

  92. Insurance by Anonymous Coward · · Score: 0

    He just wanted to collect fat-finger insurance. This scam has been around as humanity has had keyboards.

  93. One word. by sarkeizen · · Score: 1

    Snapshots.

  94. hey /b/ I need your help by Anonymous Coward · · Score: 0

    I accidentally my entire company.

    what should I do...is this dangerous ?

  95. Bad summary by gweihir · · Score: 1

    First, "Rm -rf gets you an error because the comman "Rm" is unknown. And second, Unix-filesystems are not moron compatible (different from Windows) and recovering files is generally very hard or infeasible.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  96. Wayback machine by Anonymous Coward · · Score: 0

    Wayback machine is his way back

  97. Use "set -u" by fnj · · Score: 1

    Some good points made by various posters, amongst all the piling on.

    Here's one suggestion which, curiously, I don't see having been made by anyone yet. This is a good illustration of how putting "set -u" at the top of the script can help you. It would have prevented this catastrophe, actually. "Set -u" causes any use of an undefined variable to abort before executing the command, and the script will be terminated on the spot with a diagnostic identifying the particular variable as an "unbound variable".

    It certainly won't prevent ALL rm boo-boos. but it would have prevented this one. It works in POSIX/BSD sh as well as bash.

  98. BackupPC, rsnapshot by Anonymous Coward · · Score: 0

    Rsnap is a very popular backup system which uses network mounted drive as it's default/most common configuration. I constantly remind people on the rsnap mailing list about the existence of cryptolocker type malware.

    A much safer way to do it is to have the backup system PULL backups using a read-only account. That way no command on the live system can touch the backups, and the backup system can't change anything on the live system - either accidentally or maliciously.

    One solid backup / hot spare system that does it safely by default is Clonebox.

    Both BackupPC and rsnapshot can run from a stand-alone system, which is not accessible by any account on production machine/s, and goes in via an SSH key and takes a copy of whatever you want. You can do full and incremental backups, and have a configurable amount of copies.

  99. Should have used windows by bugs2squash · · Score: 1

    'rm' is not recognized as an internal or external command, operable program or batch file.

    --
    Nullius in verba
  100. Re: rsnap is popular. Should pull from read-only a by Anonymous Coward · · Score: 0

    Quite easy to do with btrfs snapshots... Pull via ssh or push via ssh and a limited backup-recipient user... And you only get changed blocks.. full backups every day and incremental every 2 hours works perfectly..

  101. Let me guess by Anonymous Coward · · Score: 0

    A Linux server running 1535 websites, let me guess another wordpress script kiddy trying to pose as a legitimate businessman. Surprised he's even aware of stackexchange.

  102. Darwin Award! by Anonymous Coward · · Score: 0

    Based upon the article, the business has self-selected a Darwin Award for gene pool elimination.

  103. Bash is a horrible programming language by Anonymous Coward · · Score: 0

    Of course, the bug in the script wasn't the main problem in this case, but all the bigger problems have been done to death in this thread.
    What's missing is that nobody seems to mind that in Bash, which is ostensibly targeted at doing bulk operations, system administration, file management, i.e. potentially very dangerous stuff, undefined variables silently expand to nothingness.

  104. Stupid question. by Anonymous Coward · · Score: 0

    This is a stupid question, but does that command actually overwrite the hard drives? I thought that usually you could read all deleted data that wasn't overwritten yet.

  105. Nice rush of adrenaline ... by jopet · · Score: 1

    this must have been!

  106. rm -rf -i by Anonymous Coward · · Score: 0

    When I was a syadmin, a greybeard told me a trick about adding a file to your root directory called "-i". Then if you ever try to execute "rm -rf /" as soon as it sees the -i file, it will be interpreted as a command flag and switch to interactive mode, forcing you to confirm each delete and realize your mistake. Does this not work anymore?

  107. Millennials learning the hard way by Anonymous Coward · · Score: 0

    I've seen this happen many times in my career (and not by my hand): people using rm -fr $foo/$bar or rm -fr /$foo and not doing proper validity checks on their variables prior. I also sigh when folks don't double-quote their paths, so spaces in variables (hence pathnames) end up causing "unexpected" grief. This is all shell scripting 101 (maybe 102) type of stuff. Does nobody know about set -u (nounset)? Even find -x (i.e. -xdev or -mount on GNU) would have prevented this. I just don't get it.

    Also, for those who missed the paragraph after the rm -fr {blah}/{whatever} explanation: they did offsite backups, but the problem was the admin NFS mounted (I assume NFS) the backup repositories under paths in /, so they got wiped as well.

    What really chaps my ass about all of this: why is this fellow doing all of this in the first place? It sounds like he was shell scripting his own backup system. Was rsnapshot (which wouldn't have shot him in the foot this way, in any way/shape/form) not thought of? Even basic rsync with --delete? There are several possibilities/alternate solutions, all which are certainly more ideal.

    Instead, all I see described in the article is the sign of an admin who deserves exactly what he got: bad design engineering choices, combined with badly-written scripts, resulted in something awful. My entire life I've stuck to an anti-BOFH mantra, despite being a UNIX SA, but the BOFH in me comes out because my reaction was, and still is: "he chose poorly". I hope the guy at least has learned from his experience -- it took me two fat-fingerings of "zpool destroy" and "dd if=/dev/zero" arguments (two separate occasions/unrelated incidents) to teach me to do backups properly/sanely. And I sure as hell aren't using shell scripts that involve rm -fr.

  108. Less destructive, but far too common by Y2K+is+bogus · · Score: 1

    Init 1 instead of init q, that was always my favorite line that someone used to run on the main server, far too often as it turns out. On a Sun box that requires serial terminal to type "go", to recover from.

  109. The Horror! by Dutchmaan · · Score: 1

    There's that brief moment of confusion, followed by the heart clench and a burst of fear in realizing what has just happened. Then the mind quickly scrambles for any and every solution that could possibly put things back to normal. Then you're hit by the icy cold wave of fear like being submerged in frigid water as you realize the ramifications of what has happened and predictions of what your increasingly bleak future may hold. After you realize all hope is lost you hit "fuck it" mode and just try to escape the situation in the outside world, but it's too late... that icy water you're submerged in goes with you.

  110. focusing on the "weird" by Anonymous Coward · · Score: 0

    "something about this story feels weird"

    honestly, I got that feeling as soon as I started reading the blurb. but i'm just naturally suspicious of massively destructive computer screw-ups.

  111. WWwasted! by Anonymous Coward · · Score: 0

    Not in linux. Files can be restored, but no paths. His business is fuckd

  112. How binary by Sivar · · Score: 1

    Funny how is number of users is 2^10 + 2^9 - 1. 'Lot of code smell in this article.

    --
    Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
  113. ZFS by Anonymous Coward · · Score: 0

    Thankfully rm -rf doesn't work on ZFS snapshots...

  114. strings /dev/sda by iamacat · · Score: 1

    If your livelyhood really depends on the data, you can invest time to recover it after rm -rf /. Come up with patterns to identify your database records on disk blocks. A few will be split between blocks which are non continuous, but most can be found and dumped from raw device. Then exploit relationship between different records to identify outdated data. Finally, offer suppliers and customers a healthy discount to log in and correct remaining errors. After all, the value of a business is in human relationships more than any single hard drive.

  115. Man Trolls Internet with One Post on Serverfault by Gumbercules!! · · Score: 1

    I fixed the article heading for you...

  116. Smells fishy by Anonymous Coward · · Score: 0

    I work with ansible a lot and I'm pretty sure a shell command won't execute if you use any undefined variables in it, instead ansible will report an error.

  117. Re:Why is everything "trolling" to people like you by Dahamma · · Score: 2

    It was a pretty obvious troll if you read the whole thread:

    1. The guy claims to have made the most insanely improbable mistake to kill his entire set of servers. Possible, but unlikely. Most took the bait on this one.
    2. He had no explanation as to why "--no-preserve-root" didn't save him - basically looked like he didn't know about it, and he was lying.
    3. later on he responded to someone's suggestion to use dd to backup saying he reversed if and of - which is probably the second most joked about UNIX sysadmin error after "rm -rf".

    So, either you are pretty clueless about any of this, or, like another poster suggested, you are also a troll. Based on the specifics of your moronic post, probably the latter.

  118. -rf {foo}/{bar} - Fake story. by erexx23 · · Score: 1

    -rf {foo}/{bar} = fubar foobär/ adjective adjective: fubar; adjective: foobar out of working order; seriously, perhaps irreparably, damaged. "the clock in the hall is fubar"

  119. In 1991, our secretary changed the tapes by Baki · · Score: 1

    As part of "cost savings" back in 1991, managers decided that the secretary would be able to rotate the backup tapes, instead of IT staff.
    After 6 months of hacking and developing, we had a crash of 2 disks simultaneously.
    It turned out, all backups, offsite, offline, had all been made on cleaning tapes. Error messages had been ignored.

    There is nothing new here. People and managers keep taking shortcuts and hope for the best.

  120. fundarising by Anonymous Coward · · Score: 0

    is they fundraising here ? https://igg.me/at/3Lep-i7-ed0

  121. Calling BS on this one by Anonymous Coward · · Score: 0

    rm - rf / does not work due to in the in-built - - preserve-root. However, rm - rf /* will do the job nicely, so either that second variable interpolates to * or he's running Ubuntu 7.10 or earlier. Or it's total BS.

  122. bullsh... by Anonymous Coward · · Score: 0

    you can recover many of those files if not overwritten with some restore utility. I have done that before.

  123. Re:Hobbling the default rm command, etc. +1 by pruneau · · Score: 1

    I totally second that: http://docs.ansible.com/ansibl... Moderate parent to top level. rm is a tool, ansible too, badly using them is asking for trouble.

    --
    [Pruneau /\o^O/\ warranty void if this .sig is removed]
  124. It is a hoax. by Anonymous Coward · · Score: 0

    http://meta.serverfault.com/questions/8696/what-to-do-with-the-rm-rf-hoax-question

  125. Backup is indeed impt. by Geanne · · Score: 1

    Hopefully the company able to do backup atleast every month.

    --
    Everything in their right place, in their right time.
  126. Is it ironic? by freeschwag · · Score: 1

    I saw this right away.... Lol

    foo bar ??? Yup. It sure is.

    --
    Tweet, tweet, all id10t's out of the gene pool, open swim is over.
  127. rm * by Anonymous Coward · · Score: 0

    I once wanted to remove all files starting with some name. Instead of "rm name_* " I did "rm name_ *". That extra space deleted all my uncommitted code in that folder.

  128. ServerFault Meta Admins Have Confirmed It A Hoax by celest · · Score: 1

    ServerFault Meta admins have confirmed that it was a deliberate "Guerilla Marketing" promotional hoax. Seems it was highly effective. The original thread has been deleted, though admins are still deciding what to do, if/how to punish user account, etc.

  129. Re:Why is everything "trolling" to people like you by allo · · Score: 1

    > 2. He had no explanation as to why "--no-preserve-root" didn't save him
    Maybe because it's a BSD or other system without gnu tools?

  130. Re:rsnap is popular. Should pull from read-only ac by tigersha · · Score: 1

    Yes. This. PULL PULL PULL.

    The system should not have write rights on the backup system. The backup system should have read rights on the system.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  131. Saw that happen in a global operation... by Anonymous Coward · · Score: 0

    They had just introduced sensu for monitoring. The puppet driven installer wanted to know he host name.

    Boom.

  132. ZFS would have saved him by MichaelJackson123 · · Score: 1

    With ZFS you can make a snapshot, i.e. a freeze of the entire disk in time. This means you can rollback to any of these time points when you want. These snapshots does not use additional space. This also means that if some virus messes up your system disk, no worry, because you can just rollback to an earlier snapshot in time. I have made much mistakes with Solaris, but each time I am going to do something weird, I make a snapshot (takes one second) and if I mess up, I just reboot in GRUB to an earlier state where the system disk worked fine. ZFS is a godsend.

  133. Error checking is for chumps by ebvwfbw · · Score: 1

    Guy needs to be a life member in the Error Checking is for Chumps club.
    I've seen very close, a chown/chmod -R /$path/*. Well $path wasn't defined. The guy called it through sudo. I had a record. No more sudo for him. Could still login as root, took an hour or so to fix.

  134. Re:rsnap is popular. Should pull from read-only ac by Krishnoid · · Score: 1

    I constantly remind people on the rsnap mailing list about the existence of cryptolocker type malware.

    Along those lines, could one write or modify a filesystem driver to add mount options which only allowed creation of files and directories (on, say, a snapshot-style-style backup volume), to combat those kinds of attacks?

  135. mount -o remount by raymorris · · Score: 1

    Mount options may not do much good, because an attacker (or malware) could remount. Also for efficiency you often don't want to write everything again, you want to clone the old through some efficient mechanism such as hard links or volume tricks, then update it by updated files which have been updated, deleting deleted files, and creating any new files. A pull with read-only access to the live system does this well, and read-only is very well supported by existing file systems.

  136. ZFS by Anonymous Coward · · Score: 0

    Use ZFS for drives...

  137. Re:Why is everything "trolling" to people like you by Dahamma · · Score: 1

    Maybe because it's a BSD or other system without gnu tools?

    Maybe you could RTFA. It wasn't.

  138. What I'm not seeing in the Slashdot echo chamber.. by Wolfrider · · Score: 1

    --HOWTO safe rm on Linux (at least):

    - Interactive:
    o Use Midnight Commander. Works from a text terminal, no GUI needed.
    Insert to mark files/dirs, F8 to delete. Never had a misfire, even as root.

    - Script (for the paranoid, and want a log):
    IF you have a known dir " destdir=/tmp/blah " with a subdir " /tmp/blah/1 "
    $ cd $destdir && cd 1 && cd .. && rm -rv 1/* |tee /tmp/rm.txt

    - REALLY safe rm, with find:
    # find multiple (known) names of files > 40 days old in a given directory and delete them
    bkpath="/mnt/bkpdrive"
    pathh="$bkpath/work/bkpsys-laptop-p2400-thinkpad-xubuntu-14-04-LTS--64--sda7"
    cd $pathh && \
        find $pathh/* \( -name "bkp*gz" -o -name "bkp*bz2" -name "bkp*lzop" -o -name "flist*" \) -type f -mtime +40 -exec /bin/rm -v {} \;

    --If you need to delete multiple levels of subdirectories, or dotfiles -- do it interactively, and use MC.

    --
    .
    == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
  139. Re:Why is everything "trolling" to people like you by allo · · Score: 1

    Maybe it was a hoax. Maybe it WAS.

  140. Re:Why is everything "trolling" to people like you by Dahamma · · Score: 1

    Yes, it was a hoax. It WAS. :)

    http://www.snopes.com/man-dele...

  141. CONFIRMED HOAX... by Dahamma · · Score: 1

    I know this article is "old" by now, but, it's already been 100% proven hoax, confirmed by the original perpetrator:

    http://www.snopes.com/man-dele... /. lack of any technical editors or researchers strikes again!