Re: Filesize limitation

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Tue, 4 Nov 1997 00:41:46 +0100 (MET)


Richard B. Johnson wrote:
>
> On Mon, 3 Nov 1997, Andre Uratsuka Manoel wrote:
>
> >
> > Hello gentlemen,
> >
> > I was contact by people asking about filesize limits in Linux as
> > they tried to create a 2GB file, but couldn't. I figured the problem
> > might be the filesize limitation. At least that is what I'd expect to
> > happen with a file that size. Am I right on that? If it is so, is there
> > a 64-bit filesystem for Linux?
> >
> There is plenty of "room" available in the object types that would
> define a file in Linux for an ext2 file-system (like fpos_t, etc.)

No there isn't.

> I don't have a spare disk large enough to make a 2Gb file. However,

You don't need to. Make a file with a large hole in it.

> I would guess that if you can't make one (with large enough media), there
> is either a bug in the program that tries to create it or possibly a
> bug in the kernel. You don't need 64 bits to manipulate a 2 Gb file.

Nope. The minix filesystem limits you to 256Mb of file.
The ext2fs limits you to 2G files.

Try the following:

# create a file "testfile", seek to 2G-2Mb, write one Mb of zeroes.
dd if=/dev/zero of=testfile seek=2046 bs=1024k count=1
# OK.

# Append some kilobytes of zeroes, until we hit the limit.
dd if=/dev/zero bs=1k >> testfile
# File too large after 1023 blocks output.

# See how much disk space this uses:
ls -ls testfile
# 2058 blocks on my system. Around 2Mb. Each of the two dd commands
# generated an allocation of about 1Mb.

Someone sent me a short DOS program to analyse an image today. My
reaction was: I wouldn't write a program for that I should have a tool
already on my system to do that. So I did. Same here. Enough tools
available on a standard Linux box to experiment with from the command
line.....

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** +31-15-2137555 ** http://www.BitWizard.nl/ **
Florida -- A 39 year old construction worker woke up this morning when a
109-car freight train drove over him. According to the police the man was 
drunk. The man himself claims he slipped while walking the dog. 080897