About Linux FAQ

Browse More FAQs:

Samba mount and access large 2GB+ files from share or NAS device

Posted by Vivek on Tuesday March 6, 07 @2:33 pm

Q. I’m using NAS server share to make a backup of my webserver. However samba is not allowing me to backup of large files (2GB+).

My Samba share mount command is as follows:
smbmount //nas1.domain.com/sharename /datanas -o username=LOGINNAME,password=LOGINPASSWORD

Now if I copy file called /var/log/httpd/access.log (which is 3.5 GB file):
cp /var/log/httpd/access.log /datanas

I get ab error - file size limit exceeded

How do I solve this problem and copy large files to NAS samba share?

A. Linux kernel use smbfs.ko/smbfs.o module and it does not support file sizes greater than 2 GB. This is well known problem.

Mount your NAS samba share with lfs (large file system) option. General syntax is as follows:
smbmount //Hostname/Username /local/mountpoint -o username=username,password=password,lfs

For example:
# smbmount //nas1.domain.com/sharename /datanas -o username=LOGINNAME,password=LOGINPASSWORD,lfs

Where,

  • //nas1.domain.com/sharename : Server and Share name
  • /datanas : Local mount point
  • -o username=LOGINNAME,password=LOGINPASSWORD,lfs : Specify login, password and lfs options

Now you should be able to copy large files w/o a problem.

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Linux / UNIX FAQ:

Discussion on This FAQ

  1. gary Says:

    Thank you for adding this information. It proved very helpful.

  2. Leonard Lilla Says:

    Hey,

    Well, I had been looking for this a long time. I don’t know why I never landed on this site before. But I am here and thank you for this post. Saves me a lot of trouble!

    Leo

  3. John Says:

    Did you format the drive using the NTFS format? it sounds to me the drive is formatted as FAT32, which does not allow for files larger than 2GB

  4. DanD Says:

    FAT32 allows files larger than 2GB, up to almost 4GB

    “You cannot create a file larger than (2^32)-1 bytes (this is one byte less than 4 GB) on a FAT32 partition.”

    http://support.microsoft.com/kb/314463/

    also http://en.wikipedia.org/wiki/Fat32#FAT32

  5. nisarg Says:

    Hi, thanks!
    Thats been very useful.
    I was stuck at 2GB trying to rescue 60gb disk, writing to an NFTS partition mounted via SMBMOUNT.
    Just one question. With this lfs option - is there any limits at all? i hope not

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

~ Last updated on: March 6, 2007

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.