E
E
Evgeny Ivanov2019-05-28 13:13:32
Iron
Evgeny Ivanov, 2019-05-28 13:13:32

How is hard disk recording done?

On HDD and SSD.
The question is not about the basic principles - head hovering, magnetization and SSD transistor memory.
Interested in recording and rewriting.
Is there a clear relationship, the logic of recording and rewriting information?
For example - if we deleted a file from the local drive C and immediately wrote a new file, then the new file will be physically located at the location (at the address) of the remote one? If it is smaller than the remote one, e.g. Who or what decides where to record on the HDD? Or is this process "chaotic"? (the head is over an empty sector - we write faster, there is nothing to wait until it reaches the file / location marked as deleted)
And how is the SSD? If part of the memory is freed there, where will the new information be written to? From the beginning, on any free place "where it fits" or on any free one?
How is hard disk recording done?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2019-05-28
@logpol32

The file system driver decides first. It is he who distributes the record among clusters - the logical units of the FS. It then instructs the disk to write the cluster to specific logical sectors (LBAs). Well, then the disk decides which physical sectors (or blocks for SSDs) correspond to these logical ones.
For HDDs, this correspondence is usually hard-coded, with the exception of bad sectors, which are mapped according to a special table into backup ones.
The SSD has a current mapping table, which is constantly rebuilt so as to use memory blocks as evenly as possible (by the number of write cycles).

C
CityCat4, 2019-05-28
@CityCat4

if we deleted a file from the local drive C and immediately wrote a new file, then the new file will be physically located at the location (at the address) of the remote one?

May be. Or maybe not. It is up to the file system driver to decide where to write the data. And how to write them down is decided by the microprogram sewn into the disk.

A
Artem @Jump, 2019-05-28
Tag curated by

if we deleted a file from the local drive C and immediately wrote a new file, then the new file will be physically located at the location (at the address) of the remote one?
No.
Who or what decides where to record on the HDD?
File system.
How about an SSD? If part of the memory is freed there, then where will the new information be written?
Everything is much more complicated there - everything is decided by the disk controller. First, he evaluates the blocks according to the degree of wear and chooses from the free ones that are the least worn.
Even if you are not writing anything, but just reading, the SSD will still move information.
And if the disk is completely full and there is no free space for recording, there is generally a mess.
To write, you need to erase, but you can only erase a large block of several megabytes in size, and this block can store both deleted data and actual data. Therefore, before erasing, the block must be read into memory, then the current data and new data must be written.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question