12

In the past when we wanted to offload the /Users folder from the internal disk we simply created a symbolic link for /Users that pointed to /Volumes/External_Drive_Name/Users. The Mac in question is a server for two computer labs, hosting 60 Macs with a few terabytes of data spread out across 200~ user accounts. Hosting the Users folder on the internal drive is simply not a good option for us.

Symbolic links are no longer supported (for the root directory folders) in Catalina / 10.15, so this no longer works using the tried and true method. During the upgrade the symbolic link was simply removed and replaced with the standard Users folder.

I've read up on firm links by way of creating a synthetic.conf file via man synthetic.conf, but this method isn't working for the Users folder. I AM able to build a synthetic.conf file that creates a link for foo in the root directory that points to another volume, but attempting to redirect Users in the same manner breaks nearly all functionality.

I'm using the following syntax and placing synthetic.conf in /etc/synthetic.conf:

Users (tab character) /Volumes/External_Drive_Name/Users

With that I'm able to fully boot (albeit slowly) and log in but Finder and Spotlight repeatedly crash, signaling to me that the system is unable to find/create a user folder for the current logged in user.

Has anyone found a way to do this yet?

Anyone know of any other tricks for redirecting MacOS to look for the Users folder on a different volume?

8

You have missed out on a hidden and not easily discoverable preference for moving your /Users/[USERNAME] folder to another location that has been built into macOS for (at least) a few years.

  1. Open System Preferences
  2. Go to Users & Groups
  3. Click the padlock and authenticate
  4. Right (or control) click on your username and select "Advanced Options.."
  5. Click on the "Choose..." button and point it to where you want your home folder to be.

Once that is done all you need to do is copy your stuff from the old location to the new location and never deal with symlinks ever again.

3
  • 3
    I'm familiar with this method but it's only feasible on a system with a few users. This server creates a few dozen new users every 6 months or so. I feel like there has to be a way to modify the default location for new users, just as you can do via the method you described for existing user accounts. – Mr Rabbit Nov 7 '19 at 19:51
  • 1
    Sounds like you need network accounts? support.apple.com/en-gb/guide/directory-utility/diruc37c9dad/… – benwiggy Nov 8 '19 at 12:04
  • @benwiggy reading between the lines I think the Mac in question is the host for network accounts. – Robin Dec 4 '19 at 16:25
6

You can also use dscl to move current users user folder by specifying the NFSHomeDirectory entry.

As explained in this Apple support doc Hide a user account in macOS you could use this command to move the home directory of "yourUser" :

sudo mv /Users/yourUser /new/path/yourUser

If the new location is on a separate volume and you want to copy the existing user data it will be necessary to use cp to copy the existing home folder rather than mv to move it.

sudo cp -pR /Users/yourUser /Volumes/new/path

It is necessary to grant full disk access to terminal.app before doing so to avoid "Operation not permitted" errors.

If the current user folder contains no required data then this step is not required as a new folder hierarchy will be automatically created at the new location when the user next logs on after updating NFSHomeDirectory.

Next use this command to update the user record of "yourUser" with the new home directory path :

sudo dscl . create /Users/yourUser NFSHomeDirectory /new/path/yourUser

For new users you could create the user via terminal as described in this question How can I create a new user through terminal macOS 10.14 and specify the NFSHomeDirectory entry you want at creation time.

3
  • 1
    I like the idea of modifying the values in Directory Services directly. Might be worth mentioning though that mv won't work if the new home is on a separate volume. – nohillside Nov 8 '19 at 9:03
  • 1
    @nohillside - good point about mvnot working for separate volumes. Will update answer. – lx07 Nov 8 '19 at 9:45
  • This is definitely scriptable to roll through our existing users and their attributes but I'd much prefer a method that simply redirects on the fly or changes the standard default location of Users folder. – Mr Rabbit Nov 8 '19 at 17:21
2

When working with mobile accounts on macOS Catalina, you can use the createmobileaccount tool to specify a different home folder location for accounts created using this tool.

For example: If you have an AD account named jsmith and you want the jsmith account to have its home folder stored in a directory called Users on a local drive named Homes, you could run the following command to create the jsmith mobile account with the jsmith account's home folder stored at /Volumes/Homes/Users/jsmith:

sudo /System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount -n jsmith -h /Volumes/Homes/Users

For more information, please see the createmobileaccount help. This is accessible by running the following command:

/System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount

*** error: no arguments

usage: createmobileaccount -n username [-h homepath] [-P | [-p password]] [[[-a username] [-U password]] | [-D]] [-v] [-V]
-n username : user record name.
-h homepath : user home path; Default is "/Users/<username>".
-p password : user password.
-P : prompt for user password.
-a username : opt SecureToken enabled admin user name.
-U password : opt SecureToken enabled admin user password.
-D : don't prompt for SecureToken enabled admin information.
-v : verbose output.
-V : version.

Examples:
    createmobileaccount -n jsmith
    createmobileaccount -v -P -n jsmith
    createmobileaccount -vxn jsmith -h /Volumes/HD3/jhome

Notes:
    - createmobileaccount must run as root.
    - If you do not specify a password, the account's cached password will be created during the account's first log in.
    - On encyrpted APFS volumes, an existing admin SecureToken user name and password is required in order for this account to be used at the EFI login window.
    - External accounts are no longer supported as of 10.15.
    - The old FileVault encrypted home directory mechanism (using -e) no longer works in 10.13 or later (but was only removed here in 10.15).

username@computername ~ %
1
  • The OP isn't creating a new user, but is updating the Home Directory for existing users. Therefore, this answer is irrelevant. – Todd Oct 25 '20 at 22:26
0

I found that it indeed is still possible to make symbolic links in the root directory, but I had to boot the Mac from USB recovery media and open up the terminal once inside there to create the symbolic link, specifically the Mojave recovery terminal. I tried it with the Catalina recovery, and kept getting "Operation not permitted" errors. Seems like when they released Catalina, Apple might have baked in some hard-coded rules in the kernel against deleting the builtin Users folder.

You need to obtain the "Install macOS Mojave.app" from the App Store if you don't already have it, and run the "createinstallmedia" utility inside it with the necessary parameters to create a Mojave recovery USB stick...

Anyways, you can try booting from the Mojave recovery media, opening Terminal, and typing "ln -s -F /Volumes/giant_disk/Users /Volumes/Macintosh\ HD/Users". It worked for me, and also gets around the new readonly root filesystem situation when booted normally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .