WinSxS 填充速度太快,DISM 清理无法运行

WinSxS 填充速度太快,DISM 清理无法运行

我有一台 Windows 10 计算机,发现 WinSxS 文件夹很快就填满了,DISM 无法运行,并且 c: 显示 0 个可用字节。该计算机还有一个 D:,有 30 GB 以上的可用空间,因此我尝试运行

dism /online /cleanup-image /startcomponentcleanup /scratchdir:d:\dism_temp

如果我不使用 scratchdisk 选项运行,dism 根本无法启动。如果我使用 scratchdisk 选项运行,dism 会在 20% 时出错,并出现 112 错误“磁盘空间不足”。

即使使用了 /scratchdir 开关,/resetbase 开关也会出现磁盘空间不足的错误。

磁盘清理程序在一两分钟内为我节省了几MB的空间,这足以让 dism 在没有 d:\scratchdisk 的情况下启动,但随后释放的空间会在几分钟内神奇地消失。

有没有什么办法可以解决这个问题?

答案1

WinSxS 有多大?它通常很大,由 Windows 管理,应该保持原样。

查找其他地方以节省空间。检查“我的文档”(以及图片、视频),查找可以移动到其他地方(第二个驱动器)的大型或旧文件。

Windows 驱动器需要空间用于 WinSxS(用于修复和管理)和更新(20GB + 用于功能更新)。

移动一些文件后,管理工具、磁盘清理会运行得很好。运行磁盘清理,按“清理系统文件”,然后(在第一次运行后)选择所有项目。

如果您以前进行过功能更新,“磁盘清理”会询问您是否删除它并回答“确定”或是“是”。

最终您可能需要更大的驱动器 C:。

答案2

无论出于什么原因,我都能够通过任务计划程序启动来运行 DISM StartComponentCleanup:

任务计划程序 > 任务计划程序库 > Microsoft > Windows > 服务 > StartComponentCleanup

我还安排了非工作时间运行 StartComponentCleanup,以便今后能够控制 WinSxS 文件夹。

编辑:如果自动安排的任务耗时过长,则会自动终止。我必须创建任务,将其导出为 XML 文件,将优先级更改为 4(优先级高于默认值 7),然后导入更新的任务。优先级越高,任务运行速度越快,不会超时,完成的可能性就越大。

答案3

在谷歌搜索中可以找到许多可能的解决方案,如果一切都失败了,这里还有一个。

填满硬盘的 One-Note for WinSxS 文件夹:

首先尝试这个:Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

Dism.exe 可以从 Windows 中的 powershell 或 Admin CMD 中删除 WinSxS 文件夹。

如果您已经尝试使用 Dism.exe 清理文件夹,那么如果您可以亲自操作计算机并且想尝试我找到的 Linux 修复程序,那么可以选择以下选项。

危险 危险 危险 *** 如果您担心会破坏 Windows 系统,请停止并寻求帮助或上报。Linux“假设您知道自己在做什么”,并会让您破坏东西 ***

  1.    Obtain a USB that will boot a version of Linux.  In Cle Ops, I have (had) a USB for Linux \ that works well.  If you don't have one, create one by downloading linux and using Rufus to create the USB stick.  
    

我喜欢 Mint,因为它易于使用 Linuxhttps://linuxmint.com/ 2) 使用电脑中的 USB 启动电脑,然后启动到 USB 并启动 Linux。3) 启动后,它将启动到 Linux 桌面。不要安装 Linux。否则会违背此目的。

  1.    Open up File Explorer, go to the drive that is normally the "C" drive (See picture above) and navigate to "Windows\WinSxS\Temp\InFlight" as shown.
    
  2.    There may be Hundreds of Thousands of folders here, so you will have to only do a chunk at a time, you will not be able to select all at once and delete.  Select a large chunk of files and then use "Shift" and "Delete" to delete these permanently and not fill up the trash can.  You will need to do this many times depending on how full this folder really is. 
    

开始删除,做点别的事,再检查,开始删除更多,喝杯咖啡,再删除一些,等等。我设法将可用空间从 0Gb 增加到超过 180Gb。花了一段时间,但节省了重新映像驱动器的时间。

一旦驱动器清洁到您满意的程度,请关闭 Linux,移除可启动媒体,然后重新启动 Windows。

相关内容