Win7 the secrets of the operating system folder

Source: Internet
Author: User
Tags winsxs folder

If you install the most popular Microsoft Windows 7 operating system, you will feel the Microsoft Windows 7 operating system under the WinSxS folder is very scary, some people are loaded X said Windows 7 operating system occupies space, this article for you.





about the recent new Microsoft security, which stabilizes the alleged operating system





we know the quickest way to view a directory is to look at the properties of the Explorer folder, but what I'm going to say today is: If you look at the directory of Windows Vista/windows 7 system In this way, you'll be deceived by your eyes, because Microsoft students use one of the features of the NTFS file system in Windows vista/windows 7: Hard Connections (Hard link) to implement the WINSXS mechanism!





used to know that to install the Windows vista/windows 7 system, the system partition must be an NTFS file system. The reasons are as follows: System File Protection needs, all kinds of security protection mechanism, such as mic need, WinSxS ...





about the last point of the WinSxS, so NTFS this is a requirement for Windows vista/windows 7 system, because the hard connection mechanism can only be achieved on the NTFS file system, and you can optimize the disk space occupied by Windows directory Of





hard Links About Microsoft Systems





What is a hard link? To put it simply, it's a special shortcut to a file, except that it's implemented in a way that's not the same as a general shortcut.





hard connections are one of the NTFS file system-specific properties, and there are similar mechanisms under Linux. Hard connections apply to the file level of the same volume, and hard connections cannot span volumes.





hard links, System Properties test





Windows Vista/windows 7 has its own command to create a hard connection: Mklink.exe, with this command, we can create a hard connection to the specified file:





The following command establishes a hard connection between Link.txt and Source.txt





c:usershoiidesktop "mklink/h link.txt gb.txt





for link.txt "= = =" "Gb.txt created a hard link





Note The above example: Link.txt is a nonexistent file, but when the Mklink command is executed, the Link.txt file is created. In fact, Link.txt is a false file, it is at the file system level on the Gb.txt file of a mapping, and link.txt is not occupied by hard disk space.





about the footprint of hard disk space, you can test this:





1, a new partition for the hard drive, the space is only 2GB





2, in this section of the test directory to create a new 1.9GB size of the file, the remaining space is 0.1GB





3, with the Mklink command to the 1.9GB size of the file to establish a hard connection





4, check the remaining space of this partition, or 0.1GB, but if you look at the properties of the test directory with the Explorer, you will find that there are 2 files, the total size is 3.8GB (the entire partition is 2GB, can accommodate the 3.8GB size of the file? obviously impossible)





or for the above example, if we delete the original file Gb.txt, Link.txt file will continue to exist, and content is source.txt file content. In other words, we delete the gb.txt and actually delete the connection, and the file itself is not manipulated.





As for hard connections, the last thing to introduce is that when a hard connection is established, any object being modified by a hard connection will cause the corresponding connection object to be modified. For example, the above example: if the Link.txt is modified, then the Gb.txt file will also be modified synchronously, and vice versa. Unlike shell-level shortcuts, the shell-level shortcut file Lnk is just an indication of the relationship, and modifying the LNK file does not affect the object pointed to by the LNK file, nor does the object that the LNK file points to will affect the LNK file.





win new system under the hard link situation and the reason for using this technology





Well, the basics are done, so let's actually look at the use of hard connections in the Windows directory.





often see people complaining that the Windowswinsxs directory takes up too much space, which often finds files with the same name, and that these same files also exist under the WindowsSystem32 directory, why? This is actually a hard connection.





Microsoft Why bother doing this? In fact, it is very good for the stability of the system to increase





the same file, you need to maintain a hard connection, do not require multiple copies, which saves hard disk space





If a file update is involved, you need to download a new version in the WinSxS directory first, then modify the hard connection of the file under WindowsSystem32 under the same name, and point from the hard connection of the old version to the new version of the hard connection, so that you can quickly complete the update of the file. Without the need for file replication, the speed will be much faster





Patch uninstall is the same, only the hard connection point to the old version of the problem, there is no file replacement. And the modification of the file that established the hard connection relationship is synchronized, so as long as one side is modified, the other side will be modified





the Truth





said so much, then how to know the real size of the Windows directory? There are many gadgets to use, but also in the DOS of Third-party tools to test, interested children's shoes on their own test, my test results are as follows:





for pure system test results are as follows, a total of 65,088 files, of which, the real file has 48,022, the other 17,066 files are hard connection files. The real file takes up 14981682 KB of hard disk space, and if you look at it with the Explorer, it prompts you to take up 18244902 KB of hard disk space. In fact, most of the files in the Windowssystem32 directory have established a hard connection with the WinSxS directory.





Windows 7 operating system WinSxS so much space. Actually, not that much. That's just the result of a file sync map.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.