Describe in detail what you guys think happens on an SD card when you format it. To keep this simple, formatting in the drone.
Similarly, what you believe happens on the SD card when you delete a file.
The phrase, "partial file deletions" is what prompted me to ask.
It’s simple. Formatting just replaces the directory & allocation table with an empty/fresh one, assuming the formatting is “quick” and for fat32, exfat, or f2fs.
The issue isn’t with “partial file deletion” and the issue is also not about the contiguosity of actual block of data, as the SD’s storage controller handles that, and this is where R/W speed is optimized for a particular speed.
An SD card optimized for high speed with large media files is going to have poorer performance for small files. But all of that is “behind the scenes” and out of our control.
The issue is with what is in our control, which is the file allocation table (FAT) and the file system itself, I.e. directory structure.
When we format an SD, all we are doing in most cases is replacing the FAT and file system directory (FAT/fs) with fresh empty ones.
If instead of formatting, we delete some files, we end up with free space in the FAT/fs of various sizes. Subsequent writes and or deletes of files causes the directory to become non-contiguous, and as the directory is itself a file, small bits of it must be added in small increments to map the files in the directory to the FAT etc.
Earlier I pointed out that SD cards that are optimized for large media files suffer with very small file performance. A directory, being a file, will incur speed penalties when it is chopped up and scattered into little chunks (the manner being determined by the OS/file system).
Best performance is a directory that is contiguous and being written to by appending the end. Performance suffers however when the directory itself is no longer contiguous, and write times are increased.
An intelligently designed streaming media recording system will increase compression to reduce data rates when the recording media is not keeping up. Increased compression results in lower quality.
For this reason, best practice is to format instead of delete, and get a fresh clean FAT/fs every time.