I recently bought a NAS device called “LANDISK” on ebay (search for SAMBA-FTP-USB-2-0-LAN on google).

This device includes a samba server which enables sharing of files on the network. The shared files can be accessed very simple via \\netdisk\\yourshare\. This works under Windows and under Linux in konqueror with smb://netdisk/yourshare.

It would however be nicer to have it mounted into the linux filesystem. Unfortunately at this step Linux fails miserably and leave many users totally frustrated! The problem is that the CIFS filesystem (smbfs was removed from the kernel) does not load the share.

The mount entry in fstab could look like this

//netdisk/myshare /home/myshare cifs rw,guest

This would result in the error message (if mounted manually with mount):

# mount /home/myshare
 Password:
 mount error 20 = Not a directory
 Refer to the mount.cifs( manual page (e.g.man mount.cifs)

If one searches for this error messages in the web it seems that most people expect that the user is doing something wrong and in most cases do not find the solution. The problem is, that the error message is NOT leading to the solution and not describing the problem.

The real reason is, that the samba share uses an old version of the SMB protocol which the CIFS implementation of Linux does not support (in its default configuration). The next problem is, that this can not even be configured directly.

The thing that needs to be modified is the setting for the CIFS Linux Extentions saved in /proc/fs/cifs/LinuxExtensionsEnabled.

The solution is then to add the following lines to /etc/init.d/boot.local

/sbin/modprobe cifs
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled