Re: Largest filesize under Linux

From: byron(at)cc(dot)gatech(dot)edu (Byron A Jeff)
To: pgsql-hackers(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: Largest filesize under Linux
Date: 2003-03-11 18:41:31
Message-ID: b4lakr$pd3@cleon.cc.gatech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-hackers

In article <e4pba(dot)794$yy2(dot)89177201(at)newssvr13(dot)news(dot)prodigy(dot)com>,
Partho Bhowmick <pbhowmick(at)sbcglobal(dot)net> wrote:
-I am working on extending the functionality of PostgreSQL on Linux.
-I need to know what's the largest filesize for a single file that I can have
-under Linux?

The answer is definitive: it depends...

There are multiple layers that have file size restrictions (from bottom to top):

* The filesystem itself on the disk.
* The Virtual File System implementation in the kernel.
* The filesystem library interface.
* The application.

The max file size is the minimum of the allowable file sizes for each
component. Generally there are two available sizes:

* 2.1GB imposed by a +/- 31 bit file offset. Until recently the VFS, library,
and applications imposed this limit.
* 9 million TB imposed by a +/- 63 bit file offset. Most recent distributions
have all 4 elements implementing this filesize.

Here's a simple test. On a filesystem with more than 5GB available try the
following:

# dd if=/dev/zero of=testfilesize bs=1024K count=3000

This will attempt to create a 3GB file which exceeds the 2.1GB max imposed by
31 bit offsets. If the file creation is successful, you can pretty much
create a file of any size.

BAJ

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Zachary Beane 2003-03-11 19:14:19 Re: date is not immutable ?
Previous Message Gaetano Mendola 2003-03-11 18:37:04 date is not immutable ?

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Månsson 2003-03-11 18:52:53 Re: commiting in/between functions
Previous Message Yohans Mendoza 2003-03-11 17:52:12 unsubscribe

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2003-03-11 19:22:46 Re: Roadmap for FE/BE protocol redesign
Previous Message Tom Lane 2003-03-11 18:38:42 Re: Roadmap for FE/BE protocol redesign