First, your core question is this:
Why copying takes time across partitions on the same disk?
Will go into detail below, but a single disk with multiple partitions is not “the same disk” from a filesystem perspective. From a filesystem perspective, a partition is simply another “physical disk” even if it is simply just a “logically” allocated space on a larger, parent physical disk where two paritions reside:
- Disks have partitions,
- Partitions have filesystems.
- Filesystems have files.
Read on for more details.
Note: I am using Linux/Unix/Mac OS X terminology since that is where my core expertise is, but the basic concept applies to Windows and really just any OS.
Why doesn’t the OS/kernel simply move the info. of
bytes/sectors/address-pointers/whatever allocated to that file from
one FileSystem table to other partition's FileSystem table?
This is because the inode table that controls & manages what sectors are connected to what files is a per-disk, per-partition construct.
So when you copy something from C: to C: all that is happening is an inode entry is being edited on the C: drive to indicate the new path to the file on the same C: drive.
But when you copy something from C: to D:, the data must be copied and a new inode entry must be created on the D: drive.
Let’s say you are wondering why not just keep all drive data on the main C: drive instead of doing it on a per device, per partition basis? Well, then what happens when that drive or partition is moved to another machine? The D: drive would just look like bare and unused space with out that allocation table data. And if the C: drive crashed in a scenario like this, not only do you lose the C: drive but also the deeper filesystem info connected to the D: drive.
You also edited your question to state this:
I suppose partitioning is logical not physical.
Yes and no. Partitioning is logical on the side of the partition table. But on a filesystem level, the filesystem sees a partition as if it were another physical disk.
And you also ask this:
So why doesn’t the OS or FileSystem controller simply copy this
metadata about helloKitty.txt to other partitions table?
It does copy the metadata from one place to another. But it also copies the actual file data since that data on D: won’t exist until it is copied from C:. And the metadata it copies is limited to the basics about the file contents since byte and sector data will change when it copied from the C: disk/partition to the D: disk/partition.
The byte’s pointers do not change, they are absolute because the
partition is logical not physical.
The partition is “logical” in the context of a partition. The data stored in the filesystem on that partition is not “logical” in the context of data about individual files going up to the partition table. That is simply the way it is and partition—as defined by Wikipedia—is described as follows; emphasis is mine:
Disk partitioning is the act of dividing a hard disk drive (HDD) into
multiple logical storage units referred to as partitions, to treat one
physical disk drive as if it were multiple disks, so that a different
file system can be used on each partition.