I set a Mac to be backed up by our TSM server. There was an external AFP share mounted at /Volumes/Data. I wanted to back up that share, too. The problem was that, for some reason, the share got unmounted from time to time. My first attempt at solving the problem was to write a shell script to mount the AFP share. Then, I scheduled it to run before the backup job. This was not helpful either, because the share still frequently got unmounted.
I then tried many different approaches and found that this one worked pretty well. The idea is to edit the /etc/fstab file to specify the mount information so the automount service can mount the share whenever it is being accessed. Here are the steps:
- Open Terminal application.
- Type sudo nano /etc/fstabÂ to edit the file.
- Add this line.
host_name:/share_name /Volumes/mount_name url automounted,url==afp://user_name:password@host_name/share_name 0 0
- Press Ctrl + x to save the file and exit out.
- Type automount -vcÂ to restart automount.
If you want to mount a cifs share, just change afp to cifs. This is one example using cifs.
host_name:/share_name /Volumes/mount_name url automounted,url==cifs://user_name:password@host_name/share_name 0 0
This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.