0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 Blocks
0004 ------
0005
0006 ext4 allocates storage space in units of “blocks”. A block is a group of
0007 sectors between 1KiB and 64KiB, and the number of sectors must be an
0008 integral power of 2. Blocks are in turn grouped into larger units called
0009 block groups. Block size is specified at mkfs time and typically is
0010 4KiB. You may experience mounting problems if block size is greater than
0011 page size (i.e. 64KiB blocks on a i386 which only has 4KiB memory
0012 pages). By default a filesystem can contain 2^32 blocks; if the '64bit'
0013 feature is enabled, then a filesystem can have 2^64 blocks. The location
0014 of structures is stored in terms of the block number the structure lives
0015 in and not the absolute offset on disk.
0016
0017 For 32-bit filesystems, limits are as follows:
0018
0019 .. list-table::
0020 :widths: 1 1 1 1 1
0021 :header-rows: 1
0022
0023 * - Item
0024 - 1KiB
0025 - 2KiB
0026 - 4KiB
0027 - 64KiB
0028 * - Blocks
0029 - 2^32
0030 - 2^32
0031 - 2^32
0032 - 2^32
0033 * - Inodes
0034 - 2^32
0035 - 2^32
0036 - 2^32
0037 - 2^32
0038 * - File System Size
0039 - 4TiB
0040 - 8TiB
0041 - 16TiB
0042 - 256TiB
0043 * - Blocks Per Block Group
0044 - 8,192
0045 - 16,384
0046 - 32,768
0047 - 524,288
0048 * - Inodes Per Block Group
0049 - 8,192
0050 - 16,384
0051 - 32,768
0052 - 524,288
0053 * - Block Group Size
0054 - 8MiB
0055 - 32MiB
0056 - 128MiB
0057 - 32GiB
0058 * - Blocks Per File, Extents
0059 - 2^32
0060 - 2^32
0061 - 2^32
0062 - 2^32
0063 * - Blocks Per File, Block Maps
0064 - 16,843,020
0065 - 134,480,396
0066 - 1,074,791,436
0067 - 4,398,314,962,956 (really 2^32 due to field size limitations)
0068 * - File Size, Extents
0069 - 4TiB
0070 - 8TiB
0071 - 16TiB
0072 - 256TiB
0073 * - File Size, Block Maps
0074 - 16GiB
0075 - 256GiB
0076 - 4TiB
0077 - 256TiB
0078
0079 For 64-bit filesystems, limits are as follows:
0080
0081 .. list-table::
0082 :widths: 1 1 1 1 1
0083 :header-rows: 1
0084
0085 * - Item
0086 - 1KiB
0087 - 2KiB
0088 - 4KiB
0089 - 64KiB
0090 * - Blocks
0091 - 2^64
0092 - 2^64
0093 - 2^64
0094 - 2^64
0095 * - Inodes
0096 - 2^32
0097 - 2^32
0098 - 2^32
0099 - 2^32
0100 * - File System Size
0101 - 16ZiB
0102 - 32ZiB
0103 - 64ZiB
0104 - 1YiB
0105 * - Blocks Per Block Group
0106 - 8,192
0107 - 16,384
0108 - 32,768
0109 - 524,288
0110 * - Inodes Per Block Group
0111 - 8,192
0112 - 16,384
0113 - 32,768
0114 - 524,288
0115 * - Block Group Size
0116 - 8MiB
0117 - 32MiB
0118 - 128MiB
0119 - 32GiB
0120 * - Blocks Per File, Extents
0121 - 2^32
0122 - 2^32
0123 - 2^32
0124 - 2^32
0125 * - Blocks Per File, Block Maps
0126 - 16,843,020
0127 - 134,480,396
0128 - 1,074,791,436
0129 - 4,398,314,962,956 (really 2^32 due to field size limitations)
0130 * - File Size, Extents
0131 - 4TiB
0132 - 8TiB
0133 - 16TiB
0134 - 256TiB
0135 * - File Size, Block Maps
0136 - 16GiB
0137 - 256GiB
0138 - 4TiB
0139 - 256TiB
0140
0141 Note: Files not using extents (i.e. files using block maps) must be
0142 placed within the first 2^32 blocks of a filesystem. Files with extents
0143 must be placed within the first 2^48 blocks of a filesystem. It's not
0144 clear what happens with larger filesystems.