FreeBSD: Automounting Samba Shares
From The Wiki Guide
Contents |
Introduction
This guide will allow you to automatically mount your windows shares on your FreeBSD Machine on startup
Editing fstab
- "nano /etc/fstab"
- In a new line type "//User@Servername/Share /UnixMountPoint smbfs rw,noauto 0 0"
- Add one line for each of your shares.....
Editing nsmb.conf
- "nano /etc/nsmb.conf"
- All the way towards the end is a nice place to insert the following:
- [SERVERNAME:USER]
- password=YourWindowsSharePassword
- Then "chmod 600 /etc/nsmb.conf"(Wanna protect your cleartext password)
- All the way towards the end is a nice place to insert the following:
Creating Automount Script
- Lets create a script for mounting the share on boot
- "nano /usr/local/etc/rc.d/yourscript.sh"
- Inside the script simply type "mount /UnixMountPoint"
- Save the script, "chmod 700 yourscript.sh"
Final Considerations
- You must make a script for each mount, i.e. only one mount or unmount per script!
- Also as you noted above /usr/local/etc/rc.d/ (is the place to put all your "nifty" startup scripts)
- Just boot up and you should be good youll see in bold white "netsmb_dev: loaded"
