mkfs.vfat exits zero on fatal warning
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dosfstools (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
1. $ lsb_release -rd
Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04
2. $ apt-cache policy dosfstools
dosfstools:
Installed: 3.0.28-2
Candidate: 3.0.28-2
Version table:
*** 3.0.28-2 500
500 http://
100 /var/lib/
3. mkfs.vfat should exit with non-zero value if it cannot create enough clusters on the target device. This is fatal to compliant FAT filesystem parsers since cluster count is the *only* way to determine the FAT type (12, 16, 32).
$ sudo mkfs.vfat -S 4096 -F 32 /dev/vda1; echo ?
sudo: unable to resolve host ubuntu
mkfs.fat 3.0.28 (2015-05-16)
WARNING: Not enough clusters for a 32 bit FAT!
1
4. $ sudo mkfs.vfat -S 4096 -F 32 /dev/vda1; echo $?
sudo: unable to resolve host ubuntu
mkfs.fat 3.0.28 (2015-05-16)
WARNING: Not enough clusters for a 32 bit FAT!
0
Tools calling mkfs.vfat expect the tool to return non-zero values when it encounters and error.
Making a FAT32 filesystem on a device that is not big enough means that FAT parsers will fail to
recognize the device. In particular, UEFI expects a FAT32 partition and will fail to read the boot partition
if it's not formatted properly (ie, not big enough for 65526 clusters[A]).
mkfs.vfat defaults to 8 sectors per cluster, for 4k disks, we set sector size to 4k, which means
for -F 32, we have 65526 clusters * 8 * 4096 wihich is just under 2G, meaning to avoid the warning/error
-F 32 requires either a lower sectors per cluster, or a larger target device.
A. https:/
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: dosfstools 3.0.28-2
ProcVersionSign
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Tue Apr 12 20:10:06 2016
Dependencies:
gcc-6-base 6-20160405-0ubuntu2
libc6 2.23-0ubuntu2
libgcc1 1:6-20160405-
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: dosfstools
UpgradeStatus: No upgrade log present (probably fresh install)
description: | updated |