Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2000 17:54:24 +0100 (BST)
From:      Richard Tobin <richard@cogsci.ed.ac.uk>
To:        Dan Nelson <dnelson@emsphone.com>, "Andrew L. Gould" <algould@datawok.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: file size limit?
Message-ID:  <200008171654.RAA28581@rhymer.cogsci.ed.ac.uk>
In-Reply-To: Dan Nelson's message of Thu, 17 Aug 2000 09:27:27 -0500

next in thread | raw e-mail | index | archive | help
> According to the mail archives, the limit is somewhere between 500GB
> and 1TB.  I don't think anyone has actually tested out farther than 100
> GB or so through.

You don't need a TB of disk to test most aspects of a 1TB file; just
seek to 1TB and write something.

The program below produced an 8TB file (actually 8,000,000 * 1024 * 1024)

 bash-2.03$ big 8000000 >foo 
 bash-2.03$ ls -l foo
 -rw-r--r--  1 richard  10  8388608000000 Aug  6 11:50 foo

but failed for 9TB:

 bash-2.03$ big 9000000 >foo 
 write: File too large

I notice that "tail" doesn't seem to work above 2GB (under 4.1-RELEASE),
but "dd" does (eg on the 8TB file above "dd bs=8k skip=1023999999 <foo").

-- Richard

#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv)
{
  int meg = atoi(argv[1]);
  long long i, j;
  char buf[33];

  for(i=0; i<8192; i+=32)
    {
      sprintf(buf, "byte 0x%016x        \n", i);
      write(1, buf, 32);
    }

  j = (long long)meg * (1024 * 1024) - 8192;

  if(lseek(1, j, SEEK_SET) == -1)
    {
      perror("lseek");
      return 1;
    }

  for(i=0; i<8192; i+=32)
    {
      sprintf(buf, "byte 0x%016x        \n", j+i);
      if(write(1, buf, 32) < 0)
	{
	  perror("write");
	  return 1;
	}
    }

  return 0;
}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008171654.RAA28581>