Skip to content

Commit

Permalink
mkfs: Default to 64/32 heads/sectors for targets smaller than 512 MB
Browse files Browse the repository at this point in the history
This may put defaults in certain use cases a little bit more in line
with the old defaults in versions up to 3.0.28. It has mostly aesthetic
value in most cases.

Signed-off-by: Andreas Bombe <aeb@debian.org>
  • Loading branch information
andreasbombe committed May 11, 2016
1 parent 786e66e commit 1e76e57
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/mkfs.fat.c
Expand Up @@ -519,6 +519,16 @@ static void establish_params(struct device_info *info)
unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
int def_root_dir_entries = 512;

if (info->size < 512 * 1024 * 1024) {
/*
* These values are more or less meaningless, but we can at least
* use less extreme values for smaller filesystems where the large
* dummy values signifying LBA only access are not needed.
*/
sec_per_track = 32;
heads = 64;
}

if (info->type != TYPE_FIXED) {
/* enter default parameters for floppy disks if the size matches */
switch (info->size / 1024) {
Expand Down

0 comments on commit 1e76e57

Please sign in to comment.