On Tue, 22 Mar 2016 21:01, Andrei Borzenkov
22.03.2016 22:38, Greg Freemyer пишет:
The one I best understand is ntfsfallocate.
Basically the issue is NTFS-3G provides a non-backward compatible feature.
With fallocate in general you can allocate large files that you can latter fill in. Often done for the virtual disk in a VM as an example. In a matter of seconds you can allocate data blocks for a 100GB file. By doing it that way you reduce fragmentation, and also only take a relatively short period of time to create the file. (Who wants to wait minutes for a 100GB file to be zero-filled).
ntfsfallocate allows that same behavior with the NTFS filesystem. The NTFS-3G driver in turn understands what is going on and can work with the file as data is later written to the allocated blocks.
Windows on the other hand does not understand the data structure layout created by ntfsfallocate, and thus it can cause a problem.
I wonder - NTFS supports sparse files; what ntfsfallocate does that cannot be mapped to it?
It's a matter of versions. When "NTFS-Sparse" was introduced in NT5 / Windows 2000 for MS-SQL databases. From then, and during the time of Windows XP / Windows 2003 it had a different behavior than it has since Windows 8.1 / Windows 10. (I have no data for Vista and Win7). A NTFS-Sparse file has a special attribute set [1], and can not be converted into a "normal" file until all holes are filled / the file completly written at least once. [code from MS Windows] fsutil sparse setflag <filename> [/code] [1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa364596(v=vs.85).as... [2] http://msdn.microsoft.com/de-de/library/cc755441.aspx [3] http://msdn.microsoft.com/de-de/library/ms175823.aspx So, the danger immanent is: on what Windows version will the filesystem used next? How will that Version handle sparse files? It's not a matter of (support) yes or no, or even language (ntfs), but a matter of dialect (Windows version). Windows 10 handles things on NTFS misbehavior much more graceful than Windows 7 for example. And before Vista is another kettle of fish. google hint: "NTFS-Sparse" - Yamaban.