Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Recovering from a moved /Users folder System
Moving /Users to a new partition makes a lot of sense, but it can go badly wrong if the disk becomes even temporarily unavailable. This happened to me recently, making it impossible to log in again – here's my best guess as to what happened, and how I fixed it. A better explanation from those with more experience of NetInfo and disk mount tables would be very gratefully received. This assumes you have simlinked /Users to the new location, and renamed the original Users to oldUsers or something similar.

It appears that if OS X cannot locate your home directory where the NetInfo database says it should be, it will create the path under /Volumes. So, assuming an installation with two hard disks, in which the OS is on DiskA, the Users folder is on DiskB, the home directory path for user Foo should look like this:
/Volumes/DiskB/Users/Foo
But if something goes wrong during startup, and that path does not exist, then the path will be created in the Volumes directory. What happens next is not entirely clear to me –- but I think when DiskB then does become available, the attempt to mount it normally fails, as the path has been created in /Volumes, so DiskB is mounted at /Volumes/DiskB 1. You then appear to be logged into your normal account, but you are not. Your real home folder (with all its contents) will be mounted at /Volumes/DiskB 1. You can confim this by command clicking the icon of your home directory in the window's title bar. The path will be shown as :
Disk A
 .Volumes
   DiskB
    Users
     Foo
The best way to recover the situation is to login with a different installation (eg Mac OS 9, or the startup CD). Delete the symlink to the new Users folder, and rename /oldUsers to /Users. You're now back to a standard installation; startup as normal. For safety, rename DiskB to something else, say DiskC –- this will avoid you accidentally wiping your Users folder when you sudo rm in the next step.

Now cd into the /Volumes directory, check the contents of DiskB (it should contain only the new, near-empty /Users/Foo). Once you're sure it's not your real home folder (that should be safely on the renamed DiskC), then do sudo rm –R to send the impostor to bit heaven.

Rename DiskC back to DiskB, and symlink /Users to /Volumes/DiskB/Users, rename /Users to /oldUsers, and you're done. If any *nix wizards can shed more light on this, I'd be grateful.
    •    
  • Currently 1.67 / 5
  You rated: 3 / 5 (3 votes cast)
 
[9,749 views]  

Recovering from a moved /Users folder | 8 comments | Create New Account
Click here to return to the 'Recovering from a moved /Users folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Recovering from a moved /Users folder
Authored by: sacarol on May 03, '04 11:53:33AM

We use the two-partition scheme (one for system files, one for user data) for our student iBooks at our school. The number one way that the user folder link gets hosed is the students changing the name of the partitions. Just something to be aware of...



[ Reply to This | # ]
Recovering from a moved /Users folder
Authored by: cshuman on May 03, '04 12:13:46PM

Amazing! Someone else had almost the exact same problem I had last week. My 1 1/2 year old daughter changed Users partition form "Users" to "L". It freaked me out.

I symlink to /Volumes/Users/ so my new user directory was "chris", but my real was renamed to "chris 1". I just did a

mv /Volumes/Users/chris "chris 2" and then did a
mv /Volumes/Users/"chris 1" chris after logging in as root
and everything worked fine, but it took me awhile to realize
exactly what had happened.

Everything is working fine now.

Oh, bye the way I decided to revoke my Administrator status and am also keeping the computer at the login window via fast user switching. That should keep this from happening again.

Chris

---
Is there anybody out there? Just nod if you can hear me. Is there anyone home?



[ Reply to This | # ]
Recovering from a moved /Users folder
Authored by: baokhangnn on May 03, '04 01:09:47PM

I have avioded this problem by having two (2) Users/ folders. Create an admin account in the default place /Users. Then create all the users needed and move their home directories over to a second drive. Open up NetInfo Manager and change their home directory path to point to the new drive (/Volumes/***/***/etc...). If the drive name changes, then you must also change the path again. This way I always have an administrative account (zAdmin, the z is to make it last in the list of logins) just incase something goes wrong! As zAdmin you must also remember to setup ownership and permissions for the second drive like the orginal /Users path!

Actually, we have a machine were there is a harddrive for each of the five users. Each of their home directories is on thier own drive (mix of firewire and IDE). Plus one for the OS & Apps! Works great!

-Bao



[ Reply to This | # ]
Recovering from a moved /Users folder
Authored by: Pelix on May 04, '04 06:05:11AM

Hi
I've got exactly the same problem. Everytime I reboot the /Volumes path changes.
I use an external Firewire (Soft-)RAID for my user folders.
How can I avoid this bug?

Felix



[ Reply to This | # ]
Recovering from a moved /Users folder
Authored by: rhowell on May 03, '04 04:38:17PM

If you make Apple aliases through the Finder, instead of symlinks through the CL, won't the connection remain even if the Users folder moves or the partition gets renamed? I haven't tried this for partitions but it works with usual folders.



[ Reply to This | # ]
Recovering from a moved /Users folder
Authored by: cllcomputers on May 03, '04 08:22:59PM

If you know your UNIX skills, you should be able to boot into Single User Mode - CMD+S, and you can mount your disks and attempt to rename them. I don't have specific instructions for this, but anyone out there who can do it should try it, and they'll have to fiddle around with trying to get the disk names straight, delete the folder created in /Volumes that was named after your username, and rename your disk back to the way it was, and then reboot, everything should be okay. I haven't actually tested this.

-------------------------
www.cllcomputers.com
forums.cllcomputers.com



[ Reply to This | # ]
Disadvantage of UNIX
Authored by: derrickbass on May 03, '04 11:34:12PM

Alas, this is one of the disadvantages of having UNIX under the hood. While it has all sorts of cool features that Mac OS did not have, it is a very old OS and has a lot silly things. Like pathnames. Under UNIX, all of your files and folders are accessed by pathnames; since NetInfo (and /etc/passwd and other login information databases) are of the UNIX heritage, Mac OS X must refer to the location of the home directory as a path. If it were able to use aliases, then this problem would not occur. Aliases store lots of information about the folder they point to (unlike paths) and allow you to rename the folder or move it to a different directory. Morever, aliases know about the concept of volumes, so if the folder is on a volume that is not mounted, you can be prompted to insert it (or, if it is on a disk image, it gets mounted automatically).

Annoyingly, many Cocoa programs also use pathnames to refer to files, even though Cocoa allows access to the alias mechanism. For example, I recently moved some of my iTunes music. iTunes (a Carbon app that refers to files by aliases) had no problem finding the files but iPhoto (a Cocoa app that uses pathnames to locate files) was unable to find any of the music for my slideshows.

Java apps also use pathnames, which can lead to the same sort of situations the poster describes; if they try to store files on an external volume that is not mounted, they will end up creating folders in /Volumes.



[ Reply to This | # ]
Disadvantage of UNIX
Authored by: skellener on May 04, '04 12:04:23AM

Hmmm, but pathnames are also some of Mac OS X's strengths too. In many apps, there are simply pointers to things like image files, or XML files and you can very easily make changes and customize things as you like.

OS X...Best OS on the planet!



[ Reply to This | # ]