Jump to content

Strange difference, can it be explained?


HarryTri

Recommended Posts

The results of chkdsk C: on my Windows 8 laptop:

Quote

  62914559 KB total disk space.
  30622664 KB in 165872 files.
    120772 KB in 40086 indexes.
         0 KB in bad sectors.
    402555 KB in use by the system.
     65536 KB occupied by the log file.
  31768568 KB available on disk.

      4096 bytes in each allocation unit.
  15728639 total allocation units on disk.
   7942142 allocation units available on disk.

And the results of C:\>dir/a/s from the same elevated command prompt (only the System Volume Information must be inaccessible):

Quote

205773 File(s) 37.430.685.285 bytes
121466 Dir(s)  32.705.159.168 bytes free

The directories are about the same (each directory has the . and .. subdirectories in the dir list) but there is a difference of 39901 files and 5,32 GB of total disk space (65,32 GB in the dir results minus 60 GB - which is the actual size of the partition - in the chkdsk results). Running 7-zip File Manager as Administrator gives results that agree with these of the dir ones in terms of the files' number and the allocated disk space. Yet both chkdsk and dir report about the same free disk space (31938632 KB in dir)! Is there a possible explanation for it?:crazy: How much is in reality the allocated and the free disk space?:unsure:

To prevent any misunderstanding I use the KB with the meaning of KiB and so on.

Edited by HarryTri
Link to comment
Share on other sites


Thanks for the response Tripedacus but no, dir/a/s and 7-zip show all these files. Can somebody check on his system (Windows 8 or newer) to see if he has similar results? Perhaps Microsoft uses some kind of trick to present fewer files and allocated disk space in the Windows partition (the other partitions give normal results as I have found)?

Link to comment
Share on other sites

Boot from a live Porteus CD and find out what it sees. Windows cannot hide things when offline, and Porteus couldn't care less about NTFS attributes even if it tried hard. Then let us know what did you find out. Good luck! :yes:

Link to comment
Share on other sites

Hardlinks are not accessible even from an elevated command prompt:

Quote

C:\>cd "Documents and Settings"

C:\Documents and Settings>dir/a/s
 Volume in drive C is System
 Volume Serial Number is 5AAC-6C5E
File Not Found

Symlinks? Are they different than hardlinks?:unsure:

As for sparse files this is a possibility but 5.32 GB? Note that huge possibly sparse files like pagefile.sys add their size to the allocated disk space shown in Windows Explorer: if they grow (you know when:blink:) it grows too. And what about the 39901 more files in dir/a/s?

Edited by HarryTri
Link to comment
Share on other sites

Sure symlinks are different from hardlinks, and possibly they are counted differently by different tools.

And of course a single sparse file can account for as large as you make it.

Just in case:
http://superuser.com/questions/823959/how-to-view-all-the-symbolic-links-junction-points-hard-links-in-a-folder-using

You can use a forfiles or for similar loop with fsutil to find sparse files (if any).

jaclaz

 

Edited by jaclaz
Link to comment
Share on other sites

It seems that symlinks/junction points are what I referred to as "hardlinks".

Hardlinks seem to be the real answer to the mystery. On a site I red some time ago that all the system files of Windows 8 are hardlinks from WinSxS and I didn't believe it. It seems that the guy was right:

Quote

C:\windows\system32>fsutil hardlink list aaclient.dll
\Windows\System32\aaclient.dll
\Windows\WinSxS\amd64_microsoft-windows-t..s-clientactivexcore_31bf3856ad364e35_
6.2.9200.17434_none_88eda9db4f43f787\aaclient.dll

Thanks for the help jaclaz, you are great!:thumbup

Edited by HarryTri
Link to comment
Share on other sites

Well, just for the record and for your interest (and in case you are wanting to experiment) junctions and hardlinks are available since NTFS was invented and also symlinks are available since XP[1], only  - wisely ;) - they weren't used or weren't used so extensively in the base OS install.

In the case of a hardlink you cannot really say "which one is the original" as the whole point of the hardlink idea is that only one original exists, with more than one pointers to it.

So are the files in the system direectory hardlinks to files in WinSXS or is it the other way round?

Chicken and egg problem. :ph34r:

As a side note, ever wondered why you cannot install Vista (let alone 7) on FAT32 normally?

Here:
http://reboot.pro/topic/19643-winsxs-hardlinked-files/

once again it is the stupid WinSXS mechanism, a "solution" for DLL Hell that actually creates more problems :whistle:

jaclaz


 

[1] You will find n sources telling you that symlinks were introduced with Vista (which is false, they were introduced in NTFS in XP times, only the good MS guys didn't provide a suitable driver), the truth is here:
http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html#symboliclinksforwindowsxp

more generally the page is a very interesting resource:

http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html
 

Link to comment
Share on other sites

After a check on my system I found the known junctions referenced (Documents and Settings etc.) but no symlinks or symlinked directories. It seems that the later were used in older versions of Windows. Just for the history. And of course thanks again for the information jaclaz.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...