Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate max FAT32 file to 0 #208

Open
AHalvar opened this issue Mar 8, 2024 · 0 comments
Open

Truncate max FAT32 file to 0 #208

AHalvar opened this issue Mar 8, 2024 · 0 comments

Comments

@AHalvar
Copy link

AHalvar commented Mar 8, 2024

Steps to reproduce:

  • Running on RHEL 9.3 fsck from util-linux 2.37.4 which includes version 4.2. (built 2021-01-31)
  • Plug in an off-the-shelf USB thumb drive into the RHEL computer
  • Create a file on the thumb drive with the maximum allowed file size for a FAT32 file system, (4GiB - 1 byte) = 4294967295 bytes
  • sync the file and file system
  • Run: fsck -a -v file_on_usb

Expected:
fsck completes successfully without changing the file

Actually:
The file is truncated to 0 bytes.
fsck outputs:

...
file_on_usb
  File size is 4294967295 bytes, cluster chain length is 0 bytes.
  Truncating file to 0 bytes.
Reclaiming unconnected clusters.
Checking free cluster summary.

*** Filesystem was changed***

Workaround:
Create a file with more margin, e.g. 4GiB - 512 KiB. This passes the fsck check.
See also https://groups.google.com/g/linux.debian.bugs.dist/c/bocRgz6fCGU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant