Moving Files Between Drives on One SSD – Will It Be Copied?

partitioningssdwindowswindows 10

When moving a file within one drive, the file is not copied-and-deleted. The table that refers to the files is just updated. And as far as I know, that is not the case on 2 drives on an HDD. But SSDs are different, there is no physical space dedicated to each drive. (source)

So my question is what happens when a file is moved from one drive to another on the same SSD, are the bytes copied and the original deleted, or is some table updated, thereby thrashing the SSD less?

There's already a duplicate question here. But both answers claim:

each partition will have it's own physical area of the drive to itself

and

Partitioning a hard drive actually designates physical regions for
each partition. [and in a comment:] SSD is still a hard drive, it just
doesn't have a disk.

As far as I know that's wrong. See here.

So will someone who knows more about SSDs please tell me if they are correct in their assessment despite their mistake?

Best Answer

As far as I know that's wrong

The quoted description is half-correct, half-wrong. But it's also half-wrong for HDDs too.

Partitioning a drive designates logical regions for each partition. The OS doesn't care about physical locations at all – it just asks the drive to "read logical block #31415926" and the drive itself decides where the data is located. This works the same way for magnetic and flash memory.

It's actually the same as with HDDs from the last 20–25 years: although early operating systems used physical cylinder/head/sector locations, that's long gone now. You don't know precisely where on which platter LBA #1234 is kept. HDDs even remap bad physical sectors automatically, so the same LBA can suddenly be read from a completely different physical area – just like with SSDs.

So with both HDDs and SSDs, the OS just has a range of LBAs (e.g. 0–999999) to read and write data from. The purpose of partitioning is to allocate sub-ranges in it – e.g. partition A gets 10–499999, partition B gets 500000–999999. Each partition has an independent filesystem, and filesystems inside each partition cannot reference data outside it – they cannot cross the partition boundaries. (For example, partition A cannot have a file whose data is kept in sector #600000.)

As a result, all files moving from one to the other have to be copied in full.

(That said, in theory the OS may be able to ask the disk itself to duplicate data from one area to another (e.g. "copy LBA #1234 to #567890"), without having to copy it to the main memory and then back, and of course this would completely bypass partition boundaries. This could make use of the SSD's "flash translation layer", for example. But in practice, as far as I know, this isn't done.)

Related Question