Re: VFS/ext2fs - large files on the Alpha (fails for 17GB+)

Matti Aarnio (matti.aarnio@sonera.fi)
Wed, 19 Aug 1998 09:43:10 +0300 (EEST)


> I've been playing with large files (ext2fs) on the Alpha, kernel
> 2.1.116.
>
> It appears I am able to create a 16 1/16 GB file - but not 16 1/8 GB
> file. Somewhere in between lies a limit or problem...
>
> Now, it seems to me, it should be possible to create files large than
> this, even several hundred GD, am I correct?

Well, with certain reservations: YES.
However...

(from a quick test program that lseek()ed 1 MB at the time..)
lseek(fd, 17248026624, SEEK_SET ): last errno = 22 (Invalid argument)

Lets see how it went..
- 10 directly mapped blocks
- 1 singly indirected block sets
- 1 doubly indirected block sets
- 1 triply indirected block sets

Each indirection block is able to tell location of blocksize/4 blocks,
thus if your EXT2 has 1kB blocks (default) in it, each of them can tell
256 blocks. Triply indirection gives thus 256^3 blocks of 1kB each, which
is that 16 GB you see. Add to it what little those lesser orders allow...

Remake your filesystem with larger blocksize, i.e.:

mke2fs -b 4096 /dev/zzz

and your maximum filesize goes up by function of:
(blocksize/4)^3*blocksize ( plus epsilon from ^2 term..)

1k: 16 GB
2k: 262 GB
4k: 4096 GB
8k: 70 TB

Propably you will be happy with 2k block size ;-)

> -cw
>
> P.S. On the Intel, we are restricted to 2GB files because of mm
> considerations. But, since we have a 3/1 split, why isn't the
> maximum file size 3GB?

File offsets are expressed in 32-bit signed integer (long), which can
cover only 2GB in 32-bit systems. That is why.
(That is also why 64-bit long at Alpha allows it to handle these gigantic
files...)

> -

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html