Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the concepts of hard disk?

Shulou Source: shulou.com Published: 2022-06-02 03:53:25 10月05日 Update

What are the various concepts of hard disk? I believe many inexperienced people are at a loss about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

I. order and randomness

How do you define sequential and random access to disks? If the logical block address logical block address (LBA) at the beginning of an IO operation is next to the termination LBA of the last IO operation, it is sequential access, otherwise it is random access. The following picture is more https://en.wikipedia.org/wiki/IOPS.

The logical address is the block address recognized in the program, and the numbering order is incremented. In addition to LBA, there is also a PBA (physical block address), and there is a correspondence between general logic and physical addresses. The physical address is the actual address of the data on disk.

II. HDD

HDD is Hard Disk Drive, the hard disk drive, that is, the ordinary mechanical hard drive, which reads and writes data through the magnetic head. There is a difference between random access and sequential access of HDD. I have written an article on related topics before.

Index vs full table scan

Oh, review again today.

Think of the disk as a disc, on which there is a magnetic head for writing, just like a steel pen. To write something in one position, you need to move the magnetic head to that position first. This operation is called seek (rotation + seek), and the next step is to write down the data sequence (write). After writing the data, the head automatically moves backward. If you continue to write next to each other, you don't need seek.

For example, take a Chinese character as a unit, then write a sentence "Hello to the child" in sequence, only need to seek the magnetic head to the position where "small" is to be written at once, and then write "small", and then directly write the "Hello to the child" to the back one by one, and these words all exist together on the disk. Random writing is to store these words separately and not next to each other. Then a total of 6 times of seek,6 and write are required. Sequential writing is always better than random writing, because random writing takes 5 more seek times.

The seek time of a HDD is 10ms, and the throughput is 100MB/s, that is, the data that can be write 100MB per second. So in 1KB, pure write, the data of 1KB only needs 10us, which is 1, 000 of seek. You can see that seek is very unfriendly.

Because HDD can overwrite, LBA and PBA correspond one to one, and consecutive logical addresses correspond to consecutive physical addresses, so there is a difference between random access and sequential access.

After reading the above, have you mastered the various concepts of hard disk? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Address order that is data head hard disk physics disk logic location concept and then things that is content units OK methods more questions. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Redmi Linux Shulou Technology MariaDB