# Samba and copying large files problem

## Cyker

Hey all,

I'm in the process of moving lots of huge ISOs and VMware/VBox images around the network and have run into a really annoying problem between Samba and Windows.

I don't remember having this problem before, but basically when copying multiple large (GB's) files, Windows will throw up an error like:

```

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

Error Moving File or Folder

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

Cannot move CFD-BOX-ARWING7.VDI: Cannot find the specified file.

Make sure you specify the correct path and filename.

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

OK   

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

```

I am running samba-3.4.5 from ~ currently (It also happens with the previous stable 3.0.x series; I went to 3.4.5 to try and solve this and another problem)

Config file is:

```
# Samba config file created using SWAT

# from UNKNOWN (·Ðž·(É¿š·À€·÷Xk·$(É¿)

# Date: 2010/04/16 19:01:04

[global]

   workgroup = DOOMNET

   server string = %h (Samba %v)

   security = SHARE

   passdb backend = smbpasswd

   lanman auth = Yes

   client lanman auth = Yes

   client plaintext auth = Yes

   large readwrite = No

   name resolve order = lmhosts host wins bcast

   unix extensions = No

   socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

   load printers = No

   show add printer wizard = No

   mangle prefix = 3

   os level = 80

   dns proxy = No

   create mask = 0644

   hosts allow = 192.168.1.0/255.255.255.0

   aio read size = 1

   aio write size = 1

   block size = 4096

   case sensitive = No

   map archive = No

```

Anyone got suggestions of stuff to try?

The only real things I've changed from the default are:

large readwrite = No ;Significantly improved throughput than with it on!!

socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 ;;Fairly standard tweaks here

aio read size = 1 ;;No idea what these do. Don't seem to have any noticeable impact on

aio write size = 1 ;;performance (Large files or many small files)

The Windows boxes are 2000 and XP machines.

At the moment I've had to resort to SFTP'ing them over which, while blisteringly fast (Waay faster than samba, once it gets going anyway), is quite inconvenient because I have to do it in a two-step process (Transfer files, move to correct place)

(Seriously... there must be a better network file system out there that works in Windows and Linux?! (Don't say NFS. The Unix Services for Windows NFS client *sucks*))

----------

## yther

My suggestion would be to use a Windows SFTP client, such as FileZilla, to copy them directly into their destination.  I use it all the time to grab files off my Linux box and it works well.

Sorry I can't help with the Samba error itself, that's beyond my ken.   :Sad: 

----------

## Gankfest

Try replacing smbfs with cifs in your fstab and see if that resolves the issue.

----------

## Cyker

@yther - Yeah, that's basically what I'm doing, but it's more fiddly due to security restrictions

@paradox - I don't have smbfs or cifs anywhere in fstab... I didn't think they were needed for samba servers, only client connections?

----------

## Rexilion

If you are really desperate, another option would be to check if you upgraded anything on your clients (Windows Updates).

Microsoft has the habit of changing the Samba code every once in a while (just a little).

----------

## Cyker

That's a good point, although since it happens for both 2000 and XP the likelyhood isn't that high...

I plan to screw around with the smb.conf options a bit (There seems to be lots of new undocumented and obsolete params!), but I want to prep the system for the new 3.4.6 samba first (Need to find and undo all the changes I made for it becoming a split ebuild from the 3.0 series!)

----------

## Rexilion

As far as I know, samba always strives to be 100% Windows compatible out of the box. So a single share definition might help:

```
cat /etc/samba/smb.conf

[rexilion]

   comment = Home

   path = /home/secure/rexilion

   read only = yes

   valid users = rexilion

   public = no
```

That way, Samba should be fully compatible with Windows.

----------

## Cyker

Right, upgraded to 3.4.6, seems to have stopped doing it!

Oh well, that wasn't very exciting  :Razz: 

----------

