Accidentally deleted private folder now can't open my Mac :(

Discussion in 'Mac Basics and Help' started by Jasper1990, Jul 7, 2014.

  1. Jasper1990 macrumors newbie

    Joined:
    Jul 7, 2014
    #1
    I needed help! I made one of the dumbest mistake. I deleted the private folder file /var. it is still sitting in my trash. I restarted my computer now It's stuck in a grey screen. Can I still restore the private file back without without an installer cd? Or just using the terminal?

    I have a MacBook Pro 13, (mid 2012) running lion OS X.

    Please help.
    Quote Edit
     
  2. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #2
    Start the computer from the Recovery Partition (command-R at startup) and choose the install OS X option to reinstall Lion. It will reinstall the system files you deleted but won't overwrite your files.
     
  3. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #3
    Thanks for replying sir!

    I tried it last night! But it says 2,9494733 hours left! Somethin like that! Is that normal? It is taking soo long!

    My computer specs is, i7, 8gb ram. 2.9 ghz
     
  4. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #4
    It has to download the operating system from Apple, so the time it takes is dependent on your internet connection speed.
     
  5. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #5
    Oh okay. I think my internet is pretty decent here. :(

    Hmm. Do you know how I can bring back the private folder from the trash back to the original place using a terminal?
     
  6. chrf097 macrumors 68040

    chrf097

    Joined:
    Dec 16, 2011
    #6
    Question, how did you manage to delete the vars folder? :confused:

    As for restoring via terminal, I know there is a way to restore files but I believe you have to actually be logged in as that user, but here are instructions I found on Google that may help. You can always try.

    If you have another computer you can access that can read the Mac OS File structure, you may be able to plug your hard drive in and restore it manually as well, but that's very tricky and not guaranteed.

    Otherwise I'd just wait for the download to finish and reinstall. You might want to go to a place with ethernet connections like a library. For me when I had to reinstall Lion it took about 30-40 minutes to download the installer on my internet connection.
     
  7. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #7
    Even if you do manually restore the critical /var/ folder, you'll never fix all the permissions in it. Even Disk Utility won't fix them all correctly.
     
  8. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #8
    Really? So basically? I'm doomed? Won't retrieve all my files?
     
  9. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #9
    Do the reinstall as suggested by chrfr above. That should fix the problem and allow you to recover your files.
     
  10. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #10
    Okay. If I restore my files using the terminal. Will it delete all of it?
     
  11. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #11
    Do what is suggested in post #2. Trying to restore the /var/ folder via the Terminal will cause problems as the permissions will be incorrect.
     
  12. velocityg4 macrumors 68040

    velocityg4

    Joined:
    Dec 19, 2004
    Location:
    Georgia
    #12
    chmod -R 755 and chown -R root:wheel for the folder wouldn't work?
     
  13. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #13
    That would cover most of them, but there are some other critical ones have have special permissions that will cause problems if they don't have the exact correct permissions.
     
  14. BL4zD macrumors 6502

    Joined:
    Sep 22, 2010
    #14
    If you can get access to your system, either through safe mode or booting up with a time machine backup or another operating system, you can simply use the move command to put the folder back where it belongs. Permissions shouldn't be affected and not sure why people are suggesting they would be.
     
  15. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #15
    I actually with all the hard work restored it back through the terminal and now my Mac is working but now Some apps are not working properly! :( I guess I needed to re install the OS. What I'm really after is the files in my hard drive. :(
     
  16. Chad3eleven macrumors regular

    Joined:
    Dec 11, 2012
    #16
    So you fixed it?

    You said you fixed it via terminal, and your mac is working, but you really want the files from your harddrive.

    whats stopping you from doing this?

    Also, you can/could hookup your mac to a different mac and access your files.
     
  17. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #17
    Because when I rebooted it and tried to log in, I can't go back to my Mac and now stuck in the log in section . Tried to do the classic hack (applesetupdone) for the users but it doesn't help like I made three accounts already but won't let me in.

    How do I get my files using another computer?
     
  18. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #18
    You're having problems because your permissions are messed up. The mv command won't be enough to properly correct it and will result in permissions problems because of how Finder treats the Trash. Things that go in there get quasi-user permissions that can only be corrected by the Finder. Because you get get to the Finder, you can't properly restore that folder without permissions problems.
     
  19. chabig macrumors 68040

    Joined:
    Sep 6, 2002
    #19
    Do what was suggested in post #2 and you'll be fine.
     
  20. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #20
    Yes I did follow it but I don't know I've tried many times! It says,
    About -2147483648 hours remaining.. What the heck is that? My internet is pretty decent but why that long? Is it still because of the var file deletion?
     
  21. Jasper1990 thread starter macrumors newbie

    Joined:
    Jul 7, 2014
    #21
    Planning to boot it with a re bootable OS In a flash disk.

    My friend told me "Boot from flash drive, divide your hard drive into two partition, copy files to second partition. Then after that reformat first partition. " because I don't have an external with me. I'm currently traveling :(
     
  22. BL4zD macrumors 6502

    Joined:
    Sep 22, 2010
    #22
    If /var has the wrong permissions set then correct that problem rather than partitioning, reinstalling, etc. first step is to try and fix permissions through disk utility. Then open terminal and fix /var owner. I don't have my MacBook with me, but you can check if it's wrong by doing: ls -la and seeing who the owner is. If it's your user name then change it by: sudo chown -R root /var
     
  23. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #23
    Disk Utility cannot correctly fix all the permissions in /var/. Not all of the permissions in /var/ are root:wheel or 755. Some belong to the mail, sys, daemon, or _amavisd group. Most are executable, some are not. A few are read only, some are read/write.
     
  24. BL4zD macrumors 6502

    Joined:
    Sep 22, 2010
    #24
    It should only have changed the ownership, not the rest. Using disk utility and changing ownership back to root will get his system running enough to get his files, which is what he said he needs to do while on the road.
     
  25. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #25
    The files still won't be in the correct group and that will cause problems.
     

Share This Page