45 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3About this Book4===============5 6This document attempts to describe the on-disk format for ext47filesystems. The same general ideas should apply to ext2/3 filesystems8as well, though they do not support all the features that ext4 supports,9and the fields will be shorter.10 11**NOTE**: This is a work in progress, based on notes that the author12(djwong) made while picking apart a filesystem by hand. The data13structure definitions should be current as of Linux 4.18 and14e2fsprogs-1.44. All comments and corrections are welcome, since there is15undoubtedly plenty of lore that might not be reflected in freshly16created demonstration filesystems.17 18License19-------20This book is licensed under the terms of the GNU Public License, v2.21 22Terminology23-----------24 25ext4 divides a storage device into an array of logical blocks both to26reduce bookkeeping overhead and to increase throughput by forcing larger27transfer sizes. Generally, the block size will be 4KiB (the same size as28pages on x86 and the block layer's default block size), though the29actual size is calculated as 2 ^ (10 + ``sb.s_log_block_size``) bytes.30Throughout this document, disk locations are given in terms of these31logical blocks, not raw LBAs, and not 1024-byte blocks. For the sake of32convenience, the logical block size will be referred to as33``$block_size`` throughout the rest of the document.34 35When referenced in ``preformatted text`` blocks, ``sb`` refers to fields36in the super block, and ``inode`` refers to fields in an inode table37entry.38 39Other References40----------------41 42Also see https://www.nongnu.org/ext2-doc/ for quite a collection of43information about ext2/3. Here's another old reference:44http://wiki.osdev.org/Ext245