#1122123 /usr/sbin/fsck.fat: fsck: can't recover filesystem from backup boot sector

Package:
dosfstools
Source:
dosfstools
Description:
utilities for making and checking MS-DOS FAT filesystems
Submitter:
Joshua
Date:
2025-12-07 16:23:03 UTC
Severity:
normal
Tags:
#1122123#5
Date:
2025-12-07 16:21:12 UTC
From:
To:
Dear Maintainer,

fsck.fat can't recover the boot sector from backup boot sectors.

If the number of reserved sectors is > 1, a backup boot sector could exist
between the boot sector and the first FAT sector. However you don't know
the number of reserved sectors yet. This problem has a simple solution. In the
worst case of 32K logical sector size, the backup boot sector will still be
within the first 129 512 byte sectors.

I have prepared a test full disk image.

https://github.com/joshudson/dossuperfloppy/raw/refs/heads/master/scantests/recoverbootsect.img.bz2

Demonstration:

# bzip2 -d < recoverbootsect.img.bz2 > /tmp/fat.img
# losetup -o $((6 * 512)) /tmp/fat.img /dev/loop0
# dosfsck /dev/loop0
fsck.fat 4.2 (2021-01-31)
Logical sector size is zero.
#