Как указать размер кластера при создании файловой системы?

Всем здравствуйте! При создании файловой системы например в виндовс fat32 можно указать размер кластера при форматировании. Например 4кб. Как это сделать в linux? Может есть какой-то параметр в mkfs? В gparted таких настроек не нашел.
Например в файловой системе ext4, btrfs, xfs, f2fs и т.д.
  • Вопрос задан
  • 1231 просмотр
Пригласить эксперта
Ответы на вопрос 2
Zettabyte
@Zettabyte
Проф. восстановление данных ▪ Вопрос? См. профиль
Может есть какой-то параметр в mkfs?

man mkfs.ext4:
OPTIONS
       -b block-size
              Specify  the  size  of blocks in bytes.  Valid block-size values
              are 1024, 2048 and 4096 bytes per block.  If omitted, block-size
              is  heuristically  determined  by  the  filesystem  size and the
              expected usage of the filesystem (see the -T option).  If block-
              size  is preceded by a negative sign ('-'), then mke2fs will use
              heuristics to determine the appropriate  block  size,  with  the
              constraint  that  the  block  size  will  be at least block-size
              bytes.  This  is  useful  for  certain  hardware  devices  which
              require that the blocksize be a multiple of 2k.

-C cluster-size Specify the size of cluster in bytes for filesystems using the bigalloc feature. Valid cluster-size values are from 2048 to 256M bytes per cluster. This can only be specified if the bigalloc feature is enabled. (See the ext4 (5) man page for more details about bigalloc.) The default cluster size if bigalloc is enabled is 16 times the block size.

Соответственно, вам также потребуется что-то в духе -O bigalloc

Но я бы очень рекомендовал сначала всё попробовать на тестовой машине, без важных данных, т.к. я встречал жалобы на проблемы с монтированием ФС после подобных операций, как минимум, на ext.
Ответ написан
vasilyevmn
@vasilyevmn
DevOps
man mkfs.ext4

-C cluster-size
Specify the size of cluster in bytes for filesystems using the bigalloc feature. Valid cluster-size values are from 2048 to 256M bytes per cluster. This can only be specified if the bigalloc feature is enabled. (See the ext4 (5) man page for more details about bigalloc.) The default cluster size if bigalloc is enabled is 16 times the block size.


-b block-size
Specify the size of blocks in bytes. Valid block-size values are 1024, 2048 and 4096 bytes per block. If omitted, block-size is heuristically determined by the filesystem size and the expected usage of the filesystem (see the -T option). If block-size is preceded by a negative sign ('-'), then mke2fs will use heuristics to determine the appropriate block size, with the constraint that the block size will be at least block-size bytes. This is useful for certain hardware devices which require that the blocksize be a multiple of 2k.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы