Possible home directory rename/deletion question - but perhaps different?

Discussion in 'Mac Basics and Help' started by invinciblewhale, Jun 11, 2008.

  1. invinciblewhale macrumors newbie

    Joined:
    Jun 11, 2008
    #1
    Hello everyone! I'm new and this is my first post.

    I am running OSX 10.5.3 on a 3-month old Macbook Pro 17inch... It was working fine until yesterday. I'm not sure what brought this on -
    After lots of research and shot nerves, I think I discovered that it is displaying the same symptoms as when you accidentally rename your home directory. However, mine are a bit different. I did reboot the machine after it seemed a bit glitchy, and then it was like I just took it out of the box! All my preferences were default - the welcome video played, some shortcuts in the dock were replaced by icons of "?"... and ALL of my files were gone! Some of my applications like itunes, ichat, ical, iphoto are all gone too. But some applications that I had installed later such as Adobe CS3 and Adium are still there.

    The closest thing I can find to this problem is "accidental renaming of the home directory". However, in all the other posts where people say they have accidentally renamed their house, they have been able to find all of their files somewhere else (please correct me if I'm wrong). All of my files (and some applications) are absolutely gone. I have searched everywhere! And no, searching for them with spotlight has brought up nothing. There is ONE file that was there before - a photograph I took that maybe I didn't have permissions to delete. This is weird: before the reboot (when everything was working sort of normally), there was lots of miscellaneous stuff in the trash. Now there is ONLY the aforementioned photo - and I didn't put it there in the first place and I didn't empty the trash.

    Would a renaming of the home directory have put all my files in the trash and emptied it?

    Also, I don't remember renaming the house. I may have moved it on accident - but is the remedy the same? I found this: http://docs.info.apple.com/article.html?artnum=107854
    but am hesitant to do this, in case it doesn't work (in case it's not actually what's wrong) and I have to do data retrieving.

    I would really appreciate any sort of advice anyone can give me. This is so very distressing as I was in a slow process of backing up my files but hadn't gotten to all of it before it happened. :(

    Thanks in advance.
    -invinciblewhale
     
  2. varmit macrumors 68000

    varmit

    Joined:
    Aug 5, 2003
    #2
    Have you check the disk using Disk Utility. I'm thinking there might be a possible issue with the drive and a whole section just went missing due to a bad bit in the wrong spot.

    Also, did you add anything to the trash before you reboot? I'm thinking that your home directory might be in the trash for you username, thus its deleted, but not deleted, and not really findable though another username since the trash is locked to that user. Something like that.
     
  3. invinciblewhale thread starter macrumors newbie

    Joined:
    Jun 11, 2008
    #3
    Hmm possibly..

    Thanks very much varmit for your suggestion. (Sorry, I forgot to mention that I called mac tech support after this happened - all they had me do was run disk utility and we found that nothing was wrong with the HD). *BUT* Since my last post, I think I have ascertained what happened, yet I still need help as to what I should do now:

    I think I may have moved my home directory from the /User folder into the left side pane of finder where it has shortcuts to things like "Shared", "Places", etc... I just wasn't thinking when I did this - and I thought I was merely making a shortcut. HOWEVER, think that in doing so, I acually accidentally dropped the house into the column grouping called "Shared" instead of "Places" first, and then either A) just dragged the house from "Shared" into "Places" or B) deleted the house that went into "Shared" and redragged the house from /Users into "Places". Shortly after is when I was forced to restart the machine. - Then the calamity ensued.

    Before this catastrophic reboot, I'm pretty sure there was lots of random junk in the trash but I am sure that I DID NOT EMPTY THE TRASH. Now, there is just one file in the trash that I know I never put in there (since it was part of the stuff I am trying to retrieve) - and I have a hunch that it's still in there because it was a locked file - the permissions wern't mine to delete. This scares me because it leads me to believe that ALL of my work was deleted from the trash (even though I didn't put it there). If this is the case, do I need to seek a data retrival service? It's been suggested to me that I use a Unix search to find my misplaced home directory...

    What would you guys do?

    Thank you so much for reading this!
    -iw
     
  4. invinciblewhale thread starter macrumors newbie

    Joined:
    Jun 11, 2008
    #4
    I think that you're right...!!
    Do you know of any way to fix this?

    thank you
    -invinciblewhale
     
  5. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #5
    First of all, here's the good news - you shouldn't need a data retrieval service. The bad news: Restoring your misplaced home directory is going to be a bit of a pain. First of all - do you know what your short user name is? It's the name on the house that's there currently. Secondly, have a look in the Shared folder, and any other folders you might have dragged the old home to by mistake, looking for a folder with the same name.

    Once you've located it, you'll need to boot the Mac into Single-User Mode (to avoid any weird issues). To do this hold down Command and S after you hear the Mac's startup chime (if you have the chime disabled, it's when the optical drive makes that noise that it makes when it's looking for a disc - this happens BEFORE the startup chime normally).

    Once in Single-User Mode you'll see a UNIX command prompt, and you'll be the root user. The first thing you'll need to do is this command:
    Code:
    mount -uw /
    This makes the boot volume writable, so you can make changes.
    Be VERY careful from this point onward - if you make a mistake you could delete your old home directory by accident, which would make your situation even worse than it already is.

    Anyway... first step is to remove the "fake" home directory:
    Code:
    rm -r /Users/shortname
    where shortname is your short user name you identified earlier.

    Secondly, copy the real one to the right place (preserving permissions):
    Code:
    cp -pR /path/to/real/shortname /Users/shortname
    Again, substitute the real path for /path/to/real/ and your short user name for shortname.

    Third, verify the permissions:
    Code:
    ls -ld /Users/shortname
    ls -l /Users/shortname
    You should see that the folder is owned by shortname and has the group admin. If that's not the case, fix it with this command:
    Code:
    chown -R shortname:admin /Users/shortname
    Finally, reboot the Mac, so the change takes effect:
    Code:
    reboot
     
  6. merl1n macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #6
    Wrldwzrd89,

    If he boots into single user, he is "root user". If he then copies over (instead of mv) his real home folder to the correct location, isn't this directory now owned by root or will it keep the original owner:group and permissions?

    Not trying to step on your toes. :)
     
  7. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #7
    Thanks for pointing this out - it should keep the original owner and permissions, as far as I know. I'm only using cp because mv doesn't support recursive move.

    Oh, wait... just checked the flags cp supports. Really should add the -P flag to make sure permissions get preserved. So the cp command becomes:
    Code:
    cp -pR /path/to/real/shortname /Users/shortname
     
  8. merl1n macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #8
    Also, before he reboots, I would have him check the ownership and group on his home directory (after the copy).

    ls -ld /Users/shortname
    ls -l /Users/shortname

    Worst case, he has to issue a:

    chown -R shortname:admin /Users/shortname

    HTH
     
  9. merl1n macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #9
    Actually if you use the -R option, you don't need the -P option since that would be the default.

    From the man page on cp:
    Actually the option needed is cp -Rp to preserve ownership, permissions, etc.

    Again from the man page:
     
  10. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #10
    Thank you! Fixed. :)
     
  11. invinciblewhale thread starter macrumors newbie

    Joined:
    Jun 11, 2008
    #11
    Thanks very much to both of you for all of your help. I really do appreciate it! I am going to try this for sure - but I've tried looking for my home directory folder with the same name and haven't been able to find it yet. (It's called ahirscha)...

    do you guys have any tips on finding this? will the folder look like a folder or a house? and will i find it if it has been moved to the trash accidentally?

    Thanks again
    -iw
     
  12. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #12
    It'll be just a plain old folder, and yes - if it's in the Trash you should recognize it right away.
     
  13. invinciblewhale thread starter macrumors newbie

    Joined:
    Jun 11, 2008
    #13
    Giving up... :(

    Okay so I had my friend who knows Unix pretty well to look for my missing home directory. I showed him everything you guys told me to do, and we just could not find that original home directory anywhere. My theory is that it got moved to the trash AND emptied somehow. Is this scenario consistent with what you would imagine would happen if a home directory got dragged to the trash?

    If we could find that folder, I'd be able to fix it - but I've tried a number of different searches and they all came up empty handed.

    I think that now, my only option is going to data recovery. What do you guys think?

    -iw
     
  14. merl1n macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #14
    Before going for data recovery, I would try an fsck (file system check) on the disk. It just possible that your inode count is wrong or there is a problem with the directory structure.

    Boot single user as your did before. Then at the prompt type these commands (in bold) followed by a return key.

    /sbin/fsck -fy

    If it comes up clean then that blows my theory. If it shows errors that it can correct, keep running the command (up to 6 times) until it does show up clean. Then type...

    reboot

    Now go look for your old home directory again.
     
  15. invinciblewhale thread starter macrumors newbie

    Joined:
    Jun 11, 2008
    #15
    hmmm



    Merl1n
    thanks very much for your suggestion. unfortunately, i already took it to a data recovery guy by the time you wrote your post. i just got my computer and hard drive back from him yesterday, and all of my files are very unorganized. i am in the process of going back and seeing if they're all there and not corrupted. and weeding through all the tutorial files and useless files that came with certain programs.

    he didn't do anything to my computer (mac osx was not re-installed, so my computer is just as it was when i gave it to him. the only difference is that now there is a mess of files on this external harddrive) - and i'm thinking that a lot of my files are gone still.... i may try your trick still, but only after i have burned all my information to DVD. I'm willing to try anything. Thanks again. I'll let you know.

    -iw
     
  16. merl1n macrumors 65816

    merl1n

    Joined:
    Mar 30, 2008
    Location:
    New Jersey, USA
    #16
    Before doing the following, disconnect any external drives you may have connected as well as ejecting any CD/DVD you may have mounted.

    In the Terminal app, you can type these commands as the "root user" to try to find the directory "ahirscha":

    sudo -s (become the root user)

    Now to find it...

    find / -name ahirscha -print

    This will take a long time as it is searching your entire disk.

    If it finds it, note the path to the directory.

    To exit from the root user, type:

    exit

    It would have been better to do all of what we suggested prior to bringing it to data recovery since your disk is now a bit scrambled.
     

Share This Page