[plug] What is the maximum file size allowed under Unix

Kerry Hoath kerry at gotss.net
Wed Aug 1 19:22:38 WST 2001


I can't remember which versions of the kernel got the fix
but later versions of Linux 2.4.x not sure about 2.2.x have
large file support in the kernel. Maximum filesize limit is 4 terabytes.
There is not a physical limit on the number of files per directory; however
as the number of files increases directory seek times decrease.
There is however a limit to the number of files and directories on
a file system, the limit is the number of inodes.
Per default 1 inode per 4096 bytes is created. If you want more inodes;
reduce the -i option to mke2fs to 2048 or 1024. This can help
with news spools or squid storage but usually doesn't since 4k is
a good compromise between allocation and speed of access. Even
Windows uses 4k clusters for fat32.
Note that the bytes-per-inode ratio is set at file system creation and can't be changed with tune2fs.
It might be modifyable with other tools but I am unsure.

Regards, Kerry.
On Wed, Aug 01, 2001 at 06:57:17PM +0800, Carl Gherardi wrote:
> On Wed, 1 Aug 2001 psteege at tpg.com.au wrote:
> 
> > Is there an upper limit (maximum size) that a single file in a Unix
> > directory can be, or is the size of the disk drive the limit?
> > Also what is the maximum number of files that one directory can hold?
> >
> > Regards
> > Phil
> 
> It depends.
> 
> Maximun file size is determined by the default block size.
> 
> If using: ls -sal : your directory size is 4096 then your maximum file
> size is 2G.
> 
> I dont know about a maximum number of files for a directory, but i do
> remember an article a while back talking about the accidental creation of
> 65536 files in a directory bringing the system to a crawl. (Article was
> discussing the advantages of journaling file systems)
> 
> Carl
> 
> 

-- 
--
Kerry Hoath: kerry at gotss.net
alternatives: kerry at gotss.eu.org or kerry at gotss.spice.net.au
ICQ UIN: 8226547



More information about the plug mailing list