U
U
undatyxa2019-10-09 01:40:35
FAT
undatyxa, 2019-10-09 01:40:35

How does FAT32 look for a free cluster for a new file?

It is obvious that the recording is made in clusters that are marked free in the FAT.
But the following situation is incomprehensible: if two clusters are free at the beginning of the FAT, and the file occupies ten, will these initial clusters be written to first?
Is there any documentation on how this works?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-10-09
@sxq

I think that the documentation is unlikely to be found, tk. and the format is old, used by many, so there won't be a single solution. In the simplest version, yes, it will fill as you say, in the advanced one, probably not, in order to avoid fragmentation, of course, up to a certain limit.

R
Radjah, 2019-10-09
@Radjah

Usually, the FS driver uses the bitmap to look for a piece of contiguous free space so that the entire file fits in it.
You can try to dig here, for example. https://github.com/torvalds/linux/tree/master/fs/fat

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question