About Linux FAQ

Browse More FAQs:

File size limit exceeded error under Linux and solution

Posted by Vivek Gite [Last updated: September 21, 2007]

Q. I am trying to copy a file called act.dat and I am getting an error "file size limit exceeded" under Linux. How do I get rid of this error? In addition, I do have enough disk space to copy this file.

A. Your system administrator must have imposed limitation on your account for file size creation.. Just run ulimit command to find out file size limitation:

$ ulimit -a

Output:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
max nice                        (-e) 0
file size               (blocks, -f) 5000
pending signals                 (-i) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) unlimited
max rt priority                 (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 2047
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

The above output clearly stat that you can create file size upto 5MB limit. To change this limit or if you do not wish to have a limit you can edit your /etc/security/limits.conf file (login as the root):
# vi /etc/security/limits.conf
Look for your username and fsize parameter. Delete this line or set new parameter. For example consider following entry where I am setting new file size limit to 1 GB:

vivek       hard  fsize  1024000

Save the changes. Log out and log back in for the changes to take effect.

Now your limit is 1GB file size. If you do not want any limit remove fsize from /etc/security/limits.conf.

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

Related Other Helpful FAQs:

Discussion on This FAQ

  1. Deepan.R Says:

    Hi,

    I too facing the File size limit exceeded error under Linux. But as per the above suggested solution, the ulimit is not setted for the user root, in my case. But still Im getting the error while I connect my USB Hard Drive and try to copy files. No file can be copied more than 4.1GB…I need to copy some 23 GB files and I still have the space in USB.

    Kindly inform me what can I do….Mean while, I am aslo searching the web for a solution.

    Regards,
    Deepan.

  2. Chris Says:

    Deepan.R:

    This is probably due to the filesystem that your hard drive is formatted to. Each filesystem has a file size limit of its own. Chances are that the hard drive is formatted as FAT32, which has a 4GB max filesize. If you need it to be able to deal with larger files, consider reformatting to ext3(with a limit of between 16GB to 2 TB)) or something else.

  3. Mani Says:

    Hi,
    I tried as per your suggestion.The explanation is very good. It worked well for me. Thanks a lot.

    Regards,
    Manigandan

  4. Purna Says:

    try this command.
    #dd if=/dev/zero of=/filesize bs=1024 count=xxxx // to create large file.
    If this helps you to create expected filesize then filesystem/os does not limits you.

    To create this sort of filesize you have to use LFS. becoz bydefault 32bit compilation is able to address at most 2^31 bytes(2GB).
    1. open file with O_LARGEFILE flag or’ed with other falgs.
    2. compile your code with -D_LARGEFILE_SOURCE -D_LARGEFILE_SOURCE64 -DLARGEOFFSET_BITS=64

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. 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

Tags: , , , ,

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