← Documents Documentation/filesystems/ext4/blocks.rst GitHub 원문 ↗

Linux 6.18.37 · Filesystems

Blocks

ext4 block size별 32·64-bit filesystem, block group와 file size 한계를 설명하는 전문 번역입니다.

Source pathDocumentation/filesystems/ext4/blocks.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

blocks.rst:1-144

ext4 block size는 1KiB~64KiB이고 보통 4KiB입니다. `64bit` feature는 filesystem block 수를 `2^32`에서 `2^64`로 늘리지만 inode 수, file당 block 수와 block map·extent 배치 field의 한계는 별도로 남습니다.

ext4 크기 한계 결정 요소
mkfs에서 block size 선택32bit 또는 64bit filesystem block number 결정extent 또는 legacy block map mapping 선택inode·file field size와 placement 제약 적용

주소 폭과 data mapping 방식이 결합해 실제 상한을 만듭니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
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.
145

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

block 단위와 32-bit filesystem 한계

1-78

ext4는 storage space를 block 단위로 할당합니다. block은 1KiB~64KiB 크기의 sector 묶음이고 sector 수는 2의 정수 거듭제곱이어야 합니다. block은 다시 더 큰 block group으로 묶입니다.

block size는 `mkfs` 때 정하며 보통 4KiB입니다. block size가 page size보다 크면 mount 문제가 생길 수 있습니다. 예를 들어 4KiB memory page만 있는 i386에서 64KiB block을 쓰는 경우입니다.

기본 filesystem은 `2^32` block을 가질 수 있고 `64bit` feature를 켜면 `2^64` block까지 표현합니다. structure 위치는 disk의 absolute offset이 아니라 structure가 들어 있는 block number로 저장합니다.

32-bit filesystem에서 block과 inode 수는 block size와 관계없이 각각 `2^32`입니다. filesystem size는 1KiB에서 4TiB, 2KiB에서 8TiB, 4KiB에서 16TiB, 64KiB에서 256TiB입니다.

block group당 block 및 inode 수는 1KiB에서 8,192, 2KiB에서 16,384, 4KiB에서 32,768, 64KiB에서 524,288입니다. group 크기는 각각 8MiB, 32MiB, 128MiB, 32GiB입니다.

extent를 쓰는 file의 block 수는 모든 block size에서 `2^32`입니다. block map 방식은 1KiB 16,843,020개, 2KiB 134,480,396개, 4KiB 1,074,791,436개, 64KiB 4,398,314,962,956개지만 마지막 값은 field size 때문에 실제로 `2^32`입니다.

extent file size는 1KiB 4TiB, 2KiB 8TiB, 4KiB 16TiB, 64KiB 256TiB입니다. block map file size는 각각 16GiB, 256GiB, 4TiB, 256TiB입니다.

32-bit ext4 한계
Item1KiB2KiB4KiB64KiB
Blocks`2^32``2^32``2^32``2^32`
Inodes`2^32``2^32``2^32``2^32`
File System Size4TiB8TiB16TiB256TiB
Blocks Per Group8,19216,38432,768524,288
Inodes Per Group8,19216,38432,768524,288
Block Group Size8MiB32MiB128MiB32GiB
Blocks/File, Extents`2^32``2^32``2^32``2^32`
Blocks/File, Block Maps16,843,020134,480,3961,074,791,4364,398,314,962,956 (`2^32` 실제 한계)
File Size, Extents4TiB8TiB16TiB256TiB
File Size, Block Maps16GiB256GiB4TiB256TiB

원문의 모든 block size 열과 주요 행을 보존합니다.

.. SPDX-License-Identifier: GPL-2.0

Blocks
------

ext4 allocates storage space in units of “blocks”. A block is a group of
sectors between 1KiB and 64KiB, and the number of sectors must be an
integral power of 2. Blocks are in turn grouped into larger units called
block groups. Block size is specified at mkfs time and typically is
4KiB. You may experience mounting problems if block size is greater than
page size (i.e. 64KiB blocks on a i386 which only has 4KiB memory
pages). By default a filesystem can contain 2^32 blocks; if the '64bit'
feature is enabled, then a filesystem can have 2^64 blocks. The location
of structures is stored in terms of the block number the structure lives
in and not the absolute offset on disk.

For 32-bit filesystems, limits are as follows:

.. list-table::
   :widths: 1 1 1 1 1
   :header-rows: 1

   * - Item
     - 1KiB
     - 2KiB
     - 4KiB
     - 64KiB
   * - Blocks
     - 2^32
     - 2^32
     - 2^32
     - 2^32
   * - Inodes
     - 2^32
     - 2^32
     - 2^32
     - 2^32
   * - File System Size
     - 4TiB
     - 8TiB
     - 16TiB
     - 256TiB
   * - Blocks Per Block Group
     - 8,192
     - 16,384
     - 32,768
     - 524,288
   * - Inodes Per Block Group
     - 8,192
     - 16,384
     - 32,768
     - 524,288
   * - Block Group Size
     - 8MiB
     - 32MiB
     - 128MiB
     - 32GiB
   * - Blocks Per File, Extents
     - 2^32
     - 2^32
     - 2^32
     - 2^32
   * - Blocks Per File, Block Maps
     - 16,843,020
     - 134,480,396
     - 1,074,791,436
     - 4,398,314,962,956 (really 2^32 due to field size limitations)
   * - File Size, Extents
     - 4TiB
     - 8TiB
     - 16TiB
     - 256TiB
   * - File Size, Block Maps
     - 16GiB
     - 256GiB
     - 4TiB
     - 256TiB

64-bit filesystem 한계와 위치 제약

79-144

64-bit filesystem은 모든 block size에서 `2^64` block을 표현하지만 inode 수는 여전히 `2^32`입니다. filesystem size는 1KiB 16ZiB, 2KiB 32ZiB, 4KiB 64ZiB, 64KiB 1YiB입니다.

block group당 block·inode 수와 group size는 32-bit 표와 같습니다. 각각 8,192·16,384·32,768·524,288개이며 group size는 8MiB·32MiB·128MiB·32GiB입니다.

file당 extent와 block map 수치 및 file size 한계도 32-bit 표와 같습니다. extent는 `2^32` block과 4TiB·8TiB·16TiB·256TiB를, block map은 16,843,020·134,480,396·1,074,791,436·4,398,314,962,956 block과 16GiB·256GiB·4TiB·256TiB를 나타냅니다.

extent를 사용하지 않고 block map을 쓰는 file은 filesystem의 첫 `2^32` block 안에 있어야 합니다. extent file은 첫 `2^48` block 안에 있어야 합니다. 문서는 이보다 큰 filesystem에서 어떤 일이 일어나는지는 명확하지 않다고 밝힙니다.

64-bit ext4 한계
Item1KiB2KiB4KiB64KiB
Blocks`2^64``2^64``2^64``2^64`
Inodes`2^32``2^32``2^32``2^32`
File System Size16ZiB32ZiB64ZiB1YiB
Block Group Size8MiB32MiB128MiB32GiB
Blocks/File, Extents`2^32``2^32``2^32``2^32`
File Size, Extents4TiB8TiB16TiB256TiB
File Size, Block Maps16GiB256GiB4TiB256TiB
배치 제약block map: first `2^32` blocksextent: first `2^48` blocks--

64bit feature가 filesystem block 주소 폭을 늘리지만 file 및 inode field 한계는 남습니다.

For 64-bit filesystems, limits are as follows:

.. list-table::
   :widths: 1 1 1 1 1
   :header-rows: 1

   * - Item
     - 1KiB
     - 2KiB
     - 4KiB
     - 64KiB
   * - Blocks
     - 2^64
     - 2^64
     - 2^64
     - 2^64
   * - Inodes
     - 2^32
     - 2^32
     - 2^32
     - 2^32
   * - File System Size
     - 16ZiB
     - 32ZiB
     - 64ZiB
     - 1YiB
   * - Blocks Per Block Group
     - 8,192
     - 16,384
     - 32,768
     - 524,288
   * - Inodes Per Block Group
     - 8,192
     - 16,384
     - 32,768
     - 524,288
   * - Block Group Size
     - 8MiB
     - 32MiB
     - 128MiB
     - 32GiB
   * - Blocks Per File, Extents
     - 2^32
     - 2^32
     - 2^32
     - 2^32
   * - Blocks Per File, Block Maps
     - 16,843,020
     - 134,480,396
     - 1,074,791,436
     - 4,398,314,962,956 (really 2^32 due to field size limitations)
   * - File Size, Extents
     - 4TiB
     - 8TiB
     - 16TiB
     - 256TiB
   * - File Size, Block Maps
     - 16GiB
     - 256GiB
     - 4TiB
     - 256TiB

Note: Files not using extents (i.e. files using block maps) must be
placed within the first 2^32 blocks of a filesystem. Files with extents
must be placed within the first 2^48 blocks of a filesystem. It's not
clear what happens with larger filesystems.