1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mount cifs on shibby, 4mb rom, e1000( k26rt) or wrt150 (k24nd)

Discussion in 'Tomato Firmware' started by ghoffman, Apr 17, 2014.

  1. ghoffman

    ghoffman Addicted to LI Member

    recent builds have cifs omitted as a save location for bandwith data.
    i thought about using a script to mount, and setting a cutom path in bandwidth config.
    i've tried the command
    mount -t cifs -o user=user,pass=pass /192.168.1.x/share /cifs1
    from telnet, and this does not mount the share

    suggestions?
     
    Last edited: Apr 17, 2014
  2. leandroong

    leandroong Addicted to LI Member

    this is for mounting to NFS_server:

    mkdir /mnt/downloads
    mount -t nfs -o nolock,intr,hard,timeo=14,sync,rsize=32768,wsize=32768 10.0.1.1:/media/optware/NFS_storage /mnt/downloads
     
  3. mvsgeek

    mvsgeek Addicted to LI Member

    This works for mounting a Windows share on WRT54GL, RT-N12 and RT-N16 running various Toastman releases (see my sig for details). The number of backslashes is critical.

    Code:
    #!/bin/sh
    #     Script to get a module from a cifs-mounted Win directory
    FNAME=$1
    SRCIP=$2
    USER=$3
    PASS=$4
    #
    #     Mount source directory as cifs on router     
    # 
    insmod cifs
    mount -t cifs PUTTY /cifs1 -o unc=\\\\$SRCIP\\putty,user=$USER,pass=$PASS
    #
    #     Copy the source file to target     
    #
    cp /cifs1/usr/$FNAME /jffs/bin
    #
    #     Unmount cifs directory     
    #
    umount /cifs1
    #
    exit 0
    
     
  4. ghoffman

    ghoffman Addicted to LI Member

    @mvsgeek: i've tried all variations on UNC including your syntax, and no-go.
    with insmod cifs, i get error cannot load cifs.ko

    i htink it's jsut not in the build for space reasons any more.
    thanks
     
  5. leandroong

    leandroong Addicted to LI Member

    I tried creating cifs client, sharing my notebook external folder and it works. This are my procedures:
    1. select folder to share. In my case, I selected d:\DNS-report. Right click folder, select properties, click tab sharing menu, click advanced sharing, click "Share this folder", then click Permissions, click all checkboxes. Click ok, ok, ok, close
    2. on tomato router, Administration->CIFS Client, do this
    /cifs1
    enable <=== check
    UNC \\10.0.1.2\DNS-report
    username <=== <use your windows username>
    Password <=== <use you windows password>
    click save, you will see Total/Free Size value
    3. To access, telnet, ls /cifs1
    Code:
    Tomato v1.28.0000 MIPSR1-117 K26 USB AIO
    root@BTRouter2:/tmp/home/root# ls /cifs1
    namebench-1.3.1-Windows.exe     namebench_2014-04-02_1427.html
    namebench_2014-04-01_0501.html  namebench_2014-04-04_1614.html
    namebench_2014-04-01_0527.html
    root@BTRouter2:/tmp/home/root#
    
    Hope this is what you are trying to do....
     
  6. ghoffman

    ghoffman Addicted to LI Member

    i am embarrassed to admit that i thought somehow that cifs kernel support would exist using a build without cifs support in the GUI
     
  7. leandroong

    leandroong Addicted to LI Member

    Yes, it can be done. I just tested it. Procedures as follow:
    1. init script
    ....
    modprobe bcm_nat
    mkdir /mnt/downloads
    mount -t nfs -o nolock,intr,hard,timeo=14,sync,rsize=32768,wsize=32768 10.0.1.1:/media/optware/NFS_storage /mnt/downloads
    sleep 1

    mkdir /mnt/cifs
    mount -t cifs //10.0.1.2/DNS-report /mnt/cifs -o username=lean,password=wfeiong

    service smbd restart

    Note: I have both nfs-client and cifs-client activated

    2. Proof:

    Hope this works on your router too !!!

    Edit2: This also probably states that unlimited cifs connections possible

    Edit3: If your router FW do not have kernel cifs, download shibby extra, and run "insmod /<path>/cifs.ko . Should be put in init script also as follow:

    ...
    insmod /opt/extra/cifs.ko
    mkdir /mnt/cifs
    mount -t cifs //10.0.1.2/DNS-report /mnt/cifs -o username=lean,password=wfeiong
     

    Attached Files:

    Last edited: Apr 18, 2014
  8. ghoffman

    ghoffman Addicted to LI Member

    i'll work on this approach.
    no usb on my router, so i'll hae to find a way to get the shibby extra available to load cifs.ko
     
  9. leandroong

    leandroong Addicted to LI Member

    you can also do that in init-script. download cifs.ko every reboot and save to /tmp/home/root.
     
  10. leandroong

    leandroong Addicted to LI Member

    before doing that, try to confirm if you dont have cifs1 and cifs2 folder on / by using winscp or telnet.
    If you see that folder, then you dont need to install kernel cifs.ko
     
  11. ghoffman

    ghoffman Addicted to LI Member

    @leandroog:
    i have /cifs1 and /cifs2
    but 'modprobe cifs' gives the response:
    modprobe: module cifs not found in modules.dep
    and 'mount -t cifs //192.168.1.54/data1 /cifs1 -o user=user,pass=pass' give the response:
    mount: mounting //192.168.1.254/data1 on /cifs1 failed: No such device

    therefore the cifs module is not present

    so how do i download the cifs.ko each time?
     
  12. leandroong

    leandroong Addicted to LI Member

    1. result test on my router
    Code:
    Tomato v1.28.0000 MIPSR1-117 K26 USB AIO
    root@BTRouter2:/tmp/home/root# modprobe cifs
    root@BTRouter2:/tmp/home/root#
    
    no response

    2. just upload cifs.ko to dropbox and get the download url. Your script-init will look like this:
    Note: I uploaded cifs.ko on my shared.com account, free membership, 100MB available. So we will use this site as fetching location for test.
    Code:
    A=1
    while [ $A -gt 0 ] ; do
    if [ -f /var/notice/sysup ] ; then sleep 2; break; fi
    sleep 1
    done
    
    sleep 5
    cd /tmp
    wget https://shared.com/efl2ekn29s?s=l
    insmod /tmp/cifs.ko
    mkdir /mnt/cifs
    mount -t cifs //10.0.1.2/DNS-report /mnt/cifs -o username=lean,password=wxxx
    
    I think, you may use modprobe in place of insmod also.

    edit2: I got error fetching the file, wget https://shared.com/efl2ekn29s?s=l. You need to find http or ftp url site to upload that.
     
    Last edited: Apr 19, 2014
  13. ghoffman

    ghoffman Addicted to LI Member

    @leandroog: the minimallist wget does not support https either.
    i'll need to set up something on my lan.
     
  14. leandroong

    leandroong Addicted to LI Member

    try to locate your cifs.ko
    Code:
    root@BTRouter2:/tmp/home/root# find / -name cifs.ko
    /lib/modules/2.6.22.19/kernel/fs/cifs.ko
    root@BTRouter2:/tmp/home/root#
     
  15. ghoffman

    ghoffman Addicted to LI Member

    i used the cifs.ko from the extras-mps2 from shibby's directory that i downloaded the firmware from (v117, k26), loaded it to an open fileserver, and successfully retrieved it with wget.
    but it won't load.
    i get error:
    insmod: can't insert 'cifs.ko': invalid module format
    i am assuming this is a build error. (the file you pointed me to did not work either)
     
  16. leandroong

    leandroong Addicted to LI Member

    This is similar to input.ko kernel issue. AIO build won't allow it to be inserted. The trick is to find FW that accept cifs.ko. You need to try other FW that will accept it. In my case, BT-GUI vpn FW.
     

Share This Page