Bug 243178 - newfs_msdos: wrong FAT type determination
Summary: newfs_msdos: wrong FAT type determination
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2020-01-08 08:40 UTC by Xin LI
Modified: 2020-08-28 13:13 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Xin LI freebsd_committer 2020-01-08 08:40:06 UTC
Creating a bug so this is not lost.

The automatic FAT type determination is broken.

Reproduction case:

$ truncate -s 2147483648 test
$ newfs_msdos ./test
newfs_msdos: warning, ./test is not a character device
newfs_msdos: 65519 clusters too few clusters for FAT32, need 65525
Comment 1 Neel Chauhan freebsd_committer 2020-08-28 13:13:05 UTC
I believe the issue is the cluster detection mechanism (Line 334 to 351).

For instance, this works:

newfs_msdos -c 128 ./test
Comment 2 Neel Chauhan freebsd_committer 2020-08-28 13:13:44 UTC
The lines are in sbin/newfs_msdos/mkfs_msdos.c