How do I configure a Linux based system to automount a Samba share on a Linux?
As explained earlier you can use the mount command to mount a remote windows partition or a windows share under Linux.
//ntserver/share /mnt/samba smbfs username=username,password=password 0 0
For example, if you want to mount a share called //ntserver/docs then you need to write following entry in /etc/fstab file:
//ntserver/docs /mnt/samba smbfs username=docsadm,password=D1Y4x9sw 0 0
Where,
- //ntserver/docs: Windows 2003/NT/Samba share name
- /mnt/samba: Local mount point (you may need to create this directory first)
- smbfs: File system type (samba file system)
- username=docsadm,password=D1Y4x9sw: Share username and password
Open file /etc/fstab using vi text editor:
# vi /etc/fstab
Append line
//ntserver/docs /mnt/samba smbfs username=docsadm,password=D1Y4x9sw 0 0, at the end your file should read as follows:
proc /proc proc defaults 0 0 /dev/hdb1 / ext3 defaults,errors=remount-ro 0 1 /dev/hdb2 none swap sw 0 0 /dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0 //ntserver/docs /mnt/samba smbfs username=docsadm,password=D1Y4x9sw 0 0
Replace sharename, username and password with your actual parameters.