大小限制[編輯]
ext3有一個相對較小的對於單個文件和整個文件系統的最大尺寸。這些限制依賴於文件系統的塊大小;下面的表格總結了這些限制[5]:
塊尺寸 | 最大文件尺寸 | 最大文件系統尺寸 |
---|---|---|
1KiB | 16GiB | 2TiB |
2KiB | 256GiB | 8TiB |
4KiB | 2TiB | 16TiB |
8KiB | 16TiB | 32TiB |
-----來自維基百科
ext3系統對應的單個文件限制爲:
blocksize 單個文件限制
1k 16G2k 256G
4k 2T
我們怎麼知道現在的分區是多大的blocksize呢?
一般而言,格式化時會自動選擇一個合適的文件大小的,硬盤大則會選4k,很小的則選擇1k的。
在正常的硬盤(600G)上:
[root@aslibra ~]# dumpe2fs /dev/sda3
dumpe2fs 1.35 (28-Feb-2004)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 8b556c99-cbe6-48f2-bbfe-fea1969e2557
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal resize_inode filetype needs_recovery sparse_super large_file
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 87785472
Block count: 175546271
Reserved block count: 8777313
Free blocks: 37366602
Free inodes: 74134440
First block: 0
Block size: 4096
虛擬機上分配的硬盤(7G)比較小:
[root@aslibra /]# dumpe2fs /dev/sda1
....
Block size: 1024
也就是說,基本上單個文件可以用完整個硬盤,空間不用太擔心。
有興趣看更多的文件格式比較:
http://en.wikipedia.org/wiki/Comparison_of_file_systems