3

If a drive doesn't know about partitions and files systems why moving a file from one partition to another takes relatively long time, unlike the instantaneous move on the same partition? Is that file system inefficiency? In this case, NTFS. It seems like the file is being copied and then original is erased, instead of removing the entry about that file in one partition and making it in another?

2
  • Thank you guys for your answers. While they are both good, the chosen answer to this question really added to my understanding: superuser.com/questions/280667/… And if I got this right, with SSDs we actually have logical regions for each partition, not physical. And these logical regions are then being mapped to physical blocks as wear leveling sees fit.
    – Vitaly
    Aug 11, 2011 at 13:04
  • Somebody pointed out that Disk drives don't know about partitions either. I suppose the MBR knows and I'd guess both disk drives and SSDs have those, though I could be wrong!
    – barlop
    Mar 7, 2013 at 13:02

2 Answers 2

5

Each partition has it's own, independent file system. If you move a file within a partition, the file system can simply rewrite the reference to that file.

But when moving a file between partitions, the file system on the destination partition doesn't know anything about the new file - there is no reference to adjust. Furthermore, each partition will have it's own physical area of the drive to itself, so the file must be copied to the new partition, then deleted from the old partition.

Copying large files in this manner is often slow, probably even noticeably for some SSDs, because the drive is thrashing between reading one area and writing to another.

2
  • Re your first two paragraphs, it's worth adding that (I think) it's same with disk drives too.
    – barlop
    Mar 7, 2013 at 13:02
  • This is not quite correct. Partitions do not reserve physical space in a drive, they reserve a range of logical sectors of a drive. Logical sectors can be remapped by the drive to different physical sectors. HDDs do this infrequently to replace bad blocks, but SSDs do it all the time. See more detail here
    – Old Pro
    Dec 28, 2018 at 19:38
6

Partitioning a hard drive actually designates physical regions for each partition. The file is being moved from partition 1 (physical region 1) to partition 2 (physical region 2). When you move a file from partition 1 to elsewhere in partition 1 (another folder), the file is already in the correct physical region, so only the reference to it changes.

4
  • The question is about SSD, where this, apparently, is not the case: superuser.com/questions/86753/…
    – Vitaly
    Aug 11, 2011 at 8:00
  • 3
    SSD is still a hard drive, it just doesn't have a disk. The hard drive doesn't know about partitions, just bits, blocks and usage. The operating system, seeing two partitions in the move operation, makes the decision to read the file in its entirety and write it to the other partition. More than the file system inefficiency, it's likely a SSD driver inefficiency. I don't know enough about hard drive drivers to say whether they deal with move commands, or if they just know how to read and write. Aug 11, 2011 at 8:19
  • 1
    @Vitaly You're misinterpreting that link. The situation regarding partitions, the extent that they know and the extent that they don't, is the same whether spinning disk or not. That's just physical implementation. They know, to the extent that they have an MBR that specifies where the partitions begin and end.
    – barlop
    Mar 7, 2013 at 13:05
  • This is wrong. Partitions do not reserve physical space in a drive, they reserve a range of logical sectors of a drive. The nature of SSDs is that logical sectors are regularly remapped to different physical areas of storage for several reasons. Magnetic drives can also remap sectors, though for performance reasons they usually only do that to replace a bad sector with a good spare sector. See more detail here
    – Old Pro
    Dec 28, 2018 at 19:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .