Deleted my "var," folder... What's my best option?

Discussion in 'macOS' started by al256, Sep 30, 2007.

  1. al256 macrumors 6502a


    Jun 7, 2001
    Sorry to bring this up again after it was recently covered,

    but, I deleted my var alias while cleaning up my harddrive before a complete backup. I was about to run OnyX but was unable to because my password no longer worked. I restarted and was forced to create a new account. Help!

    Because I do backup I have a month old copy of everything, including that var. I want to know which is the best route to take to try and restore my old user account. Do I follow the previous thread? Does someone else have a different idea? Is it better to somehow move all my files over to this newly created account?

    On a side note: When I tried to bootup using my external USB drive it went into a darwin like mode then froze, then I restarted only to find I can't use it to bootup. This has worked perviously in times of need.
  2. Makosuke macrumors 603

    Aug 15, 2001
    The Cool Part of CA, USA
    To confirm, we're talking about the alias at /var, or the whole folder at /private/var?

    If it's the alias, you should theoretically be able to just recreate it. If it's the actual var directory, you can theoretically copy it over from your backup and it SHOULD work... but that's not what I'd do.

    I believe the safest thing to do (or at least the one that would cause the least weirdness down the road) would be to do a full Archive and Install of the OS; assuming you didn't delete anything in your home directory, that should give you a clean copy of the OS with your user data intact.

    Alternately, if you also wiped something from your user account or want the REALLY long one, you could: backup your files, do a clean install of the OS, then use the Migration Assistant to bring your users over from your month-old backup, and finally manually copy over any files modified within the last month from the backup of the screwed-up one.

    That's pretty foolproof, albeit time consuming.
  3. al256 thread starter macrumors 6502a


    Jun 7, 2001
    Well, the folder had that alias little arrow. That's why I felt comfortable removing it. Is there oddly someway that the OS needs the alias to be there to function as my user account? Could everything be safe and sound somewhere on my harddrive? If so, where could I find it? How would I put it back there in a functional way?
  4. SC68Cal macrumors 68000

    Feb 23, 2006
    You might have just deleted the alias. You can recreate it. If you deleted the actual directory that the alias points to, then you're screwed.

    What did you use to delete it? Finder? rm? what parameters did you use if you used rm?

    Here's what the alias should be set to.

    lrwxr-xr-x     1 root      admin       11 Aug  4 18:31 var -> private/var
    Be a little more careful with what you do while running as root?
  5. al256 thread starter macrumors 6502a


    Jun 7, 2001
    I just used the Finder and typed the password. Root isn't activated on my machine. Thank you for your response.

Share This Page