[Bug 615873] Re: Doesn't allow forcing file systems to 255 heads

Pali 615873 at bugs.launchpad.net
Thu Feb 25 22:16:47 UTC 2021


Specifying custom number of heads and sectors per track is now possible
via new mkfs.fat's -g option available since dosfstools 4.2.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dosfstools in Ubuntu.
https://bugs.launchpad.net/bugs/615873

Title:
  Doesn't allow forcing file systems to 255 heads

Status in dosfstools package in Ubuntu:
  New

Bug description:
  Binary package hint: dosfstools

  Hi

  Very old OMAP3 (e.g. BeagleBoard) boot ROMs and the QEMU emulation
  thereof don't support anything else than 255 heads in the boot
  partition from which the first bootloader is read (x-loader / MLO).


  Apparently, using a mapper loop device (major 252 here) causes mkdosfs
  to select a different default (255 heads) than the default when
  writing to a plain file (63 heads).

  15:20 < lool> for files, it checks the size and defaults to 32 sectors and 64
                heads
  15:21 < lool> for unknown devices, it assumes hard disk and checks the
                geometry, but fails and so uses 63 sectors per track and 255 heads

  Running file -s on the loop-mounted device before and after the change results in:
  Current images:
  /dev/mapper/loop0p1: x86 boot sector, mkdosfs boot message display, code offset 0x58, OEM-ID " mkdosfs", Media descriptor 0xf8, heads 64, sectors 144522 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1112, serial number 0x4c5f659b, label: " "

  After mkdosfs on a loop device:
  /dev/mapper/loop0p1: x86 boot sector, mkdosfs boot message display, code offset 0x58, OEM-ID " mkdosfs", Media descriptor 0xf8, heads 255, sectors 144522 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 1112, serial number 0xcafca2f1, label: " "

  which clearly indicates the difference in number of heads.

  When creating the fs on the mapper device, I see:
  unable to get drive geometry, using default 255/63

  So I think there are some dosfstools issues here:
  a) I think dosfstools tries to be a bit too clever about what the size of the FS means, if the FS is on a loop device or in a regular file, and if the size is one of a standard floppy, dosfstools will assume the geometry of the corresponding floppy
  b) dosfstools fails to identify loop devices from the device mapper devices as loop devices
  c) dosfstools doesn't allow for any override in sectors/heads

  I'd personally rather see a) and b) go away by removing the tests
  altogether and just doing something clever when on real devices with a
  geometry (either a real floppy devices with a size which means
  something in this case, or a hard disk drive with a reported disk
  geometry; all other cases are guesses). But I guess it's too late to
  strip that away, as scripts and such might rely on this (well, perhaps
  nobody uses floppies anymore, but who knows).

  So there are two ways to fix this for Ubuntu OMAP(3) images, either by
  patching the dosfstools defaults, or by allowing overrides and passing
  these.

  Cheers,

  ProblemType: Bug
  DistroRelease: Ubuntu 10.10
  Package: dosfstools 3.0.9-1
  ProcVersionSignature: Ubuntu 2.6.35-14.20-generic 2.6.35
  Uname: Linux 2.6.35-14-generic x86_64
  Architecture: amd64
  Date: Tue Aug 10 15:59:50 2010
  ProcEnviron:
   LANGUAGE=fr_FR:fr:en_GB:en
   PATH=(custom, user)
   LANG=fr_FR.UTF-8
   SHELL=/bin/zsh
  SourcePackage: dosfstools

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dosfstools/+bug/615873/+subscriptions



More information about the foundations-bugs mailing list