Search the web with Google

Android install

Android installation weblog

Enter your email address:

Jeroen´s weblog

Ubuntu install

Ubuntu installation weblog

Saturday, November 1, 2008

SAMBA file share in fstab

A convenient manual for FSTAB is found here. In Dutch is is here.

In my /etc/fstab I entered this line (in one line):

// /media/netwerkdrive cifs nounix,uid=1000,iocharset=utf8,codepage=850 0 0

(Read more about fstab here)

Where is the static IP adress the drive had in my network

/public is the map on the drive that is given public

/media/netwerkdrive is the created directory in my media map where I want to mount the networkdrive.

cifs is the modern version of samba

nounix is essential. Else I got "error 20 no such directory".

uid=1000 prevents getting errors with permissions

the rest is for proper chars in filenames.

Then in a console I entered:

sudo apt-get install smbfs

To install the filesystem and then I entered:

sudo md /media/netwerkdrive/
sudo mount -a

To create a mountpoint and mount all new networked drives. If you use network manager, and are getting really slow shutdowns. It's probably because the network manager shuts down before unmounting the network shares. That will cause CIFS to hang, and wait for 60 seconds or so. Here's what you do to fix it (again in the console):

sudo ln -s /etc/init.d/ /etc/rc0.d/
sudo ln -s /etc/init.d/ /etc/rc6.d/

If you want to use FTP instead read this


More backround info is found here:


/etc/fstab file contains static information about the filesystems.

The file fstab contains descriptive information about the various file systems. fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file.

To mount a Samba share to be mounted when a Linux system comes up after reboot edit the


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 following entry in /etc/fstab file:

//ntserver/docs /mnt/samba smbfs username=docsadm,password=12345abcde 0 0


* //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=12345abcde: Share username and password

Open file /etc/fstab using a text editor:

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=12345abcde 0 0

Replace sharename, username and password with your actual parameters.

Read more here and here

And on the ubuntu site read this and this and finally this forum

And the resolved issue here

No comments:

Post a Comment