Wednesday, 21 October 2009

How to Mount Samba Share at Boot / Startup Ubuntu 9.04 Jaunty

To mount a Samba share to be mounted when a Linux system comes up after reboot edit the /etc/fstab file and put entry as follows for your Windows/Samba share:
//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 the following entry in your /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
Note: This will work for all Linux systems, not just Ubuntu Jaunty. You may encounter an error like the following:

$sudo mount /shared
mount: wrong fs type, bad option, bad superblock on //beta/shared,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount. helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

In this case, smbfs might not be installed. For ubuntu, run:
sudo apt-get install smbfs
and then try mounting again.

Source: http://www.cyberciti.biz/faq/configure-a-system-to-automount-a-samba-share-with-etcfstab/

No comments: