Package: dosfstools
Version: 4.2-1.2
Severity: normal
File: /usr/sbin/fsck.fat
Tags: upstream
X-Debbugs-Cc: [email protected]

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.
#

-- System Information:
Debian Release: 13.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.57+deb13-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages dosfstools depends on:
ii  libc6  2.41-12

dosfstools recommends no packages.

dosfstools suggests no packages.

-- no debconf information

Reply via email to