Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the secrets of hard drives?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what are the secrets of the hard disk". In the daily operation, I believe that many people have doubts about the secrets of the hard disk. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the question of "what are the secrets of the hard disk?" Next, please follow the editor to study!

I found a website (post a link at the end of the article) that shows the latency of data access from 1990 to 2020 different media.

I flipped through the order of magnitude of the speed of the media itself, with memory access latency from 207ns to 100ns and hard disk from 19ms to 2ms, but the access speed between the media was still several orders of magnitude lower.

However, what I have circled above is random access, and sequential access will not be so different. If you want to know why, you need to understand the construction of the hard disk.

Of course, the hard disk I mentioned today refers to the mechanical hard disk, but the solid-state hard disk will not be covered in this article.

I wrote this article because I had doubts about tracks, cylinders, sectors, and so on, such as:

Why did you come up with the concept of cylinder?

Where exactly does the track refer to?

Is the sector equally divided?

. Wait

So let's have a reason today. According to my habit, let's take a simple look at history first.

A brief history of hard disk

On September 14, 1956, the world's first disk storage device, the IBM 305RAMAC, was born. This device uses disks to store data and uses heads to read and write data. However, due to the technology at that time, it is a bit big, about the size of two refrigerators. Just take a look at the picture below.

I looked at the history in the middle and it didn't work for us, and we fast-forward to 1973, when IBM launched a hard drive codenamed Winchester.

The characteristic of this kind of hard disk is that the magnetic head and the magnetic disk are installed in an airtight space. When the magnetic disk is autobiographical at a high speed, the magnetic head will be suspended because of the aerodynamic force, and then the magnetic head arm will operate the magnetic head to move along the disk in a circular arc.

This is how our mechanical hard disk runs, and after so many years, it is still a typical "Winchester" structure, also known as warm disk.

As for the reason for taking this code name, it is because the hard drive developed at that time had two 30MB storage units, and the "Winchester rifle" had exactly 30 caliber and charge, so the code name was "Winchester".

History we know that this step is almost, and then look at the internal structure of the hard drive.

The structure of hard disk

First of all, let's take a look at the real appearance of the hard drive. I marked some key parts.

Let me start with a brief description of how the hard drive works.

After power up, the spindle drives the disk to rotate, and after reaching a certain speed, the head will be suspended above the disk, and then the head arm can control the movement of the head in a circular arc. Through the rotation of the disk and the movement of the head, it is possible to access the data anywhere on the disk.

Some people here may wonder, why let the magnetic head float?

First of all, if the magnetic head and disk touch, there will be friction, friction for a long time, there will be wear, wear and tear after the data will not be lost?

Secondly, when there is friction, the speed must be slow, and the access speed of the disk will be slow.

So suspension is critical, and the height of the head suspension is thinner than the hair, about 0.1 micron, if there is dust in the head and disk may cause wear and tear, which is the reason why the hard disk needs to be sealed.

Didn't the head contact with the disk when it was first started?

Yes, you're right, so people came up with a way, that is, the magnetic head stop, which is the place pictured above.

When it is powered on, the magnetic head will not be moved to the disk until it reaches a certain speed, and after the power is cut off, the magnetic head will be moved to the docking place by relying on the remaining power of the capacitor, so that it will not be worn out every time it starts!

Another way of docking is to make a place where the data is not stored in the inner circle of the disk, which is made of different materials and is specially docked for the head.

In order to insert a video on the official account, I also uploaded a video on Tencent Video. The hard drive from Wikipedia is running the video. The hard disk docking of this video should be the second way.

Take a look at this video.

Https://v.qq.com/x/page/w3222s68yv5.html

After we have a rough idea of how the hard drive works, let's go a little deeper.

Here I wanted to draw by myself, but my personal painting level is limited, and other people's painting is too good. So I moved here, ha.

Let's take a look at the disk first.

An is the track, the disk is composed of a group of concentric circles such as the track, note that it is marked red, it is a ring, there is a cross section, and some reference books are marked on the line.

B is the sector, C is the sector, each track will be divided into a group of sectors, each sector contains an equal number of data bits, usually 512 bytes, is the most basic unit of hard disk data storage.

D is a cluster, which is composed of multiple sectors. for example, DOS allocates disk space for files in clusters.

From the picture, the sectors seem to be continuous, but in fact, there are gaps between sectors, these gaps are used to identify the formatted bits of the sector, and the data will not be stored.

I wonder if you are a little confused to see that each sector contains equal data bits, and the concentric sector that is obviously closer to the center of the circle seems to hold much less data than the outermost sector. isn't that the peripheral data bit to accommodate the innermost?

Right. In order to have an equal number of sectors for each track, there is a large gap between the sectors of the outer track, but in the past, the data storage density of the hard disk was very low, so it was acceptable.

With the increase in hard disk storage density, this has caused a great waste, so we have developed a zoned-bit recording technology, which aims to place more sectors on the outer ring track than on the inner ring track. Take a look at this picture.

It doesn't matter how to achieve it.

The important thing is to solve the puzzles. it is not rigid to determine the number of sectors of all tracks according to the number of sectors in the innermost circle, as some books say.

A hard disk usually consists of one or more disks.

For example, in the following picture, there are three disks, each with two upper and lower faces, corresponding to six heads.

The magnetic head number is counted with 0 from top to bottom, and the magnetic head arm leads the magnetic head to move in a circular arc. The tracks of each disk are also counted from 0, and the area composed of tracks with the same number is called a cylinder. You can get it with your imagination. Let me post a picture to help you.

Why is there the term cylinder?

Because several magnetic heads actually rely on the same magnetic head arm movement, so to turn together, and are all at the same angle.

Therefore, if you want the data to be read quickly, the data should be stored sequentially on a unified cylinder.

For example, if it can not be written on the first track of the top disk, then continue to write to the second disk on the back, so that the head arm can be searched once, and the data can be read only once.

We can also know from here that the more disks a hard disk has, the faster it will be.

Hard disk access time

We already know from the above that the hard disk takes the sector as the basic unit, so the access of the hard disk is to find the corresponding sector.

The surface of the disk is magnetic, and the disk rotates with the rotation of the spindle. When you want to access a sector, you must first turn the head arm to find the corresponding track, which is called seek time.

At this time, the disk is still rotating, and the head can sense the value on the lower data bit, and when it rotates to the target sector, it will know that it is time to read / write data, which is called rotation time.

So when we buy a hard drive, we will see 7200RPM, 15000RPM and so on. The faster the disk rotates, the shorter the time it takes for the disk to find the sector.

Finally, it is the transmission time to read the data.

So the hard disk data access delay is the sum of these three times, and the slowest is the seek time. I give the data provided by CSAPP:

Total delay = seek time + rotation time + transfer time = 9ms+4ms+0.02ms=13.02ms

Of course, the total delay of different hard drives must be different, anyway, you just need to know that the seek time is the slowest.

Logical disk block

From the above physical structure, we already know that we need to find the disk, then find the track, and finally find the sector to read the data, which is a bit complicated.

There is no need to expose such an unfriendly access posture to the operating system, so a logical disk block is created, which shields the details of the underlying access, and provides a sequence of logical blocks such as 0, 1, 2.n to correspond to specific physical blocks.

In this way, the operating system is comfortable to access the disk, but eventually it has to find the corresponding sector, and the disk controller maintains the mapping between the logical block and the actual physical sector.

The disk controller belongs to a piece of hardware in the hard disk, which translates the logic block into a triple of disk, track and sector.

At this point, the logical block we are talking about corresponds to the physical access of the hard disk.

At this point, the study of "what are the secrets of hard drives" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report