mkdosfs incorrectly calculates sector total
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dosfstools (Ubuntu) |
Fix Released
|
High
|
Michael Casadevall | ||
Hardy |
Won't Fix
|
Undecided
|
Unassigned | ||
Lucid |
Won't Fix
|
Undecided
|
Unassigned | ||
Maverick |
Won't Fix
|
Undecided
|
Unassigned | ||
Natty |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: dosfstools
mkdosfs will incorrectly calculate the number of sectors of a given FAT partition if the number sectors are odd due to count_blocks incorrectly handling the remainder of a division operation. This miscalculation causes the OMAP4 bootloader to fail to boot.
This bug can be observed by comparing the total sector size in fdisk expert more to fsck.msdos; this discrepancy only shows up when the number of sectors are odd:
fdisk output:
Expert command (m for help): p
Disk /dev/sdb: 204 heads, 3 sectors, 12654 cylinders
Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 00 1 1 0 203 3 258 3 158505 83
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00
mcasadevall@
dosfsck 3.0.9 (31 Jan 2010)
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "mkdosfs"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
2048 bytes per cluster
4 reserved sectors
First FAT starts at byte 2048 (sector 4)
2 FATs, 16 bit entries
79872 bytes per FAT (= 156 sectors)
Root directory starts at byte 161792 (sector 316)
512 root directory entries
Data area starts at byte 178176 (sector 348)
39539 data clusters (80975872 bytes)
3 sectors/track, 204 heads
0 hidden sectors
158504 sectors total
Checking for unused clusters.
/dev/sdb1: 0 files, 0/39539 clusters
Compare the difference in sectors total. The attached patch correctly handles the remainder and causes the sector counts to match.
Related branches
Changed in dosfstools (Ubuntu): | |
importance: | Undecided → High |
assignee: | nobody → Michael Casadevall (mcasadevall) |
milestone: | none → oneiric-alpha-2 |
status: | New → Triaged |
This bug was fixed in the package dosfstools - 3.0.9-1ubuntu1
---------------
dosfstools (3.0.9-1ubuntu1) oneiric; urgency=high
* Added debian/ patches/ 01_fix_ sector_ count.patch (LP: #794043)
- Fix a bug where sector counts would be off-by-one due to a division
error. Required for OMAP3/4 bootROM to always be happy with a partition
-- Michael Casadevall <email address hidden> Tue, 07 Jun 2011 03:29:05 -0700