Maximum File Size supported by the ext2 File System

Source: Internet
Author: User

Struct ext2_inode {
...

_ U32 I _size;/* file size in bytes */
...
_ U32 I _block [ext2_n_blocks];/* pointer array pointing to data blocks */
_ Le32 I _dir_acl;/* Directory Access Control List */
...
};
I have just read chapter 18th of "a deep understanding of Linux kernel", which describes this issue:

Leave the 32-bit I _size field to limit the file size to 4 GB. In fact, the maximum bit of the I _size field is not used. Therefore, the maximum length of the file is 2 GB.
However, the ext2 file system contains a "dirty trick" that allows 64-bit architectures like amd opteron and IBM PowerPC G5 to use large files.
In essence, the I _dir_acl field of the index node (not used in common files) indicates the 32-bit expansion of the I _size field. Therefore, the file size is stored as a 64-bit integer in
Index node. Ext2 file system 64-bit and 32-bit versions are compatible to some extent, because the ext2 file system created on the 64-bit architecture can be installed on 32-bit
Architecture, and vice versa. However, large files cannot be accessed in the 32-bit file architecture unless the file is opened with the o_largefile flag.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.