Re: Maximum file size


Matti Aarnio (matti.aarnio@sonera.fi)
Tue, 2 Mar 1999 14:29:16 +0200 (EET)


Stefan Schroepfer <scr@iis.fhg.de> asks:
> What is the maximum file size in ext2 filesystems?
> Is there any difference between 32 and 64 bit systems?
> Is there some filesystem implemented in Linux/Alpha,
> which can handle files bigger than 2GB?

        The answer is a bit complex.

        With 2.0 series kernels there is *radical* difference
        in between 32 and 64 bit systems at what they can support.
        With latter 2.1 and 2.2 the differences are partly fixed.

        Namely in 2.0 the VFS layer supports file offsets/sizes up
        to system 'long'/'u_long' values -- 2G-1 for 32-bit machines.

        In 2.2 the VFS layer supports offsets/sizes mostly up to
        64-bit 'long long', however mainly so called buffer cache
        in the kernel limits things in 32-bit systems to 2G-1.

        So with 64-bit machines we are limited by filesystem internal
        limits, not VFS.

        With EXT2 the limit is a bit more complex to tell; it depends
        at the block-size in the filesystem, and ultimately it is
        limited to be 4G blocks of 512 bytes which is limit for all
        block devices in Linux. (And ext2 can't span multiple devices;
        a MD RAID* is just *one* device for ext2 ...)

        From ftp://mea.tmt.tele.fi/linux/LFS/try-lfs.c comments:

 * This program will terminate at llseek() resulting EINVAL
 * error. The reason is that the underlying EXT2 FS has its
 * own limitations for maximum file sizes depending the basic
 * block size used to create the filesystem:
 * 1k blocks allow 16 G + epsilon
 * 2k blocks allow 256 G + epsilon
 * 4k blocks allow 4096 G + epsilon
 *
 * The full formula for the classical UNIX indirectly addressed block
 * index scheme is:
 * B = blocksize_in_bytes
 * maxsize = ( (B/4)^3 + (B/4)^2 + (B/4) + 10 ) * B
 * Epsilon(s) above are thus the first and 2nd power terms, which are
 * less than 1/250 of the main term. (1/1000 at 4k blocks)

> Thanks,
> Stefan Schroepfer
> scr@iis.fhg.de

/Matti Aarnio <matti.aarnio@sonera.fi>

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com



This archive was generated by hypermail 2.0b3 on Tue Mar 02 1999 - 05:01:10 PST