how the file size is limited on a specific file sy

2020-07-17 05:50发布

  • How the file size is limited on a specific file system?
  • What factors affects it ?

can any one give the details .. I can not find it in the net.

2条回答
我想做一个坏孩纸
2楼-- · 2020-07-17 05:56

The file size limit of a filesystem is generally decided by the size of the variable containing its file size. In a filesystem where the size is defined as a 32 bit unsigned integer you will not be able to store a file larger than 2^32-1 (=4294967295) bytes in size. On many modern filesystems file size is commonly stored as 64 bits which gives a maximum file size of 2^64 (16 EiB), a very large number.

The maximum size of the filesystem itself is generally limited by the size of the addresses of the filesystem blocks times the filesystem block size. On old FAT16 filesystems the addresses were limited to 16 bits (=65536 unique addresses) and block (or cluster) size were limited to maximum 64kB, this led to the limit of 4GB maximum filesystem size, this was the reason that a larger variant, FAT32, was developed. On modern filesystems such as NTFS, ext4, btrfs, and many others the maximum filesystem size is very large and not likely to be hit in a long time. However, because of limitations in the implementations, there are some artificial limits that are lower than the actual format limit in some cases, for example NTFS has a filesystem size limit of 256TB (according to Wikipedia).

查看更多
三岁会撩人
3楼-- · 2020-07-17 06:16

I don't really get what you are up to, but I try to answer nevertheless.

A file system limits its maximum file size due to several reasons:

  • The field for the file size entry in the inode has a maximum size
  • The numbers of blocks per file max be limited

For example, in a 32 bit field you can enter only a maximum value of 4*1024^3 - so this is the maximum size.

查看更多
登录 后发表回答