# Problem mounting samba shares w/ CIFS as non-root

## Vlad

I'm trying to mount a share from my friends Windows 2000 box. I realize I can fall back on SMBFS, but SMBFS has a 2GB file size limit.  I'm doing this as a non-root user.  The permissions on the share are correct (I can mount it fine with smbmount).

# mount.cifs //server/share /mnt/c -o user=,pass=,domain=,uid=100,gid=101

(Yes, the user/pass/domain fields are filled in)

mount.cifs returns with:

mount error 1 = Operation not permitted

And in dmesg:

CIFS VFS: cifs_mount failed w/return code = -22

All my googling/forum searching hasn't turned up anything useful at solving this.  Anyone have any ideas why this is occuring? Thanks!

Vlad

----------

## DSL_MTLCA

over a year and no reply??? I'm having similar problems...

mythtv@frantic ~ $ sudo mount -t cifs -o,ro,user=guest,pass=none //one/music /mnt/mythtv/music/

mount: wrong fs type, bad option, bad superblock on //one/music,

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

mythtv@frantic ~ $dmesg

<snip>

 CIFS VFS: cifs_mount failed w/return code = -22

doesn't work in my fstab either:

//one/music      /mnt/mythtv/music cifs user=guest,pass=none,user,exec,suid,dev,ro 0 0

(that's the same exact line that works perfectly on another host)

I don't know why I'm getting this error...  I'm beginning to believe it is because the mount point "/mnt/mythtv/" is a remote NFS share, but I can't find anything on these forums or google regarding this message.  The weird thing is I can get that share to mount on my other system.  I don't know what gives...

P.S. If you're wondering, no I don't have any accounts on any of my machines named "guest", let alone w/ a password "none", it's there because if I don't put that, it'll ask for a password when mounting even though the samba share is browsable by guests

EDIT: It's not because I'm mounting something within a mount, because it works on another one of my machines.  I re-compiled my kernel and modules, and tried again, thinking maybe I had some config options set werid, but I still get the same message...

----------

## DSL_MTLCA

i see i guess i have to wait a year for a reply, and it'll probably be somebody else with a problem, not a solution!  heh (pitty bump)

----------

## Sixtiz

Yep, I have the same problem, but still no solution, this is pretty annoying...

----------

## Insanity5902

I have it working no problem.  You need to make sure the user you are trying to mount has owns the folder, the make sure the suid bit is set for /usr/bin/mount.cifs and then setup it so users can mount the share, are is what I did for it to work.

take ownership of folder

```

root#  chown -R user:group /mnt/share

```

set suid on the cifs program

```

root#  chmod +s /usr/bin/mount.cifs

```

and then the proper fstab entry

```

#network mounts

//swf-wk-fb-79192/c$     /mnt/ceswf/79192     cifs     noauto,user,user=m2imirtg     0 0

```

----------

## bcmm

Samba has no 2GB file limit if you mount the share with the "lfs" option (unless the actual file system on the host machine is limited).

Sorry if this comes a bit late...

----------

## Insanity5902

 *bcmm wrote:*   

> Samba has no 2GB file limit if you mount the share with the "lfs" option (unless the actual file system on the host machine is limited).
> 
> Sorry if this comes a bit late...

 

That fixes it on the linux side, but I still think/thought that windows as a limit on the size?

----------

## bcmm

Well, I just tried it and it worked with XP as server and Gentoo as client.

There is no limit on the Windows side unless it uses FAT32, in which case the same limit applies to local file access too.

----------

## Insanity5902

yeah fat32 is limited to 4gb, I though i read about something what windows has a limit on network transfers ... I guess i was wrong.  Thanks for the tip.

----------

## bcmm

Always seems to be 2GB for me.

Anyway, I guess some versions of Windows limit network transfer, e.g. ones that only support FAT (how can anyone make do with only one file system?)  :Razz: 

Presumably the reason it needs enabling in SAMBA is that the protocol used to not support large files or something.

----------

