blocks.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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.
  12. For 32-bit filesystems, limits are as follows:
  13. .. list-table::
  14. :widths: 1 1 1 1 1
  15. :header-rows: 1
  16. * - Item
  17. - 1KiB
  18. - 2KiB
  19. - 4KiB
  20. - 64KiB
  21. * - Blocks
  22. - 2^32
  23. - 2^32
  24. - 2^32
  25. - 2^32
  26. * - Inodes
  27. - 2^32
  28. - 2^32
  29. - 2^32
  30. - 2^32
  31. * - File System Size
  32. - 4TiB
  33. - 8TiB
  34. - 16TiB
  35. - 256PiB
  36. * - Blocks Per Block Group
  37. - 8,192
  38. - 16,384
  39. - 32,768
  40. - 524,288
  41. * - Inodes Per Block Group
  42. - 8,192
  43. - 16,384
  44. - 32,768
  45. - 524,288
  46. * - Block Group Size
  47. - 8MiB
  48. - 32MiB
  49. - 128MiB
  50. - 32GiB
  51. * - Blocks Per File, Extents
  52. - 2^32
  53. - 2^32
  54. - 2^32
  55. - 2^32
  56. * - Blocks Per File, Block Maps
  57. - 16,843,020
  58. - 134,480,396
  59. - 1,074,791,436
  60. - 4,398,314,962,956 (really 2^32 due to field size limitations)
  61. * - File Size, Extents
  62. - 4TiB
  63. - 8TiB
  64. - 16TiB
  65. - 256TiB
  66. * - File Size, Block Maps
  67. - 16GiB
  68. - 256GiB
  69. - 4TiB
  70. - 256TiB
  71. For 64-bit filesystems, limits are as follows:
  72. .. list-table::
  73. :widths: 1 1 1 1 1
  74. :header-rows: 1
  75. * - Item
  76. - 1KiB
  77. - 2KiB
  78. - 4KiB
  79. - 64KiB
  80. * - Blocks
  81. - 2^64
  82. - 2^64
  83. - 2^64
  84. - 2^64
  85. * - Inodes
  86. - 2^32
  87. - 2^32
  88. - 2^32
  89. - 2^32
  90. * - File System Size
  91. - 16ZiB
  92. - 32ZiB
  93. - 64ZiB
  94. - 1YiB
  95. * - Blocks Per Block Group
  96. - 8,192
  97. - 16,384
  98. - 32,768
  99. - 524,288
  100. * - Inodes Per Block Group
  101. - 8,192
  102. - 16,384
  103. - 32,768
  104. - 524,288
  105. * - Block Group Size
  106. - 8MiB
  107. - 32MiB
  108. - 128MiB
  109. - 32GiB
  110. * - Blocks Per File, Extents
  111. - 2^32
  112. - 2^32
  113. - 2^32
  114. - 2^32
  115. * - Blocks Per File, Block Maps
  116. - 16,843,020
  117. - 134,480,396
  118. - 1,074,791,436
  119. - 4,398,314,962,956 (really 2^32 due to field size limitations)
  120. * - File Size, Extents
  121. - 4TiB
  122. - 8TiB
  123. - 16TiB
  124. - 256TiB
  125. * - File Size, Block Maps
  126. - 16GiB
  127. - 256GiB
  128. - 4TiB
  129. - 256TiB
  130. Note: Files not using extents (i.e. files using block maps) must be
  131. placed within the first 2^32 blocks of a filesystem. Files with extents
  132. must be placed within the first 2^48 blocks of a filesystem. It's not
  133. clear what happens with larger filesystems.