OpenWrt Forum Archive

Topic: mount samba share

The content of this topic has been archived on 1 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I would like to mount a share from NAS disk. I know that there is no smbmount client and I have install cifs, but it seems that my NAS disk is not compatible with cifs. I have tried to mount disk using cifs via my laptop but there was the same error reported.

sudo mount.cifs //disk/PUBLIC /tmp/public/ -o user=grega --verbose
parsing options: user=grega
Password:

mount.cifs kernel mount options unc=//disk\PUBLIC,ip=192.168.1.212,pass=XXXXXXX,ver=1,user=grega
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

If I use smbmount (mount.smbfs) dir is mounted without a problem.

I can see share via smbclient, but I need to mount share (use ctorrent to store data on nas disk).
Is this possible?

tnx.

Tnx for that, but it doesn't work

root@OpenWrt:~$ mount.cifs //192.168.1.212/PUBLIC /tmp/share/ -o unc=\\\\192.168.1.212\\PUBLIC,ip=192.168.1.212,user=grega,domain=WORKGROUP --verbose

parsing options: unc=\\192.168.1.212\PUBLIC,ip=192.168.1.212,user=grega,domain=WORKGROUPunc name specified twice, ignoring second
ip address 192.168.1.212 override specified
ip address specified explicitly
Password:

mount.cifs kernel mount options unc=//192.168.1.212\PUBLIC,pass=380dc078,ver=1,unc=\\192.168.1.212\PUBLIC,ip=192.168.1.212,user=grega,domain=WORKGROUP
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

The following command eecuted on my linux machine returns the same error.

Does this mean that my NAS disk can not be mounted using cifs?

The following works on my laptop:
mount.smbfs //192.168.1.212/PUBLIC /tmp/a/ -o user=grega,domain=WORKGROUP --verbose

???

I don't think your device is not compatible with cifs.
Try not to use mount.cifs

Try

mount -t cifs //192.168.1.2/share /tmp/mnt -o unc=\\\\192.168.1.2\\share,ip=192.168.1.2,user=admin,pass=geheim ,dom=workgroup

It is the same

root@OpenWrt:~$ mount -t cifs //192.168.1.212/PUBLIC /tmp/share/ -o unc=\\\\192.168.1.212\\PUBLIC,ip=192.168.1.212,user=grega,pass=grega,domain=WORKGROUP --verbose
mount: Mounting //192.168.1.212/PUBLIC on /tmp/share/ failed: Not a directory

Any idea?

/tmp/share exists right?

leave the trailing / away from /tmp/share/

Hi,

The same.

Any other idea?

no.. I'm out... well the onlything that is different is that I use dom=workgroup and you use domain=workgroup

Hi,

I have tried everything and no success.

I need smbmount. Is there a plan that this will be supported in the future?

TheOne wrote:

Hi,

I have tried everything and no success.

I need smbmount. Is there a plan that this will be supported in the future?

hi!

i had the same problem with my NAS and the cifs-stuff that was available for RC6. obviously that version of CIFS isn't compatible with some SMB-implementations. anyway, i compiled smbfs.o and the accompaning smbmount-tools and put them in an ipkg:

# ipkg install http://riot.org/seb/smbfs_0.0_mipsel.ipk
# insmod smbfs
# smbmount //machine/share /mnt/smb -o rw,guest

note that you need to use smbmount, since busybox's mount doesn't know anything about smb-shares.

note to devs: sorry i don't have any time to send you appropriate patches, but you should enable smbfs in the kernel and add --with-smbmount to the samba configure-params. also smbmount needs slight patching, but it's only a string-thing.

please don't contact me about this package, if it works for you i'm glad, if not, i'm sorry!

Hello,

Thx 10x. It is working.

Best regards

rasputnik wrote:

i had the same problem with my NAS and the cifs-stuff that was available for RC6. obviously that version of CIFS isn't compatible with some SMB-implementations. anyway, i compiled smbfs.o and the accompaning smbmount-tools and put them in an ipkg:

# ipkg install http://riot.org/seb/smbfs_0.0_mipsel.ipk
# insmod smbfs
# smbmount //machine/share /mnt/smb -o rw,guest

Wow thanks.  Been fighting this one for days.  Weird how the current CIFS works for some, but not for others.  Tried all the commands, checked syntax over and over, but nothing.  Packet trace shows clearly that the current CIFS is sending incorrect info, which some servers don't mind.  DEVS PLEASE FIX CIFS in the next release. smile

This works great, btw.

Hey rasputnik, you are my hero!

I have spent several days, tried many firmwares, and made many tests of all sort of configurations trying cifs to work with no luck. I really hope they fix it soon, but in the meantime i will be using smbmount. Many thanks !

- Shadsec

I have some trouble with the installation of this package :
# ipkg install http://riot.org/seb/smbfs_0.0_mipsel.ipk

gave the following  :

Connecting to riot.org[213.133.111.116]:80
smbfs_0.0_mipsel.ipk 100% |*****************************|   301 KB    00:00 ETA
Done.
tar: Invalid gzip magic
tar: Short read
ipkg_install_file: ERROR unpacking control.tar.gz from //tmp/ipkg/smbfs_0.0_mipsel.ipk

Any idea what's wrong??
Thanks for your help

WONDERFULL !!

This works with RDC2882 based NAS drives (like conceptronics, landrive, ...)

Many many thanks.

I was trying to compile lufs (lufs.sourceforge.net) to get ftpfs to mount the drive through FTP, but I just gave up & was going to post a message, when I saw yours!

Great!!

(so the errors in lufs:
make -C /home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/ \
                AR=mipsel-linux-uclibc-ar AS="mipsel-linux-uclibc-gcc -c -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time" LD=mipsel-linux-uclibc-ld NM=mipsel-linux-uclibc-nm CC="mipsel-linux-uclibc-gcc" GCC="mipsel-linux-uclibc-gcc" CXX=mipsel-linux-uclibc-g++ RANLIB=mipsel-linux-uclibc-ranlib STRIP=mipsel-linux-uclibc-strip OBJCOPY=mipsel-linux-uclibc-objcopy \
                prefix="/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/ipkg-install/usr"
make[3]: Entering directory `/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7'
make  all-recursive
make[4]: Entering directory `/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7'
Making all in kernel
make[5]: Entering directory `/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel'
Making all in Linux
make[6]: Entering directory `/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux'
Making all in 2.6
make[7]: Entering directory `/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux/2.6'
make -C /lib/modules/`uname -r`/build SUBDIRS=`pwd` modules
make[8]: Entering directory `/usr/src/linux-headers-2.6.17-10-generic'
  CC [M]  /home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux/2.6/proc.o
cc1: error: invalid option `regparm=3'
/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux/2.6/proc.c:1: error: bad value (i586) for -march
Assembler messages:
Error: Bad value (i586) for -march
make[9]: *** [/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux/2.6/proc.o] Error 1
make[8]: *** [_module_/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux/2.6] Error 2
make[8]: Leaving directory `/usr/src/linux-headers-2.6.17-10-generic'
make[7]: *** [all] Error 2
make[7]: Leaving directory `/home/ubuntu/Desktop/OpenWrt-SDK-Linux-i686-1/build_mipsel/lufs-0.9.7/kernel/Linux/2.6'
)

after playing around with it for a day, it seems that sometimes, it won't see all the files shared e.g. ls/mnt/smb will only display some of the directories that are there.

after a reboot it may /not work again...
strange

I am able to mount my LanDisk Pro (RDC2882 based i think) using the standard samba packages using

echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
mkdir -p /mnt/netdisk/openwrt/
mount.cifs //192.168.1.111/openwrt /mnt/netdisk/openwrt/

But the problem is samba on landisk is a piece of shit, even mounting from ubuntu i get random errors and missing data. Im going to try mounting over FTP but it looks like the NAS is just to cheepo (i got it for US$80 in Singapore)

Its a shame, i want to mount and install crap on the landisk from my wrt54gl but no symlinks over samba would mean manual linking back to the 54gl.

I use a Linux box and mount.cifs to pull backups from 10 or 11 Windows and 4 or 5 Linux servers, I re-partitioned and reloaded the box and used my same script to get my files. Before popping it into a cron job I tested each backup for each server. All worked except one. I used the command below:

/sbin/mount.cifs \\\\jupiter\\academy /mnt/jupiter -o username=myusername%password

It errors as follows:

mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

I did quite a bit of research and found no solution, so I started looking at the server Jupiter (windows server), when I setup a new share on it for testing I left the user "everyone" with read access (on the sharing tab under permissions). It now works fine. I realize the original post was about a samba server, perhaps permission adjustments may help?

BTW the original mount.cifs (efore reloading)worked fine connecting to Jupiter

The discussion might have continued from here.