IBM Support

SAMBA share will not allow copying of files larger than 2 GB

Troubleshooting


Problem

Operations upon a file sized greater than 2 GB fail with a 'file size limit exceeded' error.

Cause

Samba shares that are mounted using smbmount (which internally use the command mount -t smbfs) use the smbfs.o kernel module. This module does not support file sizes larger than 2 GB.

Resolving The Problem

The 2.4 linux kernels introduced support for large file sizes (LFS).  They can pass the lfs option to the smbfs kernel module.
A common misconception about smbfs.o is that it is a part of the Samba package.  It is actually a filesystem module for the kernel to dialogue over the CIFS/SMB protocol.

Example:

If you need to copy a file to Samba Share using smbclient, then use the following syntax:


$smbclient //<machine_name>/<samba_share_name> <password> -U <username> -c 'put <file_name>'

To test this:
1. As root, generate a file of 2.1 gigabytes:

dd if=/dev/zero of=largefile bs=100M count=21



2. Mount the file system including the lfs option:
mount -t smbfs //my_server/share /mnt/smbfs -o username=nz,lfs

3. Copy it:
cp largefile /mnt/smbfs

 If you have an older kernel, you will need to upgrade to get this large file support.

[{"Product":{"code":"SSULQD","label":"PureData System for Analytics"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ200515

Document Information

Modified date:
17 October 2019

UID

swg21570801