On Tue, Aug 20, 2013 at 09:55:08PM +0200, Jean-Pierre André wrote: [snip]
> >Thanks. I applied the patch and it works as expected. Regarding writing > >the 4K bytes before calling the truncate, I'm guess this is the cluster > >size correct? If I formatted with cluster size 65K, then I will have to > >write 65K before truncating. > > No, the aim is to force the data to not be stored > in the base MFT record, by writing more than a > MFT record can hold. A MFT record generally is > a full sector, with a minimum of 1K, so writing 4K > is enough for 512-byte and 4K-byte sector disks. > OK, understood. > > Are you writing to the allocated space sequentially > or at random locations ? With NTFS, if you want to > write to an allocated space at a random place, you > will force the unwritten space up to the write location > to be zeroed. Example : > 1) Allocate 4GB : the file size is still zero, and reading > at any location from the file returns zeroes. > 2) Write 4K from the beginning : the file size is now > 4K and 4K bytes can be read. > 3) Write a few bytes near the end : nearly 4GB has > to be zeroed. > (Note : I have not checked how Windows behaves in > such conditions) > > For writing to random locations, a sparse file is > probably better. Thanks for the info. That's good to know. Currently, the application just writes sequentially to the file. I also just noticed that if the filesystem is mounted and I run the ntfsfallocate test program (with --force), the file is successfully alloced. However, the free space is not updated. The fs needs to be unmounted/mounted again. Is there a way around this that you are aware of? > > Regards > > Jean-Pierre > > Thanks again for your help. Amit ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ ntfs-3g-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
