在命令提示符下运行时优雅地杀死 defrag.exe

Moa*_*oab 4 windows-7 defragment command-line

当我在命令提示符下运行碎片整理时,有没有办法在进程完成之前正常停止进程?

如果在移动文件的过程中,在 TM 中终止任务会导致任何问题吗?

视窗 7 专业版 64 位

sur*_*asb 7

控制 C 取消它。

我不希望任务管理器造成任何伤害,因为它首先要求程序关闭,然后再强制执行。


Ran*_*son 5

从理论上讲,终止程序应该是安全的(在您的情况下,您可以使用 CTRL-C),因为 Microsoft 磁盘碎片整理程序应用程序的设计努力防止意外中断时发生数据丢失。Microsoft 网站上对此进行了记录,如下所示:

The following steps are the processes by which Disk Defragmenter and
file system defragment an NTFS volume and update the MFT.

   1. Locate the fragments of each file throughout the disk.
   2. Copy the fragments to contiguous locations on the disk.
   3. Verify that the copy is an exact duplicate of the original file.
   4. Update the MFT in NTFS with the new location of the beginning of
      the file.
   5. Free up the space previously used by the file.
Run Code Online (Sandbox Code Playgroud)

  Microsoft - 磁盘碎片整理程序的工作原理
  http://technet.microsoft.com/en-us/library/cc778290( WS.10).aspx(以上文本可以在“更新主文件表
”   下找到)

本质上,数据被复制到新扇区,指向已移动数据的指针被更新以指向这些新扇区,然后旧扇区被释放。这是一种非常安全的方法,可以在发生崩溃时使用,因为在最坏的情况下(例如崩溃到蓝屏),您将拥有相同数据的两个副本,一个位于未分配的扇区,另一个位于未分配的扇区上。关于分配的扇区。从读取数据的角度来看,无论哪种方式看起来都是一样的。

此外,微软使用的磁盘碎片整理技术还可以进行许多改进(对于许多人来说已经足够了),并且这里对各种替代产品进行了详细的检查和比较:

  Defragger(来自 Roedy Green 的 Java 术语表)
  http://www.mindprod.com/jgloss/defragger.html