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

how to mount cifs

Discussion in 'Tomato Firmware' started by GigaGuy, Jul 24, 2014.

  1. GigaGuy

    GigaGuy Network Newbie Member

    Current Version: 1.28.0000 MIPSR2-1.26.20 K26 USB Big-VPN

    I dont see a cifs mount option:
    mount mount.nfs mount.ntfs mount.ntfs-3g mountd

    I tried using just mount.

    mount -t cifs //192.168.0.3/GoFlex\ Home\ Public/router /mnt/nas -o username=me,password=
    and
    mount -t cifs nas /mnt/nas/ -o unc=\\\\192.168.0.3\\GoFlex\ Home\ Public,username=me,password=

    no matter at, I get error:
    mount: mounting nas on /mnt/nas/ failed: No such device

    I want to mount my nas to the router for logs, config backups, DLNA, BT, etc
     
  2. remlei

    remlei Networkin' Nut Member

    I assume your NAS has no password set to it on Samba/File Sharing. You have to fill the username and password as 'guest'.

    you can use it to store router logs, but you cant use it as a full fledged cifs on router due to slow response, torrents get frequent crc errors and IO waits causing CPU load way go high as 10.00, dlna may get drop out causing the audio/video played incorrectly.
     
  3. koitsu

    koitsu Network Guru Member

    There's lots wrong going on here. Command-line syntaxes matter, meaning the order of arguments plays a huge role in how the program behaves. You cannot just append or insert arguments into seemingly random places and have them work; the underlying application is coded to behave in a specific way and makes assumptions (by design) that certain arguments come before others, or that the final argument represents something.

    First and foremost, if your NAS unit exports CIFS/SMB shares, and has an IP address of 192.168.0.3, then you should be able to mount it on your TomatoUSB router under /mnt by doing the following:

    Code:
    mount -t cifs '//192.168.0.3/GoFlex Home Public/router' -o username=me,password=something /mnt
    
    Note the order of the arguments, note the syntax used for the CIFS/SMB path, note what slashes are used (either actually work but using / results in df showing things properly), and note the user of apostrophes (not double quotes). All this matters.

    I have tested this on TomatoUSB (Toastman), specifically tomato-K26USB-NVRAM64K-1.28.0505MIPSR2Toastman-RT-N-Ext.trx, and I can assure you it works:

    Code:
    root@gw:/tmp/home/root# mount -t cifs '//192.168.1.51/Apps' -o username=myuser,password=mypass /mnt
    root@gw:/tmp/home/root# df -k /mnt
    Filesystem           1K-blocks      Used Available Use% Mounted on
    //192.168.1.51/Apps  1914753444 550423576 1364329868  29% /tmp/mnt
    
    Next: I notice is that you're trying to actually mount a directory under the CIFS/SMB share, not the share itself. There is no guarantee this will work, it varies per CIFS/SMB implementation. If you get it to work, great, but understand it will not necessarily work everywhere. In English: use '//192.168.0.3/GoFlex Home Public' (without the /router portion) if you encounter immediate errors.

    If you get a different error message, especially ones indicating VFS issues or something else, then those are almost always caused by picking an incorrect IP address of the CIFS/SMB server, or caused by wrong credentials or access rules on the CIFS/SMB device. That's for you and your NAS vendor to work out (you need to contact their Technical Support and tell them what you're doing, specifically that you're trying to mount an exported CIFS/SMB share on the NAS, from a Linux 2.6-based client).

    Next: if you want to mount this CIFS/SMB share on the TomatoUSB router under a subdirectory on /mnt, ex. /mnt/nas, you need to make sure that directory exists first. In other words: mkdir /mnt/nas followed by doing the mount command.

    Next: on the firmware I run (see above), there is a mount-cifs command. However just use mount -t cifs like I mentioned above. Don't futz around digging.

    Finally: you should probably add the nobrl argument to the CIFS mount flags, e.g. ... -o username=myuser,password=mypass,nobrl (that's a lowercase ELL, not a ONE or uppercase EYE). The bug/issue is described here.
     
    Last edited: Jul 25, 2014
    Siff likes this.
  4. leandroong

    leandroong Addicted to LI Member

    maybe try replacing my workings NFS mount with cifs
    Code:
    mount -t nfs -o nolock,intr,hard,timeo=14,sync,rsize=32768,wsize=32768 10.0.1.1:/media/optware/NFS_storage /mnt/downloads
     
  5. Retronite

    Retronite Reformed Router Member

    I assume that you've already tried setting up a CIFS share through the routers GUI:-

    Administration > CIFS Client - on Shibby Firmware v1.20 :rolleyes:
     
  6. GigaGuy

    GigaGuy Network Newbie Member

    Thanks all!

    I dont have a GUI option, that why I am trying cli. The extra directory was just a failed attempt. Copy/pasted the wrong one to the forum.

    This didnt work, same error:
    mount -t cifs '//192.168.1.51/Apps' -o username=myuser,password=mypass /mnt

    noticed cifs is not listed in cat /proc/filesystems

    maybe my firmware for e3000 just doesnt include it?

    NFS works:
    mount -t nfs -o nolock,intr,hard,timeo=14,sync,rsize=32768,wsize=32768 10.0.1.1:/media/optware/NFS_storage /mnt/downloads
     
  7. koitsu

    koitsu Network Guru Member

    Sounds correct to me. cifs should be listed in /proc/filesystems if the kernel/firmware is built to support it, so it sounds like what you're using isn't.
     
  8. leandroong

    leandroong Addicted to LI Member

    run lsmod and see if you have cifs. If not, then install it using, insmod cifs.ko (or modprobe cifs.ko).
    Do this on router init script. Cifs.ko can be found on Shibby extra build.
     

Share This Page