~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/filesystems/ext4/blocks.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GPL-2.0
  2 
  3 Blocks
  4 ------
  5 
  6 ext4 allocates storage space in units of “blocks”. A block is a group of
  7 sectors between 1KiB and 64KiB, and the number of sectors must be an
  8 integral power of 2. Blocks are in turn grouped into larger units called
  9 block groups. Block size is specified at mkfs time and typically is
 10 4KiB. You may experience mounting problems if block size is greater than
 11 page size (i.e. 64KiB blocks on a i386 which only has 4KiB memory
 12 pages). By default a filesystem can contain 2^32 blocks; if the '64bit'
 13 feature is enabled, then a filesystem can have 2^64 blocks. The location
 14 of structures is stored in terms of the block number the structure lives
 15 in and not the absolute offset on disk.
 16 
 17 For 32-bit filesystems, limits are as follows:
 18 
 19 .. list-table::
 20    :widths: 1 1 1 1 1
 21    :header-rows: 1
 22 
 23    * - Item
 24      - 1KiB
 25      - 2KiB
 26      - 4KiB
 27      - 64KiB
 28    * - Blocks
 29      - 2^32
 30      - 2^32
 31      - 2^32
 32      - 2^32
 33    * - Inodes
 34      - 2^32
 35      - 2^32
 36      - 2^32
 37      - 2^32
 38    * - File System Size
 39      - 4TiB
 40      - 8TiB
 41      - 16TiB
 42      - 256TiB
 43    * - Blocks Per Block Group
 44      - 8,192
 45      - 16,384
 46      - 32,768
 47      - 524,288
 48    * - Inodes Per Block Group
 49      - 8,192
 50      - 16,384
 51      - 32,768
 52      - 524,288
 53    * - Block Group Size
 54      - 8MiB
 55      - 32MiB
 56      - 128MiB
 57      - 32GiB
 58    * - Blocks Per File, Extents
 59      - 2^32
 60      - 2^32
 61      - 2^32
 62      - 2^32
 63    * - Blocks Per File, Block Maps
 64      - 16,843,020
 65      - 134,480,396
 66      - 1,074,791,436
 67      - 4,398,314,962,956 (really 2^32 due to field size limitations)
 68    * - File Size, Extents
 69      - 4TiB
 70      - 8TiB
 71      - 16TiB
 72      - 256TiB
 73    * - File Size, Block Maps
 74      - 16GiB
 75      - 256GiB
 76      - 4TiB
 77      - 256TiB
 78 
 79 For 64-bit filesystems, limits are as follows:
 80 
 81 .. list-table::
 82    :widths: 1 1 1 1 1
 83    :header-rows: 1
 84 
 85    * - Item
 86      - 1KiB
 87      - 2KiB
 88      - 4KiB
 89      - 64KiB
 90    * - Blocks
 91      - 2^64
 92      - 2^64
 93      - 2^64
 94      - 2^64
 95    * - Inodes
 96      - 2^32
 97      - 2^32
 98      - 2^32
 99      - 2^32
100    * - File System Size
101      - 16ZiB
102      - 32ZiB
103      - 64ZiB
104      - 1YiB
105    * - Blocks Per Block Group
106      - 8,192
107      - 16,384
108      - 32,768
109      - 524,288
110    * - Inodes Per Block Group
111      - 8,192
112      - 16,384
113      - 32,768
114      - 524,288
115    * - Block Group Size
116      - 8MiB
117      - 32MiB
118      - 128MiB
119      - 32GiB
120    * - Blocks Per File, Extents
121      - 2^32
122      - 2^32
123      - 2^32
124      - 2^32
125    * - Blocks Per File, Block Maps
126      - 16,843,020
127      - 134,480,396
128      - 1,074,791,436
129      - 4,398,314,962,956 (really 2^32 due to field size limitations)
130    * - File Size, Extents
131      - 4TiB
132      - 8TiB
133      - 16TiB
134      - 256TiB
135    * - File Size, Block Maps
136      - 16GiB
137      - 256GiB
138      - 4TiB
139      - 256TiB
140 
141 Note: Files not using extents (i.e. files using block maps) must be
142 placed within the first 2^32 blocks of a filesystem. Files with extents
143 must be placed within the first 2^48 blocks of a filesystem. It's not
144 clear what happens with larger filesystems.

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php