blocks.rst 3.0 KB

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