Two identical "Users" folders are appearing!

Posted:
in Genius Bar edited January 2014
This is a bug I first noticed maybe two weeks ago. Eventually it just went away. But now it's back, and it won't go away. I have an 800 MHz iBook running 10.2.6 and for some reason there are two "Users" folders. There's only one user for the computer, and besides, it's not like there are two "Home" folders. Anyway, the Users folders are identical in every way, and they don't take up any extra room. I had about 4 GB free on my hard drive before the problem occurred and it hasn't changed since the problem appeared. When I tried putting everything from one of the Users folders in the trash, everything in the other one moved too, so it's like the same item is appearing twice. The other Users folder appears in all three views (Icon, List and Column), but when I switched to Icon view from my main view, Column view, they were on top of each other so it appeared as though there was only one.



Any idea what's going on? Will this just require a restart to fix?
«1

Comments

  • Reply 1 of 30
    Yikes! That's strange. Just do what I do when OS X acts up - restart in OS 9, and delete everything!



    Seriously, if you're positive they're identical, move one of them to the trash in OS 9, but don't empty it till your computer's worked right for a day or two.
  • Reply 2 of 30
    lucaluca Posts: 3,833member
    No, they're identical but they occupy the same space on the hard drive. Anything I do to one of them is done to the other. If I were to delete the contents of one of them, I'd end up getting rid of the other one too. I have no idea why, but it doesn't take up any extra room to have two Users folders vs. one, but it looks quite strange.
  • Reply 3 of 30
    baumanbauman Posts: 1,248member
    Try open up the NetInfo manager in the Utilities folder.



    Take a look in /users. See if there are any other users that have the same home folder as you. Also make sure that your user doesn't have two entries for the home folder. Beyond that, I'm stumped.



    That's really odd.
  • Reply 4 of 30
    lucaluca Posts: 3,833member
    I checked with NetInfo Manager. No other users with the same directory, and I only had one Home directory listed.



    I did see a couple that looked strange though - one named "nobody" and one named "unknown." What might those be?
  • Reply 5 of 30
    Let me repeat myself. This time, I'll type a little louder.



    Just restart in OS 9, if your machine will let you, and delete one of the folders. End of problem.



    Don't mean to be sassy - I feel like no one's listening to me.
  • Reply 6 of 30
    baumanbauman Posts: 1,248member
    Quote:

    Originally posted by francisG3

    Let me repeat myself. This time, I'll type a little louder.



    Just restart in OS 9, if your machine will let you, and delete one of the folders. End of problem.



    Don't mean to be sassy - I feel like no one's listening to me.




    He did hear you. He said that they are the same thing... what happens to one happens to the other. If he adds a file in one, he adds a file to the other. If he deletes a file in one, it gets deleted in the other.



    And those nobody and unknown users are standard system users.



    My question is how do symbolic links show up in the Finder? Could it be a symLink? Go into the terminal and type "ls -l /Users", and post what it gives you.
  • Reply 7 of 30
    Quote:

    Originally posted by bauman

    He did hear you. He said that they are the same thing... what happens to one happens to the other. If he adds a file in one, he adds a file to the other. If he deletes a file in one, it gets deleted in the other.



    I give up.
  • Reply 8 of 30
    kickahakickaha Posts: 8,760member
    Quote:

    Originally posted by francisG3

    I give up.



    Good, because your advice here would only trash his /Users folder completely. Sorry, but you're wrong on this one. We heard, we listened, we digested, we said "No thanks."



    Luca, have you run a simple Disk Utility check? Try booting into single-user mode and inspecting from the command line. Are both copies still there? Look for a hardlink (not a symbolic link).



    Is /Users by any chance being shared? (I've seen some wonkiness with Sharing under MacOS X Server... on one machine, Users refuses to show up in connection panels as anything other than Users(1)...)
  • Reply 9 of 30
    der kopfder kopf Posts: 2,275member
    Quote:

    Originally posted by bauman

    Could it be a symLink? Go into the terminal and type "ls -l /Users", and post what it gives you.



    It pretty much sounds like a hard link (standard Unix, two references pointing to the same 'content' on your disk, unlike a soft link -'alias' in macos terms- where you have a reference to another reference -the latter pointing to content on your HD- google up 'unix hard link' or something if you want to know more), which is a bit strange, since I thought OS X didn't handle hard links well (I even tried with the ln command). Although that may very well be the reason of your problems. Do you remember what started it? What programs you installed?



    One unelegant solution: copy your entire users folder (preferably with something like Carbon Copy Cloner, to make sure all privileges are transferred correctly), and name it 'luca copy' or something. Then delete the two old folders and then rename the copy to what it was called. This is quite invasive, so you will have to login as root to perform to final two tasks. You could just move all of the stuff to a folder 'luca copy' when logged in as root, that will save you some disk space.



    Do you know how to log in as root?
  • Reply 10 of 30
    lucaluca Posts: 3,833member
    I'm not sure how to log in as root. I have done some tinkering, but only through changing permissions, using TinkerTool to show hidden files, or using the terminal for things like sudo rm. But I haven't really gotten into the nitty-gritty of UNIX.



    Restarting the computer didn't fix the problem. Right now I'm performing a repair on disk permissions. That might have something to do with it.



    Anyway, assuming this permission repair doesn't work, how do I look for a hard link and eliminate it? I am not even quite sure what a hard link is... something like an alias, but it looks like a duplicate?
  • Reply 11 of 30
    kickahakickaha Posts: 8,760member
    Man, there are so many layers of things that could be going wrong here... oy.



    Okay: hardlink is a symbolic link from heck. It looks like, acts like, sounds like, and tastes like the original. (Don't ask.) Deleting a symbolic link is like deleting a Finder alias... it deletes a little pointer. Deleting a hardlink *deletes the original*. For all intents and purposes, it *IS* the same as the original. (It lets you put 'the same file/directory' at two or more different places in the folder hierarchy.)



    That's the disk level.



    Then there's the NetInfo level, dealing with share points.



    Then there's the Finder, that takes all this info and whips into a UI frappe before serving.



    Any one of these layers could be causing this. Start at the bottom and work your way up... disk repair, permissions repair, look for a hardlink, etc, etc. Then peer into NetInfo and see if there's a bogus share point there (try looking in the Sharing section of a Finder Get Info pane for the Users folder first, obviously).



    Then we get to the fun stuff.



    Did I say oy? Oy.



    Oy I say! Oy!
  • Reply 12 of 30
    lucaluca Posts: 3,833member
    I don't know what you just said... man, this is quite a problem for just a little duplicate.



    Anyway, the permissions repair has finished and it didn't fix anything. I'll try doing a disk repair once I get back home to my CDs. Now I have to go to class though (hooray for college!).



    How do I do all of that stuff? I only understood about half of what you said and I only know how to do about 1/10 of it.
  • Reply 13 of 30
    i thought hard links could only go to files, and not folders. if so, it would be quite strange for someone to have hard linked all of luca's home into a new directory.



    also, rm'ing a hard link doesn't destroy the original file, i think. i dont have access to my mac right now, but in cygwin it don't (i know cygwin aint exactly a real *nix, but its supposed to be pretty darn close).



    if deleting a hard link got rid of both it and the original, how would one ever get rid of a hard link once it was created, without destroying the original file?
  • Reply 14 of 30
    dobbydobby Posts: 797member
    to check for a link (I though you could only hardlink files and not dirs)

    open Terminal (Applications/Utilities)

    In The terminal window

    $ cd / (Changes directory to the 'root' or top level)

    $ ls -la | grep Users (full directory listing and display only Users)

    You should see the following.

    drwxrwxr-t 8 root wheel 272 Aug 21 16:19 Users



    if you see

    drwxrwxr-t 8 root wheel 272 Aug 21 16:19 Users

    lrwxrwxr-t 8 root wheel 272 Aug Users -> Users



    Then the link is a soft link.



    You can remove a softlink of a dir safely.

    rm Users

    This can't remove the actual dir as you need a -r.



    Dobby.
  • Reply 15 of 30
    kickahakickaha Posts: 8,760member
    <edmcmahon>You are correct, sir!</edmacmahon>



    From the ln man page: "A hard link to a file is indistinguishable from the original directory entry; any changes to a file are effective independent of the name used to reference the file. Hard links may not normally refer to directories and may not span file systems."



    It's the 'normally' that gets me... I could swear there were maaaaagical ways to produce hard links to directories, but you're right, that's probably not the case here.



    Also, you are right that deleting a hard link will not erase the file. Overwriting with a NULL will, however, wipe the contents for all table entries. (Don't ask... bad bug, bad memories, don't wanna talk about it.)
  • Reply 16 of 30
    Quote:

    Originally posted by Kickaha

    Good, because your advice here would only trash his /Users folder completely. Sorry, but you're wrong on this one. We heard, we listened, we digested, we said "No thanks."



    So far no has explained to me why restarting in OS 9, moving one of the user folders to the trash, and restarting in OS X wouldn't work. Everyone's said, "Oh, when he does this, it happens to both," and "Oh, then you'd trash the users folder," and what not.



    I understand that in OS X, when you move one, the other will follow. But I'm thinking that in OS 9, you can move one folder, and the other will stay put.
  • Reply 17 of 30
    lucaluca Posts: 3,833member
    dobby, I just tried what you said. First I tried putting the $ signs in but it didn't work so I assumed you put those in for some unknown techie reason but anyway I eventually got it to display this:



    Code:


    drwxrwxr-t 6 root wheel 204 Aug 30 03:49 Users



  • Reply 18 of 30
    lucaluca Posts: 3,833member
    Francis, now that I'm back at home with my external hard drive (which has OS 9 on it) and all my CDs I can try that out. My guess is that OS 9 won't know what a hard link is, and therefore it'll only display one Users folder. But it's worth a try.



    I will also try a disk repair.
  • Reply 19 of 30
    lucaluca Posts: 3,833member
    I booted into OS 9 to see if I could find both Users folders. As I suspected, only one appeared. So it had to be an OS X problem.



    Then I booted from the CD and did a disk repair. Verification gave me an error that said something along the lines of "Invalid directory count, should be 32 instead of 33" so I assumed that was the problem. Repaired the disk, and now there's no problems. Thanks for all your help everyone, it must have been something a bit more mundane.
  • Reply 20 of 30
    kickahakickaha Posts: 8,760member
    Yeah, the thing we said to do first.



    francisg3: What Luca said.



    OS9 never had to deal with a hardlink in its life, so it would just ignore it. The Finder in OS X manages to deal pretty gracefully with all sorts of things that the ol' Finder ne'er *dreamed* of.



    The assumption was: If, in X, there are two directories with the same name in the same location, something is fubared either with the disk layout catalogs (which was the case), or with the semantics of the layout (as with a hardlink). The X Finder will attempt to make nice-nice with the situation, while the old Finder would at best ignore it, if not outright spew bits all over your screen.



    In such a case, using the OS 9 Finder to try and fix something that it was never designed to handle is akin to using a Junior Woodchuck pocket knife to repair an F-15 engine... while it's running. Not Advised(tm).



    (I do hope that in cases where you boot into 9 to delete offending stuff, you *do* at least attempt to run a disk repair from within X *first*... right?)
Sign In or Register to comment.