All my files are GONE!

Discussion in 'macOS' started by cjromb, May 24, 2009.

  1. cjromb macrumors newbie

    Joined:
    May 24, 2009
    #1
    I was using SynchroSVNClient and Mac VIM. I had accidently saved a file named ~ when I was in MacVIM. In SynchroSVNClient, I chose to delete this file. I don't know if this is some special character to the Mac or something, but as soon as I let it delete, it deleted EVERYTHING, and I mean EVERYTHING! My background on my desktop, all files on my desktop, everything under all my document areas, my recently taken movie of my 97 year old gma and I (not backed up yet) EVERYTHING! I reboot, it's lost my settings for the bottom docking bar.

    I'm new to Mac, but I'm NOT new to computers. This is a bad, bad bug in my opinion that deleting a file with a goofy name like that would cross over to the operating system and do that kind of damage.

    Is there anyway for me to recover this data???

    CJ
     
  2. r.j.s Moderator emeritus

    r.j.s

    Joined:
    Mar 7, 2007
    Location:
    Texas
    #2
    ~ is not a file with a goofy name in UNIX systems ... it is the user's home folder. This is not a bug, it just deleted your home folder, exactly as you told it to.

    Might it be in the Trash still?
     
  3. Ivan P macrumors 68030

    Ivan P

    Joined:
    Jan 17, 2008
    Location:
    Home
    #3
    On a Mac (and most if not all UNIX systems, I believe), '~' stands for the home folder (basically the folder that contains all your documents, music, videos, preferences, etc). Even though your home folder would be represented by your username in Finder (for example, my home folder is automatically named 'ivan'), it is recognised by the system as '~' instead (for example, ~/Documents refers to the documents folder in my home folder). It seems that you told it to delete your home folder.

    EDIT: looks like r.j.s. beat me, that's what I get for spending a few minutes making an explanation :p
     
  4. Cerebrus' Maw macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Brisbane, Australia
    #4
    What he said. When the ~ was encountered, it probably wasent escaped, and so it kept its UNIX meaning and the file path was reset back to home, and then deleted.

    If it's not in Trash, you could try Drive Savers, or there might be some free Data Recovery kits around.
     
  5. cjromb thread starter macrumors newbie

    Joined:
    May 24, 2009
    #5
    Except I was in a subdirectory and I told it to delete a FILE called "~". It's not in the Trash, and I'm currently running StellarPhoenix, hoping it will find something. If not, I will try what you're recommending, the Drive Savers.

    I'm lucky I check code in obsessively, so I didn't lose my day's work - I'd just gotten done checking everything in, and was cleaning stuff up (like that goofy file name I'd accidentally created)

    BTW, I create that file sometimes when I miss the exclamation point with the w! when I'm saving in vi - nothing like getting massively burned for a typo!

    Thank you so much for answering so quickly!!
     
  6. r.j.s Moderator emeritus

    r.j.s

    Joined:
    Mar 7, 2007
    Location:
    Texas
    #6
    I don't think it matters to UNIX where you are in the file system, if you reference ~ or any of the root folders, such as /, it will recognize them as they are, not as parts of the subdirectory.

    Hopefully you can get that video back as well.
     
  7. melchior macrumors 65816

    melchior

    Joined:
    Nov 17, 2002
    #7
    stop using the computer. turn it off.

    you will need another mac to run data recovery software to retrieve important things such as your grandma video. if you haven't tried to create new files or copy things around, you should be ok.

    there are a number of options. i've used "data rescue II" and "phoenix stellar" with success, but most work in the same way. you tell it to look for jpg or mov or doc and that's what it will track down. unfortunately it normally means losing your directory structure.

    you know for next time.

    also, when someone tells you to type:
    Code:
    sudo rm -rf /
    don't.
     
  8. cjromb thread starter macrumors newbie

    Joined:
    May 24, 2009
    #8
    I sure feel like it's a bug when an operating system doesn't recognize the difference between a filename like "~" and asking it to delete ~ meaning the home directory. The filesystem shouldn't let me SAVE a file named "~" in the first place if it could be that devastating. Or it should check the "~" I've just requested to see if it's a file vs. a directory vs. some command with special meaning. If it had checked to see if "~" had the characteristics of a file, it certainly would have found that it did. It wasn't full of other files, it wasn't a directory. It was a file.

    To me, that's a bug, when it can check for something like that, and it doesn't.

    I don't have another Mac to use for recovery. I can't use a portable hard drive? I did already remake one directory, but I see how this Stellar is checking fragments and sectors so making anything new could write that stuff over. I won't make anymore like that. I'll wait until it finishes this scan and then figure out what to do from there. So far it's been running for quite a long time, and hasn't found anything.

    I'm going to try to sleep and hopefully this will all turn out to be a bad dream in the morning. I just want that one video back. That's all, just that one. I can recover everything else or live without it.

    Thx again. You're all really responsive, which is way cool.

    Also, is there a way to mark my files as locked so if I ever do something stupid like that again, the locked files wouldn't be deleted?
     
  9. jabrowntx macrumors 6502

    Joined:
    Jul 5, 2007
    #9
    Check out the chgflags command (man chgflags). It should do what you're looking for. Just keep in mind that if you protect your entire home directory, you'll not be able to write temp files, settings changes, documents, etc.
     
  10. melchior macrumors 65816

    melchior

    Joined:
    Nov 17, 2002
    #10
    it's the difference between ~/ and ./~ subtle, but important.

    i doubt you'll make this mistake again...

    for what it's worth, the 'rm' command would warn you about it being a directory, but SynchroSVNClient isn't so conscientious. I assume they assume you know what you're doing.

    in terms of your data recovery, what you're doing may be destructive to your data. you can boot off a recovery disk to use stellar and recover to an external hard disk. you could also install os x onto an external hard disk and boot from that that drive and recover that way. you could also at this point use dd to backup what is hiding in those sectors in case you stuff up with stellar.

    i'd go for option 2, if this is possible for you. it will be the quickest and easiest and safest.
     
  11. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #11
    Is it worth asking if you had a Time Machine backup? More and more stories like this have me pretty spooked about even thinking of not having a backup for all of my data.
     
  12. cjromb thread starter macrumors newbie

    Joined:
    May 24, 2009
    #12
    Melchior, I don't have a clue how to make a recovery disk. I have an external hard drive with plenty of space for the amount of data I had (I realized all my podcasts and music are gone as well, which is a nasty loss).

    No, I don't have Time Machine configured yet. I just got the Mac a few weeks ago, and mostly I've been doing work that I check into SVN on a webserver almost immediately. Interestingly enough, I've ALWAYS stored my data on an external hard drive that was backed up until I got this Mac. Didn't realize I had really put anything important on it until I did this.

    So, Melchior, you think I should boot off a recovery disk? I don't have one, I don't know how to create one. When I search, I find a forum post that makes it sound like creating one is a pain in the patoot, too.

    And you're right, I won't get burned by this again. Soon as I figure out how to recover from THIS burning.

    Ideas on where/how to get a recovery disk? I'd know exactly what to do if I was on a PC, but that ain't how it is right now, and I need some help figuring this out.
     
  13. Jethryn Freyman macrumors 68020

    Jethryn Freyman

    Joined:
    Aug 9, 2007
    Location:
    Australia
    #13
    Data Rescue 2 and Testdisk/Photorec are good data recovery utilities.

    Hiren's Boot CD includes Testdisk and Photorec.

    http://www.hiren.info/pages/bootcd

    You'll need an external hard drive to save recovered files to.
     
  14. CalMin macrumors 6502a

    CalMin

    Joined:
    Nov 8, 2007
    #14
    This is a horrific story. I've been using OS X since 2001 and did not know something like this could happen. I've lost data before on other platforms, mainly because of my own stupidity. This just goes to show that you must always run backups. Time Machine makes it easy. Nothing to configure - just plug and play. A lesson learned the hard way then...
     
  15. Objectivist-C macrumors 6502

    Joined:
    Jul 1, 2006
    #15
    No, it isn't a bug, and yes, there are sound reasons for why it really shouldn't check. Sorry to hear about your data loss, however. Not the most pleasant way to learn the ropes.
     
  16. michael.lauden macrumors 68020

    michael.lauden

    Joined:
    Dec 25, 2008
    #16
    so you deleted your files through a myriad of programs
     

Share This Page