I'd like to set another user's home folder to use a certain volume on my disk. To that end, I'd like to be able to mount said volume at a specific location, say, at Users/foobar

I can do this using the command line by running sudo mount -t hfs /dev/disk0s4 /Users/, however this is only a temporary solution. If I unmount and remount the disk, it will mount to its usual location in Volumes/

Is there some way to permanently specify the mount point of a disk?

  • Set an entry in: /etc/fstab – user3439894 Jul 17 '17 at 15:40
  • @user3439894 I already tried, as per the instructions here. However when I use the File System UUID which DiskUtility gives, an error occurs when opening the disk with sudo mount -a, namely GetMasterBlock: Error 2 opening UUID=5E75BA88-7C74-34A9-8CE6-266C752CE2CA GetMasterBlock: Error 2 opening UUID=5E75BA88-7C74-34A9-8CE6-266C752CE2CA mount_hfs: error on mount(): error = -1. mount_hfs: No such file or directory – bingbomboom Jul 17 '17 at 15:56
  • Never mind, it turns out that mount -a just doesn't function as expected, and that setting the entry in /etc/fstab works fine if you mount the disk using DiskUtility – bingbomboom Jul 17 '17 at 15:59

Set an entry in /etc/fstab as directed here. To summarize.

  1. Open Disk Utility, unmount the relevant volume.

  2. Click on the volume you're trying to mount, and click the "info" button. Note down the drive's File System UUID, which should look something like 5E85BA88-7C74-34A9-8CE6-267C752CE2BA. I'm just gonna use 123abc as shorthand for it.

  3. Open up /etc/fstab using your text editor of choice (run it as root!) Edit: as per klanomath's comment below, run sudo vifs to safely edit etc/fstab, and add the following line.

    UUID=123abc /desired/mount/path hfs rw 0 2

  4. Mount the volume, the mount point should show the path you specified.

Some notes:

  • I have absolutely no clue what the "1 2" does at the end of that line. It was there in the link, so I kept it. Thanks to fd0 for helping me out here!

  • The page I linked instructs you to reload /etc/fstab using some niload command. I couldn't figure out how to install whatever package that required, but the good news is that I think DiskUtility will automatically reload the file, so don't worry about that.

  • Some sources will tell you to reload etc/fstab using the command mount -a. It seems like this should be a perfectly sensible way to do so, but it does not work. Don't worry if it tells you it can't mount a volume.

  • 3
    I suggest that you read the man 5 fstab manual. The fifth field in the fstab entry is the instruction on whether you allow the filesystem to be dumped (crippled in macOS, 0 would be a better choice). The sixth field is used to determine the order in which fsck is run. – fd0 Jul 17 '17 at 16:29
  • 6
    Editing of fstab is preferably done with sudo vifs! – klanomath Jul 17 '17 at 16:35
  • Thank you very much for the advice, I'll edit my answer to include it tomorrow – bingbomboom Jul 17 '17 at 21:28
  • Had no joy with this but what did work for me was to write an Applescript where I pass the path using the hdiutil command. I then save as an Application and run on startup from my User setting in System Preferences. Syntax is: hdiutil mount -mountpoint /path/to/mountpoint <named.dmg> – Tony Barganski Oct 4 '18 at 13:13
  • Thanks! I was so worried about this, in my case my hard drive is APFS so I edited vifs with UUID=123abc /desired/mount/path apfs rw 1 2 and it worked, I have no idea what I am doing but it worked. The main reason I did this was to have that folder be case sensitive for runing docker with volumes... problem solved. – santiago arizti Jul 26 '19 at 21:34

In Disk Utility right tap on the APFS volume and click "Rename"

enter image description here

Now opening (mounting) the volume via Finder will mount it to /Volumes/home or whatever new name you give it.

You must log in to answer this question.

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