Please Help - Accidentally Deleted Private Folder

Discussion in 'macOS' started by MimUK, Apr 28, 2009.

  1. MimUK macrumors member

    Joined:
    Jan 31, 2005
    #1
    Please could someone help.
    I have accidentally deleted the Private folder in the root of the HD
    Now OSX will not boot.

    The folder is still sitting in my Trash folder and I would like from the Boot CD Terminal to copy back from the trash to the Macintosh HD/ location

    Any help is greatly appreciated.

    Mim
     
  2. melchior macrumors 65816

    melchior

    Joined:
    Nov 17, 2002
    #2
    so why don't you do exactly as suggested, boot from install cd, use terminal, mount drive and move the folder. should boot without a problem. permissions may likely be bunk though, so you can issue a sudo diskutil repairPermissions / if things are still not happy.

    good luck.

    i guess this is the reason os x makes system folders hidden.
     
  3. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #3
    I think the command you need is:

    mv /Users/you/.Trash/private /
     
  4. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #4
    Sorry for my ignorance.
    Please could you explain how I mount the image from the terminal and copy back to the root folder.
    I am not sure of the syntax

    Cheers
     
  5. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #5
    Thanks, will give it a try

    Mim
     
  6. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #6
    I get no such file or directory if I follow the code above :(
     
  7. Ivan P macrumors 68030

    Ivan P

    Joined:
    Jan 17, 2008
    Location:
    Home
    #7
    Are you making sure to replace 'you' with the name of your own Home folder?
     
  8. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #8
    Yes
     
  9. Ivan P macrumors 68030

    Ivan P

    Joined:
    Jan 17, 2008
    Location:
    Home
  10. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #10
    I have managed to terminal into the .Trash folder and i can see the private folder in there

    Sean
     
  11. melchior macrumors 65816

    melchior

    Joined:
    Nov 17, 2002
    #11
    if you have cd'd into the trash folder, you can do

    Code:
    mv ./private /
     
  12. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #12
    OK, now I have override rwxr-xr-x root/wheel for /private? y/n [n]

    Should I override or not?
    Many thanks
     
  13. MimUK thread starter macrumors member

    Joined:
    Jan 31, 2005
    #13
    If I select Y
    I get rename ./private to /private: read-only file system
     
  14. melchior macrumors 65816

    melchior

    Joined:
    Nov 17, 2002
    #14
    it's a permissions issue. i would have thought the installer terminal is in single user mode, but obviously not.

    try
    Code:
    sudo mv ./private /
    if it asks for a password, just press enter. i can only assume that the root user has no password assigned...

    it's possible that the mounted drive is in read-only mode, though again, this seems unlikely. try to see if you can create a file.
    Code:
    cd /Users/yournamehere/
    Code:
    touch yada.txt
    Code:
    ls yada.txt
    this would be a bucket-load easier if you had another mac...
     

Share This Page