UFS2 max limits?

John-Mark Gurney gurney_j at resnet.uoregon.edu
Sun Nov 13 18:18:01 GMT 2005


Joseph Koshy wrote this message on Sat, Nov 12, 2005 at 11:05 +0530:
> The Wikipedia page referenced below says that UFS2 supports a
> filesystem size of 2^80 Bytes (1YiB) with the limit on a given
> file being 2^55 bytes (32 PiB).

Those sound correct, as UFS2 uses 64bit frag addresses, which when
combined with a frag size of 16 (for 65536 bytes per frag) gives you
2^80 for total file system size....

as for the file size, The approximate max can be calculated by
(blocksize / sizeof(ufs2_daddr_t)) ^ 3 * blocksize
the real max would add in addition:
(blocksize / sizeof(ufs2_daddr_t)) ^ 2 * blocksize + 
(blocksize / sizeof(ufs2_daddr_t)) * blocksize + 
9 * blocksize 

so, with a blocksize of 65536, and ufs2_daddr_t's size being 8 bytes,
you end up with:
(2^16 / 2^3) ^ 3 * 2^16
(2^13)^3 * 2^16
2^(13*3) * 2^16
2^39 * 2^16
2^(39 + 16)
2^55

but if you add the additional blocks, you'll end up with larger, but
not enough to go to 2^56 for file sizes...

> Are these numbers correct?  I somehow remember the limits as
> being much lower (of the order of 16TB or so).

You might be thinking of UFS1...  Now there is a funny thing that
I found out about UFS2 and UFS1...  UFS1 supports larger file
sizes (not file system sizes) due to the fact that the ufs_daddr_t
is smaller (32bits), means it can get more out of the indirect blocks
than UFS2 can... UFS1 can have files of 2^58 compared to UFS2's 2^55...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-hackers mailing list