Discussion:
UFS2 max limits?
(too old to reply)
Joseph Koshy
2005-11-13 07:43:29 UTC
Permalink
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).

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

http://en.wikipedia.org/wiki/Comparison_of_file_systems

--
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
John-Mark Gurney
2005-11-13 18:19:00 UTC
Permalink
Post by Joseph Koshy
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...
Post by Joseph Koshy
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."
John-Mark Gurney
2005-11-13 18:25:53 UTC
Permalink
Post by John-Mark Gurney
as for the file size, The approximate max can be calculated by
(blocksize / sizeof(ufs2_daddr_t)) ^ 3 * blocksize
(blocksize / sizeof(ufs2_daddr_t)) ^ 2 * blocksize +
(blocksize / sizeof(ufs2_daddr_t)) * blocksize +
9 * blocksize
^
ack, I miss remebered, I knew I needed to check this before I sent the
email:
!!grep define.*N[DI]ADDR /usr/include/ufs/ufs/dinode.h
#define NDADDR 12 /* Direct addresses in inode. */
#define NIADDR 3 /* Indirect addresses in inode. */

The 9 above should be 12...
--
John-Mark Gurney Voice: +1 415 225 5579

"All that I will do, has been done, All that I have, has not."
Attila Nagy
2005-11-15 00:13:34 UTC
Permalink
Post by Joseph Koshy
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).
Are these numbers correct? I somehow remember the limits as
being much lower (of the order of 16TB or so).
I could only create a 128TB sparse file on an UFS2 partition, so I guess
32 PB is a little bith high.
--
Attila Nagy e-mail: ***@fsn.hu
Free Software Network (FSN.HU) phone: +3630 306 6758
ISOs: http://www.fsn.hu/?f=download
John-Mark Gurney
2005-11-15 00:29:01 UTC
Permalink
Post by Attila Nagy
Post by Joseph Koshy
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).
Are these numbers correct? I somehow remember the limits as
being much lower (of the order of 16TB or so).
I could only create a 128TB sparse file on an UFS2 partition, so I guess
32 PB is a little bith high.
No, it is not... The reason you were limited to 128TB is that you did
not create your filesystem with -f 65536 -b 65536... If you look at
my equation that I posted earlier, if you have a blocksize of 16384,
you end up with ~128TB as the max file size...

K M G T
(16384/8)^3*16384 / 1024 / 1024 / 1024 / 1024 == 128
--
John-Mark Gurney Voice: +1 415 225 5579

"All that I will do, has been done, All that I have, has not."
Continue reading on narkive:
Loading...