# Large file support on 32bit server

## henri

Hi folks,

how do I enable the support of files over 2 GB on a 32 bit server so I am able to set maildir-quotas over 2 GB?

The actual used kernel is gentoo-2.6.14-r5.

Many thanks in advance,

    yours Henri

----------

## frostschutz

Which filesystem are you using? 2GB shouldn't be an issue whatsoever?  :Confused: 

----------

## henri

I'm using ext3, but the point is:

I need to create maildir-quotas much bigger than 2 GB!

We need a possible quota of 60 GB for an archive-mailbox.

yours Henri

----------

## frostschutz

 *henri wrote:*   

> I'm using ext3, but the point is:
> 
> I need to create maildir-quotas much bigger than 2 GB!

 

...and I don't see why it shouldn't just work right out of the box. What are you using for setting the quota and what's the error message when you try to set one larger than 2GB?

----------

## Cyker

Yeah, you should be able to. I have a 42GB RAR file backup here on my 32-bit ext3 software RAID5 so I'm sure having giant mail-spool files shouldn't be a problem...?

You might need to set something in your kernel config, but on my system at least, I could use large files right from the get go (And this system is a good few years old now!)

----------

## henri

Allright: There's a 2GB file-size limit in Linux.

All Linux ports for 32-bit CPUs (i.e., all architectures other than Alpha and IA-64) use 32-bit integers for file access and locking, yielding a maximum size of 2^31 - 1 = 2GB.

But there is installed a recent kernel and glibc which should remove the 2 GB limit, but it isn't removed.

Did I miss some important use flags, CFLAGS or kernel flags?

Many thanks in advance,

    yours Henri

----------

## henri

Ah, sorry, missed that one:

 *Quote:*   

> What are you using for setting the quota and what's the error message when you try to set one larger than 2GB?

 

 >> maildirmake -q 1500000000S /bla/bla/bla/archiv/maildir

...for example

 When I use a value greater than 2 GB, maildirmake stalls forever.

Greetings HenriLast edited by henri on Fri Aug 22, 2008 5:57 am; edited 1 time in total

----------

## pappy_mcfae

I'd guess you missed an option or two in your kernel .config, because I've generated some really big files on this machine, and it's 32 bit. These are the options I set that appear to allow me to have 4.4 gig files on my hard drive without so much as a whimper:

```

<snip>

CONFIG_KMOD=y

CONFIG_BLOCK=y

CONFIG_LBD=y

CONFIG_BLK_DEV_IO_TRACE=y

CONFIG_LSF=y

CONFIG_BLK_DEV_BSG=y

#

# IO Schedulers

#

<snip>
```

That should get you in the ballpark.

Blessed be!

Pappy

----------

## jcat

 *henri wrote:*   

> Allright: There's a 2GB file-size limit in Linux.
> 
> All Linux ports for 32-bit CPUs (i.e., all architectures other than Alpha and IA-64) use 32-bit integers for file access and locking, yielding a maximum size of 2^31 - 1 = 2GB.
> 
> But there is installed a recent kernel and glibc which should remove the 2 GB limit, but it isn't removed.
> ...

 

Haven't seen anyone mentioned this for years!  If you have a 2.6 kernel with CONFIG_LBD set to "Y" (and recent glibc), you should be fine.

Cheers,

jcat

----------

## frostschutz

CONFIG_LBD is for 2TB devices though, not 2GB. There shouldn't be a 2GB limit at all unless you use something that imposes such a limit on you (like FAT does, or software that can't handle 2GB for some strange reason).

----------

## Cyker

No, Linux has a 2GB filesize limit regardless of filesystem

In order to support larger fiiles, the system libs, kernel and app must have LFS compiled in otherwise they're stuck at 2GB.

This shouldn't be a problem on Gentoo unless it's specifically been disabled some how?

----------

## frostschutz

Ah okay, didn't know that. Badly configured kernel it is then (but CONFIG_LFS and not CONFIG_LBD is what is required for it to work)

----------

## jcat

 *frostschutz wrote:*   

> (but CONFIG_LFS and not CONFIG_LBD is what is required for it to work)

 

In that case I stand corrected.

Cheers,

jcat

----------

## cjubon

 *Cyker wrote:*   

> In order to support larger fiiles, the system libs, kernel and app must have LFS compiled in otherwise they're stuck at 2GB.

  Strange, the help in make menuconfig -> Enable the block layer -> Support for large single file says the following:  *Quote:*   

> CONFIG_LSF:
> 
> Say Y here if you want to be able to handle very large files (bigger
> 
> than 2TB), otherwise say N.

 

So again TB, not GB, it's really confusing. But I think the kernel help is right., the limit for which you need LSF is 2TB. My kernel config says "CONFIG_LSF is not set", but I can play a 4.1 GB mpeg without any problems.

----------

## Cyker

The 2TB thing is something else entierly, you probably don't need it.

Just having a non-ancient 2.6 kernel will give you LFS support - There is no explicit option for it afaik.

The problem usually lies in the application, although if the Gentoo system was made from a stage1 and not a stage3, then there is a possibility the system libs are lacking LFS support.

I used to have to do this manually when I was compiling stuff by hand on Slackware, but look for something like -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 in the compile stuff that flies past when you're emerging the program,

----------

