mkdosfs rounds reserved sectors to cluster size

Bug #746262 reported by Michael Moller on 2011-03-31
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
dosfstools (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: dosfstools

Some embedded devices require a FAT file-system with one, and only one reserved sector.
Specifically this is documented at http://www.xilinx.com/support/answers/14456.htm

mkdosfs.c lines 1060 and 1061 contains
    /* Adjust the reserved number of sectors for alignment */
    reserved_sectors = align_object(reserved_sectors, bs.cluster_size);

This rounds the number of reserved sectors up to the cluster size, preventing the creation of only one reserved sector.
Removing these two lines fixes the problem and returns the default number of reserved sectors to 1 for FAT12/16 and 32 for FAT32.

Ubuntu 10.10
dosfstools:
  Installed: 3.0.9-1
  Candidate: 3.0.9-1
  Version table:
 *** 3.0.9-1 0
        500 http://za.archive.ubuntu.com/ubuntu/ maverick/main amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: dosfstools 3.0.9-1 [modified: sbin/mkdosfs]
ProcVersionSignature: Ubuntu 2.6.35-28.49-generic 2.6.35.11
Uname: Linux 2.6.35-28-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Thu Mar 31 09:17:27 2011
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_ZA.utf8
SourcePackage: dosfstools

Michael Moller (mmoller2k) wrote :
tags: added: patch
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dosfstools (Ubuntu):
status: New → Confirmed
Babaei (babaei) wrote :

Confirmed. I ran into the same problem for the same reason (preparing a CF for Xilinx SysACE).

I compiled the latest version of dosfstools (3.0.20) from source, and the reserved sector functionality worked properly.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers