I have 2 SMB servers that I connect to on a daily basis. One is my development server and the other is my production server. Both of them are a little different in the folder structure.
When they are mounted, they take the names of the folder you are mounting. Both servers are mounted on the same folder name so its really hard to tell the difference.
Is it possible to change the name of a mounted SMB server? I would like to just have "Development" and "Live".
Best Answer
The two shares will be mounted automatically.
Please create a Share folder and two folders
Development
andLive
inside of that in your User folder and change your auto_master withsudo nano /etc/auto_master
to/etc/auto_master
and create a file with
sudo touch /etc/auto_smb
and add withsudo nano /etc/auto_smb
the content/etc/auto_smb
for AD-members
Both files ("auto_master" & "auto_smb") need a trailing empty line
change the file root only readable:
sudo chown 600 /etc/auto_smb
enter
sudo automount -vc
in Terminal with the output:Please regard the output: /Users/username/Share/Development or Live updated
(I've tested this with Mac OS X 10.10.1 (as client) & Windows Server 2012 R (Active Directory) in a VirtualLab. It worked without any problems and survived any restart. The following workarounds weren't necessary for me.)
If the shares aren't mounted with correct access rights (e.g. root only) you may have to unmount it with
sudo umount /Users/.../shares
and remount it with `cd /User/.../shares.An automatic approach with launchd is the following solution:
Create a script:
(i don't know if line 1 in the script is correct)
and save it somewhere e.g.
/Users/user/bin/remount.sh
.To call the script as a LaunchDaemon, you have to create a plist in /Library/LaunchDaemons similar to this:
The string com.organization.remount is also the name you will have to give the file, with the extension plist: "com.organization.remount.plist".
The string /Users/user/bin/remount.sh is the path to where you saved your script.
2. Windows Server2008r2 command line-method (if you have admin rights and access to the servers)
really quick and dirty:
net share <sharename=drive:path>
Example:
net share Live=C:\Data (on the production server)
net share Development=C:\Data (on the development server)