Not able to FTP or copy a file with more than 2 GB

Copy error when trying to copy a file from your pc to server where file size is more than 2GB.

  Error : cp: Requested a write of 4096 bytes, but wrote only 3584


How to to get out of this error


 Scenario :

 I was trying to copy 2.5 GB file from my local system to AIX system through WinScp but after copying 1 GB file coping of file get stopped.

Then I tried with FTP still the same issue.

Then I tried to copy that file from one Linux machine through NFS (after successfully uploaded to LINUX system) to AIX still the same issue.

Getting error : " cp: Requested a write of 4096 bytes, but wrote only 3584. "

Then I remember the USer options .

ULIMIT is the one which we need to check

so I changed the ulimit to unlimited for temporary and able to copy the file.

#ulimit -f unlimited
#ulimit -d unlimited


So How to use Ulimit

User limits - limit the use of system-wide resources.

Syntax
      ulimit [-acdfHlmnpsStuv] [limit]


Options

   -S   Change and report the soft limit associated with a resource.
   -H   Change and report the hard limit associated with a resource.

   -a   All current limits are reported.
   -c   The maximum size of core files created.
   -d   The maximum size of a process's data segment.
   -f   The maximum size of files created by the shell(default option)
   -l   The maximum size that may be locked into memory.
   -m   The maximum resident set size.
   -n   The maximum number of open file descriptors.
   -p   The pipe buffer size.
   -s   The maximum stack size.
   -t   The maximum amount of cpu time in seconds.
   -u   The maximum number of processes available to a single user.
   -v   The maximum amount of virtual memory available to the process.

ulimit provides control over the resources available to the shell and to processes started by it, on systems that allow such control.

The soft limit is the value that the kernel enforces for the corresponding resource. The hard limit acts as a ceiling for the soft limit.

An unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process may make arbitrary changes to either limit value.

If limit is given, it is the new value of the specified resource. Otherwise, the current value of the soft limit for the specified resource is printed, unless the `-H' option is supplied.
When setting new limits, if neither `-H' nor `-S' is supplied, both the hard and soft limits are set.
Restricting per user processes ( -u) can be useful for limiting the potential effects of a fork bomb.

Values are in 1024-byte increments, except for `-t', which is in seconds, `-p', which is in units of 512-byte blocks, and `-n' and `-u', which are unscaled values.
The return status is zero unless an invalid option is supplied, a non-numeric argument other than unlimited is supplied as a limit, or an error occurs while setting a new limit.
ulimit is a bash built in command.

ADD this Info

Bookmark and Share