Filed under Computers, Programming, Software
One common complaint about the winsxs folder is that it takes up too much space.
My winsxs takes up almost 9 GB!
Or does it?
According to this post by Microsoft, WinSxS has many duplicated files. The files are are *not* copies, but are instead “hard links” that point to the same data, and thus do not take up any extra space. Microsoft says a typical WinSxS folder contains around 400 MB of data.
The problem is that DIR and Explorer are not aware of the difference between an actual file and a hard link to a file. The disk usage reported by these two programs is as if each hard link *is* an actual file.
I did my own test to verify Microsoft’s claim. I created a small file called “original.txt” that uses 10 bytes. Then I created 10 hard links to the original file via the command line:
mklink /h hardlink<NUM>.txt original.txt
As expected, both DIR and explorer report that I’m using 110 bytes instead of just the 10 bytes of the original file:
I created symbolic links using this command line:
mklink symboliclink<NUM>.txt original.txt
Here are the results of DIR:
Notice that only the original file reports any disk usage. The total directory size is only the original file, even though 11 files are detected. Also note that all the symbolic links are listed as “<SYMLINK>” and have a reference to the source of the symbolic link in ’s.
Here is what explorer looks like with symbolic links:
Explorer does the right thing and lists that the directory only contains 10 bytes. The symbolic links have “shortcut” indictors on top of the source icon. The file size for symbolic links are listed as 0 KB.