Samba filesystem

From DD-WRT Wiki

Revision as of 20:07, 31 August 2006 by MarcAntoineRuel (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

One of the things you might miss on the router, is writable storage. Well, if you run a Linux samba or Windows server on your LAN, the Samba filesystem provides a convenient solution! It adds a vast amount of writable storage to your router and even offers an automatic startup script.

Instructions

First create a network share on the Linux or Windows server.

Linux users will utilize samba for this. Linux users now need to set up permissions for the share, see the howto for more.

Windows users will use the native file sharing functionality. Windows users can also set the permissions as they see fit. This includes verifying that the share permission is set to read/write AND that the NTFS permission is at least read/write.

Next, configure samba on the router. You can configure Samba via the Web Interface, to do so navigate to Administration, find the Samba FS Automount option and enable it.

  • Enter the share location in the 'share' field, eg: //192.168.1.160/myshare .
  • In 'user' and 'password' enter the logon credentials of a user allowed to access the share.
  • Optionally you may enter a Startscript. For example if you have a script on your sambashare \\lanserver\myshare\startup.sh you enter startup.sh in the 'Startscript' box. This script (/tmp/smbshare/startup.sh on the router) will be executed when the router mounts your share on boot.

You can see sample of startup script on Jffs page.

Advanced

You may want to manually mount a share. To do this, simply enter this command in a Telnet or SSH prompt :

  • /tmp/Path/ is the path you want it mounted
  • Don't forget that only /tmp/, /dev/ and potentially /jffs/ are writeable!
mkdir /tmp/Path/
smbmount //<IP.SE.RV.ER>/Share /tmp/Path/ -o username=<user>,password=<password_user>

Receiving errors like this seems normal:

load_client_codepage: filename /usr/lib/codepages/codepage.850 does not exist.
load_unicode_map: filename /usr/lib/codepages/unicode_map.850 does not exist.
session request to 192.168.1.99 failed
Can't get /etc/mtab~ lock filesmbmnt failed: 1

To unmount a share, enter this command in a shell prompt:

umount /tmp/Path/
rmdir /tmp/Path/

Note for Windows users

Especially on Windows Server 2003, assert that your server accepts NTLM v1. To verify, Do Start Menu / Run / Type "gpedit.msc" Then go in Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options. Verify that "Network security: LAN Manager authentication level" is NOT "Send NTLMv2 response only\refuse LM & NTLM"