Samba filesystem

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:37, 2 November 2006 (edit)
Alexanderott (Talk | contribs)
(Install Samba on DD-WRT)
← Previous diff
Revision as of 04:12, 3 November 2006 (edit) (undo)
Whiteboy (Talk | contribs)

Next diff →
Line 1: Line 1:
-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 file system provides a convenient solution! It adds a vast amount of writable storage to your router and even offers an automatic startup script.+One of the things you might miss on a DD-WRT enabled router is its ability to write to storage. If you run a Linux samba or Windows server on your LAN, the Samba file system provides a convenient solution to customize this storage! It adds a vast amount of writable storage to your router and even offers an automatic startup script.
= Instructions = = Instructions =
Line 14: Line 14:
== Mount Manually == == Mount Manually ==
- 
You may want to manually mount a share. To do this, simply enter this command in a [[Telnet/SSH and the Command Line|Telnet or SSH prompt]]: You may want to manually mount a share. To do this, simply enter this command in a [[Telnet/SSH and the Command Line|Telnet or SSH prompt]]:
Line 35: Line 34:
== Note for Windows Server 2003 == == Note for Windows Server 2003 ==
- 
Especially on Windows Server 2003, assert that your server accepts NTLM v1. Especially on Windows Server 2003, assert that your server accepts NTLM v1.
Line 70: Line 68:
Now the Samba server is ready, only the config file (/jffs/etc/samba/smb.conf)needs some adaptation. Now the Samba server is ready, only the config file (/jffs/etc/samba/smb.conf)needs some adaptation.
-[[Category:basic HOWTO]] 
[[Category:English documentation]] [[Category:English documentation]]
 +[[Category:basic HOWTO]]

Revision as of 04:12, 3 November 2006

One of the things you might miss on a DD-WRT enabled router is its ability to write to storage. If you run a Linux samba or Windows server on your LAN, the Samba file system provides a convenient solution to customize this storage! It adds a vast amount of writable storage to your router and even offers an automatic startup script.

Contents

Instructions

  1. Create a SMB network share on the host computer.
    • On Linux, use Samba to create a SMB network share. HOWTO
    • On Windows, this is the default file sharing system. Simply right click and select "Sharing and Security" to set up sharing.
  2. Use the Web Interface and go to the Administration tab.
  3. Enable the Samba FS Automount option. If new options do not appear the "Save Changes" and go back to the page.
  4. Enter the share location in the 'share' field. eg: //192.168.1.160/myshare
  5. In 'user' and 'password' enter the user credentials of a user allowed to access the share.
  6. You may optionally enter a Startscript. For example if you have a script on your share \\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.

Mount Manually

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 Server 2003

Especially on Windows Server 2003, assert that your server accepts NTLM v1.

  1. Goto Start > Run
  2. Type "gpedit.msc" and push enter.
  3. Goto Computer Configuration / Windows Settings / Security Settings / Local Policies / Security Options.
  4. Verify that "Network security: LAN Manager authentication level" is NOT "Send NTLMv2 response only\refuse LM & NTLM"

Install Samba Server on DD-WRT

If you have a powerfull Router like the Asus Asus WL-500gP(remium) you might want to use the USB 2.0 Ports for HD sharing with Windows Clients. At first install the USB stuff according to http://www.dd-wrt.com/wiki/index.php/USB#Installation


To install Samba just type:

ipkg install samba

after some package installing the samba server is ready.

Unfortunately /jffs/etc/init.d/samba start fails with

nmbd: can't resolve symbol 'fopen64'

smbd: can't resolve symbol 'stat64'

this can be solved with the uclibc_0.9.28-6_mipsel.ipk Package from http://www.dd-wrt.com/dd-wrtv2/downloads.php (under packages), this has to be done manualy.

After installing do a

export LD_PRELOAD=/jffs/lib/libuClibc-0.9.28.so


Now the Samba server is ready, only the config file (/jffs/etc/samba/smb.conf)needs some adaptation.