问题描述
Cloud Service Worker Role Workerrole突然停机,查看Events,发现是错误源为 Defrag。
错误消息:
The volume Windows was not optimized because an error was encountered: Neither Slab Consolidation nor Slab Analysis will run if slabs are less than 8 MB. (0x8900002D)
Events 截图:
问题解答
defrag的作用为Windows 系统在本地卷上查找和合并碎片文件以提高系统性能,在云服务的实例中,以计划任务的方式启动,默认携带参数为 “-c -h -o -k”, 对应的目的为:
- -c : 在所有卷上执行此操作。
- -h : 如果默认为低优先级, (以正常优先级) 。
- -o : 针对每种媒体类型执行适当的优化。
- -k : 对指定的卷执行板合并。
而错误 “The volume Windows was not optimized because an error was encountered: Neither Slab Consolidation nor Slab Analysis will run if slabs are less than 8 MB. (0x8900002D)” 是因为系统执行ScheduledDefrag 任务时候出错。在大多数情况下,这是由 -k 参数引起的,该参数告诉碎片整理程序对所选卷执行块合并。这将导致小于 8 MB 的块出现错误,并且通常会在 HyperV VM 上引发错误。解决方案为在参数中移除 “-k”。
操作步骤:
第一步:打开 Task Scheduler
第二步:按下图指示,点击属性进行修改
第三步:打开如下窗口:去除 -k 然后点击 OK 按钮
参考资料
The volume (DRIVE:) was not optimized because an error was encountered: Neither Slab Consolidation nor Slab Analysis will run if slabs are less than 8 MB. (0x8900002D):http://blog.shawnhyde.com/post/2013/11/29/the-volume-drive-was-not-optimized-because-an-error-was-encountered-neither-slab-consolidation-nor-slab-analysis-will-run-if-slabs-are-less-than-8-mb-0x8900002d
defrag:https://learn.microsoft.com/zh-cn/windows-server/administration/windows-commands/defrag