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

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

  1. ghoffman

    ghoffman LI Guru 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

    Last edited: Apr 17, 2014
  2. leandroong

    leandroong LI Guru 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 /mnt/downloads
  3. mvsgeek

    mvsgeek LI Guru 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.

    #     Script to get a module from a cifs-mounted Win directory
    #     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 LI Guru 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.
  5. leandroong

    leandroong LI Guru 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
    enable <=== check
    UNC \\\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
    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
    Hope this is what you are trying to do....
  6. ghoffman

    ghoffman LI Guru 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 LI Guru 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 /mnt/downloads
    sleep 1

    mkdir /mnt/cifs
    mount -t cifs // /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 // /mnt/cifs -o username=lean,password=wfeiong

    Attached Files:

    Last edited: Apr 18, 2014
  8. ghoffman

    ghoffman LI Guru 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 LI Guru Member

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

    leandroong LI Guru 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 LI Guru Member

    i have /cifs1 and /cifs2
    but 'modprobe cifs' gives the response:
    modprobe: module cifs not found in modules.dep
    and 'mount -t cifs // /cifs1 -o user=user,pass=pass' give the response:
    mount: mounting // 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 LI Guru Member

    1. result test on my router
    Tomato v1.28.0000 MIPSR1-117 K26 USB AIO
    root@BTRouter2:/tmp/home/root# modprobe cifs
    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 account, free membership, 100MB available. So we will use this site as fetching location for test.
    while [ $A -gt 0 ] ; do
    if [ -f /var/notice/sysup ] ; then sleep 2; break; fi
    sleep 1
    sleep 5
    cd /tmp
    insmod /tmp/cifs.ko
    mkdir /mnt/cifs
    mount -t cifs // /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 You need to find http or ftp url site to upload that.
    Last edited: Apr 19, 2014
  13. ghoffman

    ghoffman LI Guru Member

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

    leandroong LI Guru Member

    try to locate your cifs.ko
    root@BTRouter2:/tmp/home/root# find / -name cifs.ko
  15. ghoffman

    ghoffman LI Guru 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 LI Guru 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.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice