-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to reliably write contiguous file to exFAT? #381
Comments
@snhirsch |
I haven't tried that, but it's unclear why it would help. In either situation (quick vs. complete), the directory and allocation tables are totally initialized and sequential writes should end up contiguous. Since my first post I have had great luck with Windows file explorer. Linux seems completely incapable of writing a contiguous file. |
You could check with a defrag tool to visualize if the files are fragmented. |
After some experimentation it appears that Windows File Explorer does reliably produce contiguous exFAT files. Linux simply cannot, so something to keep in mind. 'Defraggler' from the CC Cleaner folks does report on file layout but as you pointed out the repair process probably shouldn't be run on an SSD. |
@snhirsch UltraDefrag, which is free, can display fragmentation info, as well as defrag the file, if necessary. It's primarily Windows software, see https://sourceforge.net/projects/ultradefrag/ That said, there's a command-line port of it to Linux. |
I think you may have been running up against a known (and fixed) bug under Linux, but without knowing the exact version of the distribution and kernel versions you were using when you experienced the issue, we'll never know for certain. Thank you for the update. |
FWIW, I'm using Ubuntu 18.04 with kernel 4.15.0-221. The link for the linux command line build is broken, so that is no longer available. |
Maybe this helps on linux: |
Interesting read, but no indication that anything was ever fixed. |
Seems so, but maybe you try that |
I had an extensive discussion about this in Aug 2024 with @aperezbios. In that discussion, he said:
See #277 for some detail but I never had great luck with the "truncate" program either. Alex then later came back with:
-- Hey Alex, Per that exfat-fuse URL you provided, I started looking around and strangely enough, Ubuntu 20.04 has BOTH the FUSE exfat but also the native in-kernel exfat.#The OS does have the fuse drivers installed by default: $ dpkg -l | grep exfat
|
Ultimately, the only method I found to create a non-fragmented file was using Windows. Yuk. |
The stuff I linked suggest the -x to make it work which is
For posix_fallocate see: |
Title says it. I have searched Google extensively and cannot find a mention of how this might be done. Even when the SD card is 90% free the firmware complains that a newly added image is not contiguous. I've tried cp, dd and Midnight Commander file copy under Linux and File Explorer in Windows 10. Just seems to be hit or miss. Worse yet, I cannot find a Windows or Linux tool that shows whether the file is contiguous, so I have to waste the time transferring the card to the ZuluSCSI RP2040 to find out. Any advice would be appreciated!
The text was updated successfully, but these errors were encountered: