Samba filesystem

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:40, 23 March 2008 (edit)
Soulstace (Talk | contribs)
(Mount Manually - v24 uses cifs.o and mount.cifs)
← Previous diff
Revision as of 22:21, 23 March 2008 (edit) (undo)
Soulstace (Talk | contribs)
(integrating CIFS into this tutorial (for v24))
Next diff →
Line 1: Line 1:
-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.+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, Samba and/or Common Internet File System (CIFS) provide convenient solutions to customize this storage! They add a vast amount of writable storage to your router and even offer an automatic startup script.
-''Standard and larger versions of DD-WRT contain the Samba Client. Mini and Micro versions of DD-WRT do not contain Samba. See the Wiki page [[What_is_%22DD-WRT%22%3F#File_Versions]].''+''Standard and larger versions of DD-WRT contain the Samba/CIFS client. Mini and Micro versions of DD-WRT do not contain Samba/CIFS. See the Wiki page [[What_is_%22DD-WRT%22%3F#File_Versions]].''
== Instructions == == Instructions ==
Line 9: Line 9:
#* On MacOS X, go to "Sharing" in the System Preferences and turn on "Windows Sharing" for [http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1161.html 10.4] or in [http://docs.info.apple.com/article.html?path=Mac/10.5/en/8201.html 10.5] “Share files and folders using SMB.” from the File Sharing options. #* On MacOS X, go to "Sharing" in the System Preferences and turn on "Windows Sharing" for [http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1161.html 10.4] or in [http://docs.info.apple.com/article.html?path=Mac/10.5/en/8201.html 10.5] “Share files and folders using SMB.” from the File Sharing options.
# Use the [[Web Interface]] and go to the '''Administration''' tab. # Use the [[Web Interface]] and go to the '''Administration''' tab.
-# Enable the '''Samba FS Automount''' option. If new options do not appear the "Save Changes" and go back to the page.+# Enable the '''Samba FS Automount''' option (or '''CIFS Automount'''). If new options do not appear the "Save Changes" and go back to the page.
# Enter the share location in the 'share' field. eg: ''//192.168.1.160/myshare'' # Enter the share location in the 'share' field. eg: ''//192.168.1.160/myshare''
# In 'user' and 'password' enter the user credentials of a user allowed to access the share. # In 'user' and 'password' enter the user credentials of a user allowed to access the share.
Line 20: Line 20:
insmod /lib/modules/`uname -r`/smbfs.o insmod /lib/modules/`uname -r`/smbfs.o
- ''(*note: for v24, insmod '''cifs.o''')''+ ''(*note: for CIFS, insmod '''cifs.o''')''
Then enter these commands: Then enter these commands:
Line 26: Line 26:
mkdir /tmp/Path/ mkdir /tmp/Path/
smbmount //<IP Address of your windows or other samba server>/Share /tmp/Path/ -o username=<user>,password=<password_user> smbmount //<IP Address of your windows or other samba server>/Share /tmp/Path/ -o username=<user>,password=<password_user>
- ''(*note: for v24, use '''mount.cifs''' instead of smbmount)''+ ''(*note: for CIFS, use '''mount.cifs''' instead of smbmount)''
* ''/tmp/Path/'' is the path you want mounted * ''/tmp/Path/'' is the path you want mounted

Revision as of 22:21, 23 March 2008

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, Samba and/or Common Internet File System (CIFS) provide convenient solutions to customize this storage! They add a vast amount of writable storage to your router and even offer an automatic startup script.

Standard and larger versions of DD-WRT contain the Samba/CIFS client. Mini and Micro versions of DD-WRT do not contain Samba/CIFS. See the Wiki page What_is_"DD-WRT"?#File_Versions.

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.
    • On MacOS X, go to "Sharing" in the System Preferences and turn on "Windows Sharing" for 10.4 or in 10.5 “Share files and folders using SMB.” from the File Sharing options.
  2. Use the Web Interface and go to the Administration tab.
  3. Enable the Samba FS Automount option (or CIFS Automount). 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 can manually mount a share. First, enable Samba through the web interface, or in an SSH/Telnet session:

insmod /lib/modules/`uname -r`/smbfs.o
(*note: for CIFS, insmod cifs.o)

Then enter these commands:

mkdir /tmp/Path/
smbmount //<IP Address of your windows or other samba server>/Share /tmp/Path/ -o username=<user>,password=<password_user>
(*note: for CIFS, use mount.cifs instead of smbmount)
  • /tmp/Path/ is the path you want mounted
  • Only /tmp/, /dev/ and potentially /jffs/ are writeable!

Receiving errors like the following seem 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/
 rmmod smbfs

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:

/opt/bin/ipkg install samba2

after some package installing the samba server is ready.

A nice Howto for this is located here Optware

You should really try it the optware way because it works :)