lkml.org 
[lkml]   [1997]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Filesize limitation
Date
From
teunis wrote:
>
> On Tue, 4 Nov 1997, Rogier Wolff wrote:
>
> > 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.
>
> yes there is - fpos_t is moving towards 64bit I think....

So? Ext2fs is 32bit for filesizes.
The kernel is 32bit except for llseek. Other than that there is no 64bit
support.

That practically leaves us with a 32bit crippled OS.

> > > 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.
>
> No - it allows 64bit files :)

No. It allows for 64 bit partitions. Not files.

> ... providing the kernel can handle it though...
> [afaik, but backed up by a thread a couple of months ago]
>
> > 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.
>
> dd (or bash in this case) doesn't (yet) handle the large file access
> sysctl's.... (llseek and friends :)

No. This is simply doing the "write" system call. Some discussion went
on about a month ago, and some people vehemently object to allowing
programs to write to a file position that cannot be retrieved using
32 bit calls.

> and as an "append to file" requires a lseek to the end of the file...
> [incidentally, I can't remember why, but write() has this problem too]

No.
-- append does a "seek to 0, relative to end-of-file".....
-- That is, -*if*- it doesn't open the file in "append mode".
-- The above example didn't seek to beyond 2G, it uses writes to cross
the boundary.

Write could simply allow the creation of larger files. Some people are
afraid for "bad" bugs. Like " do the write" ask the filepos, and go
back there later. This stuff will wrap at 4G, returning you to the
beginning of the file. At 2G you'll get negative numbers, meaning that
you'll get an (absurd) error code instead of the file position.

>
> > # 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.....
>
> According to the thread I followed:
> 1. ext2fs is happy with 64bit limits

For partitions. Not for files.

> 2. Linux/Alpha doesn't have a problem with this IIRC

Linux/Alpha still uses 32bit Ints. Longs are 64 bit. If the prototypes
are right, indeed, you're right.

> 3. The 64bit sysctls are still being built.....
> (as a hint: they appeared in 2.1.60....)
Nice.

> 4. glibc-2.1 will be the first system to support them (already do)

Good.

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

\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.055 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site