*BSD News Article 98613


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.Hawaii.Edu!news.uoregon.edu!news.rediris.es!newsfeed.mad.ibernet.es!hunter.premier.net!tnt.premier.net!news-feed1.tiac.net!cam-news-hub1.bbnplanet.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!rill.news.pipex.net!pipex!hose.news.pipex.net!pipex!warm.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.utell.co.uk!usenet
From: brian@shift.utell.net (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: ufs, ext2fs sizes
Date: 27 Jun 1997 14:20:24 GMT
Organization: Awfulhak Ltd.
Lines: 67
Message-ID: <5p0i78$o4d@ui-gate.utell.co.uk>
References: <33AF89E9.513B63BD@info13.polytechnique.fr>
    <5otrdo$dlh@ui-gate.utell.co.uk> <5ou9om$mqg$1@godzilla.zeta.org.au>
Reply-To: brian@awfulhak.org, brian@utell.co.uk
NNTP-Posting-Host: shift.utell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:43632

In article <5ou9om$mqg$1@godzilla.zeta.org.au>,
	bde@zeta.org.au (Bruce Evans) writes:
> In article <5otrdo$dlh@ui-gate.utell.co.uk>,
> Brian Somers <brian@awfulhak.org, brian@utell.co.uk> wrote:
>>In article <33AF89E9.513B63BD@info13.polytechnique.fr>,
>>	ClimServ <climserv@info13.polytechnique.fr> writes:
>>> - what is the maximum size of an ufs filesystem ?
>>
>>9223372036854775808 bytes.
> 
> Many wrong answers have been given to this question.  The limit is
> 2^31 * DEV_BSIZE, where DEV_BSIZE is normally 512, i.e., normally 1TB.
> 
> The file size is currently limited mainly by triple indirect blocks
> never actually being allocated.  This gives a maximum file size of
> about 32GB for a file system with a block size of 8K.

I don't follow.  Are you saying that FreeBSD doesn't use more
than 3 levels of indirection ?  If so, are there any plans to
fix it ?  Surely this is an error - AFAIK, the max file size
*should* == max partition size.  Or is it intentional ?

> 
>>> - if I choose ext2fs instead of ufs, can I take full advantage, under
>>>   FreeBSD, of the Terabyte filesystem size of ext2fs ?
>>
>>Eh ?  A terabyte is relatively small !  What's the "full advantage" ?
> 
> ext2fs has the same file system size limit as ufs for the same reasons.

I definitely don't understand.  It's unlikely that both would
suffer from the same :|

> The file size for ext2fs is limited to 2^32 by the 32-bit size field
> in the inode and to 2^31 by bugs in the code.

Ouch.  Has linux fixed this (made the size an off_t) ?  I'm assuming
that the code uses off_t (== long long) - otherwise of course it would
be limited to 2^31 by the signed int/long.

>>> - are ext2fs tools (mke2fs, e2fsck) available under FreeBSD ?
>>
>>Not in my path (RELENG_2_2).
> 
> The Linux version of more or less work under the Linux emulator.  You have 
> to give block counts explicitly because some ioctls don't work.

This makes sense.


My answers were based on a filesystem needing to be addressed by
an off_t on a per-byte basis.  This (from what Bruce is saying)
isn't true, and is obvious when you take a look at sys/disklabel.h

Perhaps disklabels should use a "unsigned long long" ?  Are there
restrictions at a lower level ?

Certainly, in my experience with things like this, there's always
some sneaky code that does smart-arsed things with fragments or
the equivalent where (for example) a block is only actually addressed
using 24 bits, and the other byte is used to address the fragment.
I've done this (for speed) writing database code before.

-- 
Brian <brian@awfulhak.org> <brian@freebsd.org>
      <http://www.awfulhak.org>
Don't _EVER_ lose your sense of humour !