Какой размер распределительного блока мне нужно выбрать для моей SDHC-карты?

49398
TomLawson

Я форматирую карту SDHC 4 ГБ, прежде чем ставить на нее операционную систему для моего Raspberry Pi.

Он говорит «размер единицы выделения» 32 КБ и дает мне варианты до 1024 МБ.

Что мне с этим делать?

8

3 ответа на вопрос

2
Synetech

You need to select a cluster size. The data is not read at the byte level, but rather in blocks. Generally, the smallest unit of storage is a sector (traditionally 512 bytes, 4096 bytes for Advanced Format drives), but even that is not how files are stored in file-systems, but rather sectors are grouped together into clusters.

Raspberry Pi itself doesn’t really have a restriction on cluster size, but the operating system you use may. Usually, any standard size will work, but typically, it depends on what kind of files you will be storing on it.

If you are going to be storing lots of tiny files, then select the smallest cluster size possible (one sector; 512 for memory cards). This way you avoid wasting space by having lots of partially unused clusters. If you are going to be storing lots of giant files, then use the largest clusters size possible (usually 64KB; I’ve never seen 1MB clusters :-o). That way you minimize the file-system’s file-management overhead which frees up a little more space for storage.

When not sure, just use 4KB clusters; that works for most general-purpose usage which is why it is usually the default.

1
Peter Chubb

For an sdhc card, it's wise to choose a size that matches and is aligned with the size used by the controller on the sd card. You'll get much better performance out of a card where the filesystem is aligned on an erase block boundary, and does it's I.O in internal segment sized units.

The size needed varies from card to card. You can use flashbench to work out what the allocation unit and erase size are.

1
olee22

У меня были трудности с поиском подходящего размера кластера, чтобы карта работала в телефоне (Samsung S7 Edge, Samsung Evo 128 ГБ). Для меня, наконец, сработало форматирование SD-карты с использованием USB Flash SD Formatter 4.00 с настройками размера кластера по умолчанию. Это доступно на SDCard.org, здесь https://www.sdcard.org/downloads/formatter_4/