What happens on the disk, when the file in moved in Windows?

Oblivion77

Honorable
Jul 6, 2018
260
2
10,685
Hello everyone!

When a file is written to the disc (HDD), what happens when the file is then moved in Windows, to another folder?

For example, let us say is it moved from C:\1 to C:\2

Does the reading-head read the file, and then write it to the new location?
Or does physical location of the file, on the disc, remain the same, though the file is moved from one folder to another, in Windows?

What if the file is moved from C:\ til D:\, that it changes drive location in Windows, what then?
I do not mean like to separate drives, but where one physical disk is split up in two drives, in Windows.

What happens on a SSD, regarding the above?

Thank you for answering
 
Everything you say regarding HDD it will just modify some registers, the file stay unmoved on physical location level, just some registers are modified.
Regarding SSD i dont know to answer you that.

EDIT: I missed the split disk in two volumes scenario, in that case the disk in splitted in two with a physical boundry between partitions, in that case it moves a file from a certain section of the disk to another corresponding to the target partition.
 
Whenever you move a file within the same drive/partition, it physically remains on the same spot. Only its path is changed within the file system on the drive.

But if you move/copy if from C to D partition (or drive), it must be copied over to the 2nd location completely, along with changing the path within the file system.

SSD or HDD, it doesn't matter, it's the same. This is handled by a file system.
 
On a HDD the table of locations (was the FAT is now the journal) is updated for scenario 1 and the file does not move (you can test this by doing it with some large files, it will take very little time)
On an SSD I think a similar think happens although that change counts as a write due to the way SSD's work.
Scenario 2 each drive c:\ and d:\ have their own FAT/Journal and so that is a physical move to a different part of the disk, a partition would typically (I think always) be a contiguous area of disk, i.e. the first 25% of the disk would be c:\. This may or may not be true on an SSD.
 
herrwizo answer is correct.

If the file is on the same physical volume and you"move" a file to another directory/folder, only the index gets modified to reference the change. Meaning, the actual file contents doesn't move, just the index to its new location. This is why moving a directory within the same volume happens so fast; the index changes don't take all that much disk I/O.

Now copying or moving data to another volume entirely will perform the actions as defined. A copy is just that, a command to copy the entire data. A "move", is really just a subset of two command executed back to back. When you "move", it's really issuing a copy, then a delete at the source after the fact.