Jump to content











Photo
- - - - -

WinSxS hardlinked files


  • Please log in to reply
7 replies to this topic

#1 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 18 March 2014 - 10:05 PM

WinSxS hardlinked files:

http://blogs.msdn.co...disk-space.aspx

In practice, nearly every file in the WinSxS directory is a hard link to the physical files elsewhere on the system meaning that the files are not actually in this directory.


http://blogs.technet...l-with-vss.aspx

\Winsxs\Backup: Backups of the manifest files in case the copy in \Winsxs\Manifests becomes corrupted

At Windows 7 there are system files too, not only manifest.
This files are not hardlinks on purpose, about 500 MB data.


As for testing:

Windows 7 x64 X17-59186.iso applied to a drive: imagex.exe /apply g:\sources\install.wim 2 f:\
used space at drive f: 7 586 697 216 bytes


for %a in (f:\windows\system32\drivers\*.sys) do @echo.&@fsutil hardlink list %a

\Windows\winsxs\amd64_microsoft-windows-wimgapi_31bf3856ad364e35_6.1.7600.16385_none_e4f094112e8f905d\wimmount.sys
\Windows\System32\drivers\wimmount.sys

\Windows\System32\drivers\wmiacpi.sys

\Windows\winsxs\amd64_microsoft-windows-wmilib_31bf3856ad364e35_6.1.7600.16385_none_b549ebfe1dddb7f1\wmilib.sys
\Windows\System32\drivers\wmilib.sys

E.g. the file wimmount.sys is hardlinked. And the file wmiacpi.sys not.


Hardlink more files:

at admin permissions:
rem find double files
rem http://www.sentex.net/~mwandel/finddupe/
finddupe.exe -bat hl.txt -hardlink f:\

Select WinSXS files
findstr.exe /I "winsxs" hl.txt > hl.cmd

at TrustedInstaller permission:
rem joakim http://reboot.pro/files/file/237-runassystem-and-runfromtoken/
net.exe start trustedinstaller
runassystem64.exe "runfromtoken64.exe trustedinstaller.exe 1 cmd.exe"
hl.cmd
used space at drive f: 6 773 223 424 bytes

That's roughly ten percent space saved.

In addition:
findstr /I "boot.sdi .mui .nls DriverStore WindowsPowerShell .cat .rtf dlmanifests drivers DriverStore assembly MediaCenter ehome .inf RemoteAccess servicing winsxs" hl.txt > hl2.cmd
hl2.cmd
used space at drive f: 6 592 860 160 bytes

Windows installation is possible still.
Be aware: this breaks \Winsxs\Backup\ secured files.

Can be useful at a small drive.
Is it worth the risk at a big drive?
  • Brito likes this

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 March 2014 - 10:22 AM

Where is hl.cmd? :unsure:

Is the output of "filedupe" filtered by findstr already a valid batch?

Is this the filedupe?

http://www.sentex.ne...andel/finddupe/

-bat <batchfile>     Do not hardlink or delete any files. Rather, create a batch file containing the actions to be performed. This can be useful if you want to inspect what finddupe will do.

 

 

Time to experiment a Windows 7 install on a non-hard-link-enabled filesystem (like FAT32)?

Vista :ph34r: *somehow* worked:

http://www.911cd.net...93

http://www.msfn.org/...at32-partition/

 

For no apparent reason, Application Data loop (example of what may go wrong):

http://www.msfn.org/...tion-data-loop/

 

:cheers:

Wonko



#3 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 19 March 2014 - 12:18 PM

Interesting find.

 

What do we break by removing the hard links? :huh:



#4 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 19 March 2014 - 04:04 PM

Where is hl.cmd? :unsure:
Is the output of "filedupe" filtered by findstr already a valid batch?

Filedupe creates a valid batch.
Findstr filters lines. Yes, the ouput is a valid batch.
 

Is this the filedupe?
http://www.sentex.ne...andel/finddupe/

Yes, this the same link.

rem find double files
rem http://www.sentex.ne...andel/finddupe/

 

Time to experiment a Windows 7 install on a non-hard-link-enabled filesystem (like FAT32)?
Vista :ph34r: *somehow* worked:

Did exist back a third party wim reading application? Imagex dosn't write to a FAT, a work around was used.
Today you may try 7-zip to extract install.wim files to a FAT partition.

 

What do we break by removing the hard links? :huh:

By removing hard links you need double space.
The idea is to add more hard links.
 
Imagine a small mSATA or M.2 SSD: 24 GB or 32 GB.
One GB space makes a difference there.

#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 March 2014 - 06:24 PM

Did exist back a third party wim reading application? Imagex dosn't write to a FAT, a work around was used.
Today you may try 7-zip to extract install.wim files to a FAT partition.
 

I did a quick (actually not-so-quick, given the amount of bloat a Windows 7 is) couple of tests with the X15-65804.iso (\sources\install.wim, image index 4).

 

Of course failed. :(

 

Initially I thought that either the Hard Links or the Symbolic Links or the Junctions caused issues.

 

After some checks and experiments it came out that the show-stopper is something else, something I had not expected :w00t:.

 

A FAT32 has a limit of 32,256 (or maybe 32,767 or possibly 65,535) files in a same directory.

But this limit is STRONGLY affected by the use of (senselessly) loooong filenames.

It seems like 7-zip can extract (and "flatten") the .wim fine, but when it gets to \Windows\winsxs\Manifests\ it starts copying the actual .manifest files, but thanks to filenames like (example):

x86_microsoft-windows-d..ime-eashared-imepad_31bf3856ad364e35_6.1.7600.16385_none_3a62984e00849735.manifest

 

it "chokes" at file #6,991 and throws an error for the subsequent 1,558 files.  :ph34r: (total amount of .manifest files is 8,548)

 

Next step would be to understand IF we can do without some of these stupid .manifest files (or if we can do putting them somewhere else or renaming them to something a bit shorter ).  :dubbio:

I did a couple of tries with some (randomly chosen) 6990 files only, but couldn't get the install to finish.

 

 

:cheers:

Wonko

 

P.S.: After a few tries, I managed to get into an "install loop" :w00t:, from which I succeeded anyway to exit :smiling9: through the msoobe direct execution trick:

http://www.sevenforu...tml#post1753456

Right now the Windows 7 on FAT32 boots fine to desktop, though it is still to be seen how to solve the .manifest issue :( (which may cause IMHO *any* kind of issues :dubbio:).



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 24 March 2014 - 11:44 AM

It seems like a similar approach (re-hardlinking winsxs files) has been in use since Vista.

A guy called Christian Bering Boegh wrote, starting 2009  a batch file called Winsxslite that has seemingly been used both in Vista and 7.

The site is here:

https://sites.google...ite/winsxslite/

though links are not working. :(

Googling for "winsxslite.zip" and for "WinsxsLite1.88.zip" should however provide the files.

 

It seems to me like the finddupe can provide the same results in a simpler way :), though seemingly the mentioned batch has further "features" :unsure:.

 

:cheers:

Wonko



#7 ztron

ztron

    Newbie

  • Members
  • 13 posts
  •  
    United States

Posted 04 April 2014 - 03:57 AM

IME what I would do was to install NT6 (Vista at first) x86 to an NTFS volume, and without pagefile & hiberfile
(& swapfile if W8) it would only take up about 4 or 5 GB of space.
 
Then rebooting to XP, adjusting key NT6 file/folder permissions, and copying Vista to a FAT32 volume it
would take up a few more GB, and the winsxs (pronounced win-sucks) folder was the problem.
 
IIRC even copying it to another NTFS, it would still grow in size as the "symbolic" links became real, but surely
it was happening with FAT32.
 
Anyway, in W7 & W8 when winsxs had more folders with each version, I hit the same FAT32 #-of-files/long-filename problem.
 
Here is what I have done and haven't seen a problem, but I didn't use these as everyday workhorses for
very long:
 
it is a very simple-minded solution
also note this example is a 32-bit x86 installation
 
After NT6 is installed to NTFS, reboot to XP, adjust permissions, then look in the Winsxs folder, and delete
the following:
 
in \windows\winsxs\manifests, delete all files whose names begin with x86_microsoft-windows- ...
(no need to delete the x86_microsoft.windows. series)
 
in \windows\winsxs\ delete all folders whose foldernames begin with x86_microsoft-windows- ...
(no need to delete the x86_microsoft.windows. series)
 
this will eliminate most of the contents of both of these repositories
 
then adjust permissions further if necessary, and copy the fileset to a blank FAT32 volume and prepare it
for booting
 
notice \windows\winsxs\backup does not have as many files as \windows\winsxs\manifests so it might not be a
very complete backup
 


#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 April 2014 - 09:57 AM

Anyway, in W7 & W8 when winsxs had more folders with each version, I hit the same FAT32 #-of-files/long-filename problem.

 
Here is what I have done and haven't seen a problem, but I didn't use these as everyday workhorses for
very long:
 
it is a very simple-minded solution
also note this example is a 32-bit x86 installation
 
After NT6 is installed to NTFS, reboot to XP, adjust permissions, then look in the Winsxs folder, and delete
the following:
 
in \windows\winsxs\manifests, delete all files whose names begin with x86_microsoft-windows- ...
(no need to delete the x86_microsoft.windows. series)
 
in \windows\winsxs\ delete all folders whose foldernames begin with x86_microsoft-windows- ...
(no need to delete the x86_microsoft.windows. series)
 
this will eliminate most of the contents of both of these repositories
 

Good. :)

If this is "safe" (in the sense that the missing files are not really-really needed), one can use the "direct" 7-zip extraction from .wim only excluding those files you listed.  :thumbup:

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users