Wrong free space reported when using sparse settings

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Kayot
Junior Member
Junior Member
Posts: 4
Joined: 2011-01-20, 15:45 UTC

Wrong free space reported when using sparse settings

Post by *Kayot »

Wrong free space reported when using sparse settings.

TC reports the free space on the drive before taking sparse files into account. I have a drive with a ton of sparse files on it, where file properties shows that the file is much smaller on disk than in the file system. TC however reports the free space as if the files were not sparsed.

TC also seems to report disk based compressed files as being full size in the free space count. Still testing this one.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Does Windows Explorer report correct size? (in drive properties)
Kayot
Junior Member
Junior Member
Posts: 4
Joined: 2011-01-20, 15:45 UTC

Post by *Kayot »

Yes, that's what I'm comparing it too. I have a difference of 14GB from what TC is telling me to what the properties dialog says. When I clear away all the compressed and sparsed files it becomes close to even.

I did have 300GB of files that when parsed were 200GB but I've moved them to a backup drive since last night.

Here's a comparison chart set:
Can't post link... Sorry...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Total Commander uses GetDiskFreeSpaceEx, see:
http://msdn.microsoft.com/en-us/library/aa364937%28v=vs.85%29.aspx

There are two values for free space:
1. Free space available to the user, may be limited by quota
2. The total number of free bytes on a disk.

Total Commander displays the first value because it's the relevant one when copying to a disk.

Maybe you just calculate differently? Is one value shown in bytes and one in Gigabytes? You have to use a factor of 1024 instead of 1000 in both TC and Explorer:
1k = 1024b
1M = 1024k
1G = 1024M
I'm not talking about ISO standards here, just what TC and Explorer display.
Author of Total Commander
https://www.ghisler.com
blind12
Junior Member
Junior Member
Posts: 20
Joined: 2004-04-22, 17:06 UTC

Post by *blind12 »

Version 7.50 ignores sparse properties and reports incorrect inflated size for disk space occupied. With sparse files it can easily be 10 GB instead of 10 MB. Compressed files' disk space is reported correctly. Is 7.56 different in any way?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, sparse files aren't currently supported. I tried to set the sparse attribute before or after copying, but it had no effect. Also CopyFileEx doesn't seem to support sparse files either.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

ghisler(Author) wrote:I tried to set the sparse attribute before or after copying, but it had no effect.
Sparse attribute itself does not cause zero-filled areas to not be written. It just flags the possibility of doing so, but for actual excluding zero-filled areas you neet to explicitly call DeviceIOControl(FSCTL_SET_ZERO_DATA) on the target file.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Easiest way to copy sparse files - to create empty file, set attribute and size, and then copy only thoose blocks that contain data (by enumerating them).
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

MVV
Did you check it? Will setting size on a sparse file really make it zero-filled, and not just allocate disk space with all garbage it contains, like for usual files?
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
blind12
Junior Member
Junior Member
Posts: 20
Joined: 2004-04-22, 17:06 UTC

Post by *blind12 »

Far manager forum has this example:

fsutil file createnew test.dat 1000000000
fsutil sparse setflag test.dat
fsutil sparse setrange test.dat 0 1000000000
Post Reply