# smbfs lfs file size > 2 GB

## hack1009

hi there,

I've got an NAS drive which only supports smbfs. I've tried the well know command

```

mount -t smbfs -o lfs,guest,uid=1000,file_mode=0755,dir_mode=0777 //videonas/PUBLIC /NAS/

```

but I can only create files <= 2 GB.

Can anyone help me? 

I'm using:

2.6.26-gentoo-r4

net-fs/samba-3.0.33  USE="acl ads ipv6 ldap pam python readline -async -automount -caps -cups -debug -doc -examples -fam -oav -quotas (-selinux) -swat -syslog -winbind" 

Again: I know that cifs is faster, better, greater, ..., but this NAS only supports smbfs, no nfs or something else.

----------

## i92guboj

Mmm, you mount it remotely as smbfs, but, which kind is the real file system on the NAS? Remember that the FAT family do have some serious limitations. However, for FAT32 it should allow you up to 4 GB's (minus 2 bytes) if my memory serves correctly. For FAT16 the limitation is around 2 GB, however that limitation is also the limitation for the volume size on most Windows versions (if not all), so... Not sure what else could we look at.

----------

## hack1009

the more mystic thing is, when I copy a huge file (12 GB) from a windows xp pc to the NAS, everything works...

----------

## i92guboj

Then I can't help. I am not a specialist in which regards samba, but using the "lfs" option should allow you to transfer large files. If it's not the file system and samba and your kernel are up to date, I can't really think of anything else...   :Sad: 

----------

## coolsnowmen

smbfs might have a 2gb limit, did you try cifs (it is the 'successor')?

EDIT: whoops, looks like NAS is not cool enough to support that, (as said in the first post).

----------

## hack1009

hi coolsnowmen,

thank you for your answer, but as I write in my first post, this NAS doesn't support cifs...

----------

## coolsnowmen

How old is this hardware? 

It was my understanding that cifs connects to all current implementations of the SMB protocol and that only people using win98/OS2 needed to use the old module.

----------

## richard.scott

 *hack1009 wrote:*   

> hi coolsnowmen,
> 
> thank you for your answer, but as I write in my first post, this NAS doesn't support cifs...

 

If the NAS supports Windows clients then it should support cifs too.

I believe that cifs should operate in the same way smb mounts do.

You will need to emerge cifs-mount to get the "-t cifs" to work on the mount command:

```
*  net-fs/mount-cifs

      Latest version available: 3.0.28

      Latest version installed: [ Not Installed ]

      Size of files: 21 kB

      Homepage:      http://linux-cifs.samba.org/cifs/cifs_download.html

      Description:   cifs filesystem mount helper split from Samba

      License:       GPL-2
```

----------

## coolsnowmen

 *richard.scott wrote:*   

> ...
> 
> I believe that cifs should operate in the same way smb mounts do.
> 
> 

 

While I'm here, 

    the only problem I've seen is anonymous logins require a hard to find (it is in man mount.cifs) mount option.

Oh, and of course you need to build the cifs modules and insert it.  There is no problem with having both cifs and smbfs modules loaded at the same time. That is, they are not mutually exclusive.

----------

## hack1009

@coolsnowmen

The hardware is brandnew. Freecom NAS drive 1 TB.

Of course I compiled and inserted to cifs kernel module and also the mount.cifs tool.

If I try cifs I get:

```

videoserver ~ # modprobe -v cifs

insmod /lib/modules/2.6.26-gentoo-r4/kernel/fs/cifs/cifs.ko

videoserver ~ # mount -t cifs -o guest //videonas/PUBLIC /NAS

mount error 5 = Input/output error

Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

```

The NAS don't need any authentication. Everyone can do anything. 

Again: Mounting with smbfs isn't a problem, but my problem still exists...

```

videoserver ~ # modprobe -v smbfs

videoserver ~ # mount -t smbfs -o guest,lfs //videonas/PUBLIC /NAS

videoserver ~ # cat /etc/passwd >> /NAS/video.iso

cat: write error: File too large

videoserver ~ # ls -asl /NAS

total 4194314

      4 drwxr-xr-x  1 root root       4096 Dec 23 11:48 .

      4 drwxr-xr-x 21 root root       4096 Dec 19 07:24 ..

      2 -rwxr-xr-x  1 root root       1117 Dec 22 16:03 video

2097152 -rwxr-xr-x  1 root root 2147483647 Dec 22 14:18 video.iso

2097152 -rwxr-xr-x  1 root root 2147483647 Dec 22 15:04 video2.iso

```

----------

## richard.scott

 *hack1009 wrote:*   

> @coolsnowmen
> 
> The hardware is brandnew. Freecom NAS drive 1 TB.

 

Perhaps its a feature of the NAS box?

I have an Iomega StorCenter Pro that is also brand new and I'm unable to create files larger than about 2.5Gb

----------

## coolsnowmen

Please post your CIFS version: 

```
cat /proc/fs/cifs/DebugData
```

Assuming your kernel is relatively new, and you have the current stable mount.cifs, please try mount.cifs with --verbose with the following:

-o sec=none

and

-o sec=share

and post any output that could be helpful.

(Other possible security modes rekrb5, krb5i, ntlm, ntlmi, ntlmv2, ntlmv2i)

----------

## hack1009

my kernel and mount-cifs are actual version:

```

videoserver ~ # uname -r

2.6.26-gentoo-r4

videoserver ~ # emerge -pv mount-cifs

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] net-fs/mount-cifs-3.0.28  0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

```

```

videoserver ~ # cat /proc/fs/cifs/DebugData

Display Internal CIFS Data Structures for Debugging

---------------------------------------------------

CIFS Version 1.53

Active VFS Requests: 0

Servers:

Shares:

```

If I try to mount with the sec option I get

```

videoserver ~ # mount -t cifs --verbose -o sec=none,guest //videonas/PUBLIC /NAS

parsing options: rw,sec=none,guest

mount.cifs kernel mount options unc=//videonas\PUBLIC,ip=192.168.192.8,user=root,ver=1,rw,sec=none,guest

mount error 5 = Input/output error

Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

videoserver ~ # mount -t cifs --verbose -o sec=share,guest //videonas/PUBLIC /NAS

parsing options: rw,sec=share,guest

mount.cifs kernel mount options unc=//videonas\PUBLIC,ip=192.168.192.8,user=root,ver=1,rw,sec=share,guest

mount error 22 = Invalid argument

Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

```

Any other ideas?

----------

## coolsnowmen

I am sorry for your problems.  If it were me, I would try some other sec= options (w/o guest perhaps).

Aside from hitting up cifs's people you could try enabling debug and more legacy support:

<M>   CIFS support (advanced network filesystem, SMBFS successor)

 [ ]     CIFS statistics   

 [X]     Support legacy servers which use weaker LANMAN security

 [*]     CIFS extended attributes                              

 [*]       CIFS POSIX Extensions                              

 [X]     Enable additional CIFS debugging routines      

 [ ]     CIFS Experimental Features (EXPERIMENTAL) 

and see if you can find any more info with --vervobose, or something in /proc/.../cifs

You can give up script something with "split" to make 1G files for anything over that size.

Putting them back together with cp is easy.

 :Sad: 

----------

## tld

Note that when mounting cifs with the mount command (as apposed to using the mount.cifs command) you can only use ip addresses.  In order to get any name resolution you have to use mount.cifs.

Attempting to mount with the "mount" command using server names with the mount command results in that IO error...that one had ne going nuts for some time.

Tom

----------

## hack1009

Thanks @ everybody for your help,

but after trying mount and mount.cifs with and without sec, guest, hostname or ip I decided to buy another NAS with NFS support.

----------

## coolsnowmen

I don't know if you are still trying, but I noticed this in the newest kernel log:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c1b861539c15491593625920058e06452cd3747

[2.6.28]

[CIFS] Add nodfs mount option

Older samba server (eg. 3.0.24 from Debian etch) don't work correctly,

if DFS paths are used. Such server claim that they support DFS, but fail

to process some requests with DFS paths. Starting with Linux 2.6.26,

the cifs clients starts sending DFS paths in such situations, rendering

it unuseable with older samba servers.

The nodfs mount options forces a share to be used with non DFS paths,

even if the server claims, that it supports it.

----------

