在 Windows 系统上移动文件的最快方法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/364367/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fastest way to move files on a Windows System
提问by Andreas Grech
I want to move about 800gb of data from an NTFS storage device to a FAT32 device(both are external hard drives), on a Windows System.
我想在 Windows 系统上将大约 800GB 的数据从 NTFS 存储设备移动到 FAT32 设备(两者都是外部硬盘驱动器)。
What is the best way to achieve this?
实现这一目标的最佳方法是什么?
- Simply using cut-paste?
- Using the command prompt ? (
move
) - Writing a batch file to copy a small chunks of data on a given interval ?
- Use some specific application that does the job for me?
- Or any better idea...?
- 简单地使用剪切粘贴?
- 使用命令提示符?(
move
) - 编写批处理文件以在给定的时间间隔内复制一小块数据?
- 使用一些适合我的特定应用程序吗?
- 或者有什么更好的主意...?
What is the most safe, efficient and fast way to achieve such a time consuming process?
实现如此耗时的过程,最安全、最高效、最快速的方法是什么?
回答by Pyrolistical
回答by RedFilter
I would physically move the hard dsk if possible.
如果可能的话,我会物理移动硬盘。
回答by benlumley
I've found fast copy to be quite good for this sort of thing. Its a gui tool ....
我发现快速复制非常适合这类事情。它是一个gui工具....
回答by GabrielB
I wanted to comment a comment about multithreading, from @hello_earth, 201510131124, but I don't have enough reputation points on Stackoverflow (I've mostly posted on Superuser up until now) :
Multithreading is typically notefficient when it comes to copying files from 1 storage device to 1 other, because the fastest throughput is reached for sequential reads, and using multiple threads will make a HDD rattle and grind like crazy to read or write several files at the same time, and since a HDD can only access one file at a time it must read or write one chunk from a file then move to a chunk from another file located in a different area, which slows down the process considerably (I don't know how a SSD would behave in such a case). It is both inefficient and potentially harmful : the mechanical stress is considerably higher when the heads are moving repeatedly across the platters to reach several areas in short succession, rather than staying at the same spot to parse a large contiguous file.
我想评论一个关于多线程的评论,来自@hello_earth,201510131124,但我在 Stackoverflow 上没有足够的声望点(到目前为止我主要在超级用户上发布):
多线程通常不是将文件从 1 个存储设备复制到另一个存储设备时效率很高,因为顺序读取达到了最快的吞吐量,并且使用多个线程会使 HDD 发出嘎嘎声和疯狂地同时读取或写入多个文件,并且由于 HDD 一次只能访问一个文件,因此它必须从文件中读取或写入一个块,然后从位于不同区域的另一个文件移动到一个块,这大大减慢了进程(我不知道 SSD在这种情况下会表现)。它既低效又可能有害:当磁头在盘片上反复移动以短时间连续到达多个区域时,机械应力要高得多,而不是停留在同一位置来解析大的连续文件。
I discovered this when batch checking the MD5 checksums of a very large folder full of video files with md5deep : with the default options the analysis was multithreaded, so there were 8 threads with an i7 6700K CPU, and it was excruciatingly slow. Then I added the -j1 option, meaning 1 thread, and it proceeded muchfaster, since the files were now read sequentially.
我在使用 md5deep 批量检查一个充满视频文件的非常大的文件夹的 MD5 校验和时发现了这一点:在默认选项下,分析是多线程的,因此 i7 6700K CPU 有 8 个线程,而且速度非常慢。然后我添加了 -j1 选项,意思是 1 个线程,它进行得更快,因为现在文件是按顺序读取的。
Another consideration that derives from this is that the transfer speed will be significantly higher if files are not fragmented, and also, more marginally, if they are located at the begining of a hard disk drive, corresponding to the outermost parts of the platters, where the linear velocity is maximum (that aspect is irrelevant with a solid state drive or other flash memory based device).
由此衍生的另一个考虑是,如果文件没有碎片,传输速度将显着提高,而且,如果它们位于硬盘驱动器的开头,对应于盘片的最外层,则传输速度会更快,其中线速度最大(该方面与固态驱动器或其他基于闪存的设备无关)。
Also, the original poster wanted “the most safe, efficient and fast way to achieve such a time consuming process” – I'd say that one has to choose a compromise favoring eitherspeed/efficiency, orsafety : if you want safety, you have to check that each file was copied flawlessly (by checking MD5 checksums, or with something like WinMerge) ; if you don't do that, you can never be 100% sure that there weren't some SNAFUs in the process (hardware or software issues) ; if you do that, you have to spend twice as much time on the task.
另外,原来的海报通缉“最安全,高效,快捷的方式来实现这样一个耗时的过程” -我想说的是一个有选择的妥协有利于无论是速度/效率,或安全性:如果你想安全,你必须检查每个文件是否被完美复制(通过检查 MD5 校验和,或使用 WinMerge 之类的东西);如果你不这样做,你永远不能 100% 确定在这个过程中没有一些 SNAFUs(硬件或软件问题);如果你这样做,你必须在任务上花费两倍的时间。
For instance : I relied on a little tool called SynchronizeIt! for my file copying purposes, because it has the huge advantage compared to most similar tools of preserving all timestamps (including directory timestamps, like Robocopy does with the /DCOPY:T switch), and it has a streamlined interface with just the options I need. But I discovered that some files were always corrupted after a copy, truncated after exactly 25000 bytes (so the copy of a 1GB video for instance had 25000 good bytes then 1GB of 00s, the copy process was abnormally fast, took only a split second, which triggered my suspicion in the first place). I reported this issue to the author a first time in 2010, but then he chalked it up to a hardware malfunction, and didn't think twice about it. I still used SI, but started to check files thoroughly every timeI made a copy (with WinMerge or Total Commander) ; when files ended up corrupted I used Robocopy instead (files which were corrupted with SynchronizeIt, when they were copied with Robocopy, then copied again with SynchronizeIt, were copied flawlessly, so there was something in the way they were recorded on the NTFS partition which confused that software, and which Robocopy somehow fixed). Then in 2015 I reported it again, after having identified more patterns regarding which files were corrupted : they had all been downloaded with particular download managers. That time the author did some digging, and found the explanation : it turned out that his tool had trouble copying files with the little known “sparse” attribute, and that some download managers set this attribute to save space when downloading files in multiple chunks. He provided me with an updated version which correctly copies sparse files, but hasn't released it on his website (the currently available version is 3.5 from 2009, the version I now use is a 3.6 beta from October 2015), so if you want to try that otherwise excellent software, be aware of that bug, and whenever you copy important files, thoroughly verify if each copied file is identical to the source (using a different tool), before deleting them from the source.
例如:我依赖一个名为 SynchronizeIt 的小工具!对于我的文件复制目的,因为与保留所有时间戳(包括目录时间戳,就像 Robocopy 使用 /DCOPY:T 开关所做的那样)的大多数类似工具相比,它具有巨大的优势,并且它具有简化的界面,仅包含我需要的选项. 但是我发现有些文件在复制后总是损坏,恰好在 25000 字节后被截断(例如,1GB 视频的副本有 25000 个好的字节,然后是 1GB 的 00,复制过程异常快,只花了一瞬间,这首先引发了我的怀疑)。我在 2010 年第一次向作者报告了这个问题,但后来他将其归结为硬件故障,并没有三思而后行。我还在用SI,但开始彻底检查文件每次我做了一个副本(使用 WinMerge 或 Total Commander);当文件最终损坏时,我改用 Robocopy(用 SynchronizeIt 损坏的文件,当它们用 Robocopy 复制,然后用 SynchronizeIt 再次复制时,被完美地复制,所以它们被记录在 NTFS 分区上的方式有些混乱那个软件,以及哪个 Robocopy 以某种方式修复了)。然后在 2015 年,在确定了更多关于哪些文件损坏的模式后,我再次报告了它:它们都是通过特定的下载管理器下载的。那次作者挖了一些,找到了解释:原来他的工具在复制文件时遇到了鲜为人知的“稀疏”属性,有些下载管理器设置这个属性是为了在下载多个块的文件时节省空间。
回答by kemiller2002
If you have to move it over a network, you want to use FTP between the servers. The Windows File system will get bogged down with chatty protocols.
如果您必须通过网络移动它,您希望在服务器之间使用 FTP。Windows 文件系统将陷入繁琐的协议。
回答by Arnout
I've found Teracopyto be pretty fast and handy. Allegedly Fastcopy (as suggested by benlumley) is even faster, but I don't have any experience with it.
我发现Teracopy非常快速和方便。据称 Fastcopy (如benlumley所建议的)甚至更快,但我没有任何经验。
回答by Johannes
Try using WinRar or a zipping tool. Big "files" are moved quicker than lots of small ones. Most zipping tools allow to split the archive(zip) files into multiple archives.
尝试使用 WinRar 或压缩工具。大“文件”比许多小文件移动得更快。大多数压缩工具允许将存档(zip)文件拆分为多个存档。
You might even reduce the size a bit when you turn on compression.
当您打开压缩时,您甚至可能会稍微减小尺寸。
回答by Harry
I used Teracopy and copied 50+GB to a 128GB flash drive.
Too almost 48 hours...had to do it twice because had a power
hiccup. Had to re-format and start over...Not my favorite thing
to do...
我使用 Teracopy 并将 50+GB 复制到 128GB 闪存驱动器。
几乎 48 小时...不得不做两次,因为电源打嗝。不得不重新格式化并重新开始......不是我最喜欢做的事情......
回答by kumar chandraketu
One of the fastest way to copy files is use robocopyas pointed by Pyrolistical in above post. its very flexible and powerful. If command doesn't work from your dos prompt directly then try with powershell option like below example.
复制文件的最快方法之一是使用robocopy,如上面的 Pyrolistical 所指出的。它非常灵活和强大。如果命令无法直接从您的 dos 提示符下运行,请尝试使用 powershell 选项,如下例所示。
Must Check the documentation for this command before using it "robocopy /?".
在使用“robocopy /?”之前,必须检查此命令的文档。
powershell "robocopy 'Source' 'destination' /E /R:3 /W:10 /FP /MT:25 /V"
/E - Copy subdirectory including empty ones.
/R - Retry 3 times if failed.
/W - wait for 10 seconds between retries.
/FP - include full path name in output.
/MT - Multi thread.
/V - verbose output.
回答by FallenAvatar
Command Line: xcopy is probably your best bet
命令行:xcopy 可能是你最好的选择
Command Reference: http://www.computerhope.com/xcopyhlp.htm