Redhat官方说明ext4最大支持16TB分区。

https://access.redhat.com/solutions/1532

实际上,ext4支持最大1EiB的文件系统和16TiB的文件。
http://en.wikipedia.org/wiki/File_system_comparison#Limits
https://ext4.wiki.kernel.org/index.php/Ext4_Howto#Bigger_File_System_and_File_Sizes

但在实际格式化一个20T的Raid空间时候,发生了这个错误:
mkfs.ext4: Size of device /dev/md0 too big to be expressed in 32 bits
using a blocksize of 4096.

很多人用mkfs.ext4尝试不通之后,就改用xfs了。
而实际上,这个问题早有人解决了,解决方法起始也比较简单。 原来EXT4是真的支持1EiB的文件系统的,只是mkfs无法支持大于16T的文件系统,所以只需要升级一下格式化工具即可。

关于为什么mkfs.ext4不能格式化大于16T的Ext4文件系统以及其解决方法,原文解释如下:
To be specific: Even with the most recent e2fsprogs 1.41.14 there is no way to create file systems larger than 16 TB.
But: According to this post it should work since June:
It’s taken way too long, but I’ve finally finished integrating the 64-bit patches into e2fsprogs’s mainline repository. All of the necessary patches should now be in the master branch for e2fsprogs. The big change from before is that I replaced Val’s changes for fixing up how mke2fs picked the correct fs-type profile from mke2fs.conf with something that I think works much better and leaves the code much cleaner. With this change you need to add the following to your /etc/mke2fs.conf file if you want to enable the 64-bit feature flag automatically for a big disk:
[fs_types] ext4 = {
features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
auto_64-bit_support = 1 # <—- add this line
inode_size = 256
}
Alternatively you can change the features line to include the feature “64bit”; this will force the use of the 64-bit fields, and double the size of the block group descriptors, even for smaller file systems that don’t require the 64-bit support. (This was one of my problems with Val’s implementation; it forced the mke2fs.conf file to always enable the 64-bit feature flag, which would cause backwards compatibility issues.) This might be a good thing to do for debugging purposes, though, so this is an option which I left open, but the better way of doing things is to use the auto_64-bit-support flag.

所以,只需要升级下工具即可,升级方式如下:
下载最新的e2fsprogs,编译安装
ftp://ftp.ntu.edu.tw/linux/kernel/people/tytso/e2fsprogs/

tar zxvf e2fsprogs-1.42.10.tar.gz
cd e2fsprogs-1.42.10
mkdir build
cd build/
../configure
make
make install

完毕之后还是不能用mkfs.ext4来格式化,而要用“mke2fs”进行格式化,命令参考如下:
mke2fs -O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -i 4194304 /dev/sdb1
格式化完毕后就挂载了。

附,工具下载:
e2fsprogs-1.42.12.tar.gz
http://218.57.146.166:8443/download/attachments/3246252/e2fsprogs-1.42.12.tar.gz?version=1&modificationDate=1428650877690&api=v2

[e2fsprogs-libs-1.42.12.tar.gz
http://218.57.146.166:8443/download/attachments/3246252/e2fsprogs-libs-1.42.12.tar.gz?version=1&modificationDate=1428650888237&api=v2