Quite possibly a stupid question:

jmpatrick wrote on 10/30/2002, 4:48 PM
I've got 2 DATA drives on my system. My project files are sitting on one of the drives...and the WAV/AVI files are fragmented from lots of deleting.

If I transfer all the WAV's/AVI'S from the (fragmented) DATA drive to the other (freshly formatted) DATA drive, will the files end up nice and sequential (defragmented)?

jp

Comments

HeeHee wrote on 10/30/2002, 4:57 PM
There are no stupid questions, just stupid answers.

Here's my stupid, er, uh, answer:-)

It depends on whether the drive you are attmepting to transfer the files to is fragmented or not. The OS will defragment the files when copying from one drive to another as long as it has enough contiguous drive space. If you try copying(moving) from one folder to another folder on the same drive, the OS will only repoint the file and not acutaly move it at all. Hope this anwers you question.
jmpatrick wrote on 10/30/2002, 5:29 PM
Two physically different drives, the new one is freshly formatted (so no frags).

Thanks!

jp
BillyBoy wrote on 10/30/2002, 6:15 PM
If you move a large number of video files which by nature run large, that freshly defragged drive you moved them to likely won't remain unfragemented once you're finshed moving the files. Depends on how many files you moved, the size of the drive, if you're using FAT 32 or NTFS, etc.. If you're moving a large number of large files, defrag the drive you move them to AFTER, not before the move.
HeeHee wrote on 10/30/2002, 8:32 PM
That is not correct. When copying from drive to drive the files will be copied one at a time. The first file will be placed contiguously on the drive if space allows. It does not matter how large the file is as long as the file system you are using supports its size. Likewise, the second file will be placed after the first file on the drive contiguously as space allows and so on. fragmentation occurs when small files are deleted and then larger files are copied in that open space. The larger file is split up between that space and the next available space.
BillyBoy wrote on 10/30/2002, 9:24 PM
Nope. Files are not always written contiguously or in any particualar order even on a freshly formatted drive. Certainly not in any human logical sequence such as file a, followed by file b, file c as you seem to be suggesting. That's a common misconception. The method varies depending on the file system.
jmpatrick wrote on 10/31/2002, 6:48 AM
NTFS
HeeHee wrote on 10/31/2002, 5:08 PM
Files are copied in alphanumeric order no matter what the OS or file system. Some File systems just do a better job then others. If you copy fileX, fileY & FileZ from C: to D: with the copy "file*.*" command, fileX will be searched for on drive C: and be the first file copied, in it's entirety, to the first free location of Drive D:. It's not going to skip to fileY because it reached a point where fileX was fragmented and then start copying fileY! Think about it this way, if you were coping several files to a CD-R, do you think the system would create the file structure in the same exact orientaion as how it was on the hard drive? No, otherwise you would have fragments on media you can no longer change. The files are copied one at a time for this very reason. Deleting, changing and adding files to a drive are the only contributers to fragmentation. Deleting creates gaps and available space, Changing or editing files will make them bigger and thus fragmenting the file or smaller thus creating gaps, and adding files may fragment the files depending on their size and the available locations on the drive.
BillyBoy wrote on 10/31/2002, 8:37 PM
HeeHee said: "Files are copied in alphanumeric order no matter what the OS or file system."

It seems we're talking about two different things. I'm only addressing WHERE the files end up, (which sectors), not how a directory reads after moving files or which file is written first or what file is worked on next. Only the OS can decide which sectors are written to and the process isn't sequencial.

It is sloppy housekeeping to format a drive, then move a large volume of files then assume the drive is in good shape even if there is no or minor fragementation immediately after. By moving the files FIRST then doing a defrag your drive immediately after will be "better" than doing it the other way around. Of course as you open files, make changes and "delete" files the drive starts to get fragemented all over again. Ideally your drive should not be allowed to get much beyond 2% fragemented. Many people wait until it is badly fragemented, then the process can take much longer.

Summersond wrote on 11/1/2002, 12:38 PM
In my experience, it is that when files are copied to another physical drive, the file is copied completely from drive A to drive B with no fragmentation. Even if the file on drive A was fragmented, it will not be on drive B assuming the drive in B was freshly formatted (no fragments left on drive). The only way you might get a fragmented file during copying, is if you were to use a product like "Ghost" and do a sector by sector copy of a partition, in which you would then reproduce an exact image of the files layed out on drive A.

for what it's worth,
dave
BillyBoy wrote on 11/1/2002, 3:42 PM
I'm only saying it is better to defrag AFTER not before moving a large number of files to a different drive.

Simple analogy: Which is smater?

a. vacuum the carpet, then dust the room
b. dust first then vacuum the carpet


Chienworks wrote on 11/1/2002, 4:01 PM
BillyBoy: quite true. However, i think the point that is being considered here is that if the procedure of copying all your files to an empty drive is followed, they will be defragmented enough for use as is. A defragmentation becomes unnecessary either before or after. And this sure is a heck of a lot faster than running a defrag program.
defucius wrote on 11/1/2002, 8:57 PM
Good point, chienworks. In addition to that, from the point of writing a file system and a low level driver like this, you will be hard pressed to write a copy function that copies a file fragmented when the target hard drive is empty. A file copy is never a sector by sector copy, unless you do the copy underneath the filesystem, which is not the case we are talking about here.

Your empty hard drive will not start fragmenting until you delete files or modify files(except the last file your write on the drive, in this case).
BillyBoy wrote on 11/1/2002, 10:27 PM
Seems some are forgetting the original question:

"If I transfer all the WAV's/AVI'S from the (fragmented) DATA drive to the other (freshly formatted) DATA drive, will the files end up nice and sequential (defragmented)?"

a. Of course the files won't remain fragmented when transferred.

b. The files will NOT end up sequential. They may appear that way to the uninformed, but files are never sequential on any hard drive EVER if you're talking about the drive geometry (hardware) ie which sectors hold which files. Files only APPEAR to be in some kind of order because you're viewing the disk structure through software in a human readble form. That's the only "sorting" there ever is. In fact as far as the operating system is concerned your files regardless what kind they are, how large they are or how many you have are nothing but zeros and ones. To take it even further your OS only knows one file from another because it writes which sector holds the start of the file and remembers which sectors the file is spread across.

c. Immediately after completing the transfer the drive will be for all practical purposes be unfragemented. It won't remain that way for long if you use the drive you transferred the files to.

Freshly formatting a drive before transferring files accomplished nothing for this type of operation. In fact doing a full defrag AFTER would have allowed the software you used (assuming you used a decent defrag product like Diskkeeper to do the defrag) to place the files in the most advantageous sectors... something doing a simple copy form one drive to another does not do, nor will simply reformatting the drive first.