如何在特定的文件系统上限制文件大小? [英] how the file size is limited on a specific file system?

查看:205
本文介绍了如何在特定的文件系统上限制文件大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 特定文件系统上的文件大小是如何限制的?

  • 有哪些因素会影响它?



在网上找到它。

解决方案

文件系统的文件大小限制通常由包含其文件的变量的大小决定尺寸。在大小定义为32位无符号整数的文件系统中,您将无法存储大小超过2 ^ 32-1(= 4294967295)个字节的文件。在许多现代文件系统中,文件大小通常以64位的形式存储,其最大文件大小为2 ^ 64(16 EiB),是一个非常大的数字。

的文件系统本身通常受到文件系统块的地址大小乘以文件系统块大小的限制。在旧的FAT16文件系统中,地址被限制为16位(= 65536个唯一地址),块(或簇)大小被限制为最大64kB,这导致最大文件系统大小限制为4GB,这就是更大的变体, FAT32,开发了。在NTFS,ext4,btrfs等现代文件系统中,最大文件系统的大小非常大,不可能在很长的时间内被击中。但是,由于实现的限制,在某些情况下,有一些仿真限制低于实际的格式限制,例如NTFS的文件系统大小限制为256TB(根据维基百科)。


  • 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.

解决方案

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).

这篇关于如何在特定的文件系统上限制文件大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆