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