NAS mount via launch daemon -what else could be recreating mount? + Thunderbolt woes

Joined
Jul 27, 2015
Messages
10
Reaction score
0
Points
1
I've created a launch daemon (no KeepAlive, but RunAtLoad is true) that runs a script at boot time that essentially does this:

mkdir /Volumes/homes
/sbin/mount_nfs nnn.nnn.nnn.nnn:/homes /Volumes/homes

Background (why I've done this)
1) The users don't have to logon to the NAS separately. The script runs at boot time, so by the time they manage to logon, everything is mounted.
2) I've put the users' directories on the NAS and it's so transparent that they wouldn't even notice. The only thing they see is that no matter which of the two Macs they logon to, they have all their files as if they were local - great!
3) I don't have to have user ids on the NAS - all I had to ensure is that the Mac users have the same UIDs on both Macs and now all permissions work as if the files were local. I'm happy with the security implications of using NFS this way - it's a safe environment (home).

Issue 1 - Inexplicable extra mount points
Occasionally in addition to the expected /Volumes/homes, I can also see /Volumes/homes-1, and rarely even /Volumes/homes-2.
They don't cause problems (the users don't even notice) and they work and can be unmounted without issues (all my symlinks point to /Volumes/homes/...), but it annoys me that they're there and I can't figure out where they could come from! ...or any pattern as to why they appear.
Is there anything in Mac OS that might be remembering what was mounted and tries to mount it again?

Issue 2 - Mounting via Thunderbolt IP address is slow/flakey
I have a QNAP Thunderbolt NAS. If I use its Thunderbolt IP address for mounting, it takes 10-20 seconds longer than with the NAS's Ethernet IP address, to the point where it would often not finish until after the user has had enough time to log on. That's not good, because e.g. their desktop background might be a picture on the NAS, and then instead they get the default mountain background because Mac OS can't find the image file (yet)! Sometimes it doesn't want to mount at all via Thunderbolt. No such issues via the Ethernet IP address - either mounting via Thunderbolt is flakey or there are some dependencies during boot that don't work out...? I would like to use Thunderbolt because it's faster (the reason I got that specific QNAP NAS model).

As a side note, I haven't played around at all with automounting (/etc/fstab or /etc/auto_master), because I think that would only kick in when the user logs on, at which point it's too late (e.g. for loading the desktop background).

Any suggestions or comments appreciated, I'm still learning ;-)
 
OP
O
Joined
Jul 27, 2015
Messages
10
Reaction score
0
Points
1
An update to my own thread - just in case anyone is ever interested ;-)

Yes, it works fine. You can write a LaunchDaemon to mount the NAS, which runs at boot time, so the NAS is already mounted before the user has a chance to log in.
I use NFS which means I can use permissions the same way as if they were local. The only thing needed is to make sure the UIDs of the Mac users are the same on both Macs. No separate userids needed on the NAS and no logon to the NAS :)

Now the user can use either of our two Macs and can access the same files - all that's needed is symlinks from the home dir to respective dirs on the NAS.

Practical considerations:

1) The NAS is what I backup - now I don't have to care about backing up the individual Macs, as all they contain are the OS and the apps.

2) I could have symlinked every user's home directory and it would work fine, however, I decided to symlink the next level of sub-directories down (Documents, Downloads, Pictures, etc.) because I didn't want the Library sub-directory on the NAS, because it contains a ridiculous number of files.

However, you can still easily pick and choose what you want to have shared within the Library sub-directory:
For example, I symlinked each user's Library/Safari directory to the respective dir on the NAS - that way users always have their bookmarks no matter which Mac they use. I did the same with Library/Cookies. Works fine. If I ever encounter a program that stores a lot of stuff in Library that would be nice to share via the NAS so that you have the same stuff no matter which Mac you're on, then I can easily move it to the NAS and symlink it from both Macs.

3) Security implications of using NFS: This assumes your NAS is in a safe environment, because anyone could plug an ethernet cable into the NAS, go in with a user that happens to have a certain UID and access that user's files without any authentication. So, that setup is fine for at home, but obviously not for a business ;-)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top