blog posts

hard

How to calculate the capacity of hard drives?

In this article, you will learn how the actual capacity of hard disks is calculated, what mechanisms hard disks use to improve performance and speed, and the relationship between the capacity and speed of hard disks.

  • What is the queuing technique in the hard drive?
  • Checking the size of the hard drive (Drive Size)
  • What is the usable capacity of the hard drive?
  • What causes the difference in usable storage space?
  • How to calculate the actual capacity of the hard disk
  • What is the benefit of calculating the real capacity of the hard disk?
  • Checking the speed of the hard drive (Drive Speed)

One of the interesting questions asked by users and even professionals new to the world of network and storage is why the nominal capacity of hard disks differs from what Windows shows, why we face the problem of lack of space when implementing RAID architecture, and suddenly, Will everything change?

Data recovery services in Falk
Data recovery software either cannot recover your data or cannot recover all data. Using them reduces the recovery work and the possibility of restoring information. Falk’s specialized data recovery center recovers information from hard drives that are not recognized by the system.

Data recovery request

As someone who has several years of experience in the field of programming, security and networking, I suggest that you improve your knowledge about the basics and how to convert them to each other. Foundations play an important role in the world of computing and especially in the world of networking and storage and help you do most of the work in a simpler way. For example, when you plan to implement a vlan and you need to break IP addresses, you should know about this field, when you plan to implement different levels of read, you should be familiar with how to calculate the nominal and real capacity of hard disks.

What is the queuing technique in the hard drive?

All disk drives use a queuing technique to improve performance. Queuing allows the drive to implement fine-grained prioritization of I/O operations, so that read and write commands are executed in an order optimized for the disk layout. The above approach creates good order in the I/O operations, so that the read and write commands are executed as much as possible in order to minimize the head movement and the latency is as low as possible.

The ata command set implements the Native Command Queuing (NCQ) mechanism. This improves the sata drive’s performance in performing simultaneous read and write operations, however, the above technique is not as powerful as the command tag queuing mechanism used by scsi media.

Checking the size of the hard drive (Drive Size)

In the world of storage, size matters. This criterion is especially important when purchasing storage media for servers. In the world of business and especially in the Iranian market, this word has a dual application, because it is used for both physical dimensions and capacity. In general, there are two important criteria to be aware of when talking about disk drives:

  1. Capacity
  2. Physical Form Factor

Typically, when we talk about the size of a drive, we’re referring to the capacity of the media or the amount of data it can store. In the past, this size was expressed in megabytes (MB), but these days we are talking about gigabytes (GB), terabytes (TB), and on a large scale, petabytes (PB), which large organizations use. To learn about these units, read the article What are bytes, gigabytes, terabytes and petabytes?

it is suggested. Here, the size of a drive refers to the diameter of the drive platter, which is usually called the drives’ form factor. Today’s modern hard drives come in the following two sizes:

  1. 3.5 inch hard drive
  2. 2.5 inch hard drive

As you might have guessed, a drive with a 2.5-inch platter is physically smaller than a drive with a 3.5-inch platter, and again, it’s the 3.5-inch drives that hold more data than the 2.5-inch drives. inches are stored. The reason is clear, a 3.5-inch screen has more surfaces to record information.

Study proposal

3.5-inch drives are manufactured and marketed in standard sizes, so all 3.5-inch drives can fit into a slot in a server or disk array. The same goes for 2.5-inch drives. 2.5-inch drives are also made in standard sizes, and it is possible to replace a defective 2.5-inch drive from one brand with another made by another brand. So although technically, terms like 2.5 inches and 3.5 inches refer to the diameter of the platter, but when we talk about the physical dimensions of these drives, we mean the size of the body and not the capacity. The following table shows the appearance characteristics of each media.

depthan offerHeighttype
146 mm (5.75 inches)101 mm (4 inches)26 mm (1 inch)3.5 inches
100 mm (3.94 inches)70 mm (2.75 inches)15 mm (0.16 in)2.5 inches

Solid state drive manufacturers also recognized the popular 2.5″ and 3.5″ sizes, and that’s why today’s storage devices like NAS support 2.5″ and 3.5″ disk drives without problems. The above approach also benefits consumers, as they have the chance to use a solid-state drive (SSD) instead of a mechanical disk.

What is the usable capacity of the hard drive?

When we talk about capacity, it’s important to note that when you buy a disk drive, you never get the capacity listed on the disk. For example, if you buy a 4TB hard drive, you definitely won’t have access to 4TB of usable space. One reason is that storage capacities can be expressed as base 10 (decimal) or base 2 (binary). For example, 1GB in base 10 is slightly different than base 2:

Base 10 = 1,000,000 bytes

Base 2 = 1,048,576 bytes

As you might have guessed, the differences are quite significant when we’re talking about capacities on the gigabyte or even terabyte scale: the difference between the two numbers on the terabyte scale is significant:

Base-10 terabyte = 1,000,000,000,000 bytes

Base-2 terabyte = 1,099,511,627,776 bytes

In the example above, where the capacity is in terabytes, the difference between these two source units is slightly more than 9 GB.

What causes the difference in usable storage space?

For example, a hard disk with a capacity of 1 TB after partitioning and formatting shows a capacity of approximately 931 GB, provided that it is healthy. Also, a 500 GB hard disk shows a capacity equal to 465 GB in the Windows operating system. Have manufacturers undersold in this regard? Definitely not, as they face heavy fines for fraud. So where is the problem? If the disk drive manufacturer shows the capacity in base 2 on the product box, but the operating system shows the capacity in base 10, it looks like there is a problem.

As we mentioned, hard disks are made of different components such as tracks and sectors. Therefore, in calculating the capacity of the hard disk, the product of the number of disks in the number of tracks and then the number of sectors and the number of bytes placed in one sector should be calculated in order to obtain an accurate result.

In calculations, we use units of kilobytes, megabytes and gigabytes to represent values ​​in a scientific way. In this way, 1000 means 10 to the power of 3, 1 million means 10 to the power of 6, and 1 billion means 10 to the power of 9. For convenience, we can use the equivalent of 100 gigabytes instead of 100 billion bytes. . With the information we obtained, we arrive at the following formula:

Kilo = 10^3 = 1,000

Mega = 10^6 = 1,000,000

Giga = 10^9 = 1,000,000,000

Tera = 10^12 = 1,000,000,000,000

Storage media uses base 10 and software uses base 2 to calculate and display information. Therefore, there is no mistake and the problem is how to display the information. To solve the problem, the IEC standardization organization came up with a prefix system to describe the difference between base 10 and 2. In base 2, the units are mebibyte, kibibyte, gibibyte, and tebibyte, where bi refers to the binary representation, which is abbreviated as MiB, KiB, GiB, and TiB, but these abbreviations are rarely used to represent capacities.

Now we come to the important difference. Software and operating systems such as Windows calculate concepts such as kilobytes, megabytes, gigabytes, and terabytes in a different way than the system used by vendors. The difference is as follows:

The formula used by manufacturers of disk drives is equal to Kilo=10 3 =1000 KB

The formula that operating systems like Windows use is equal to Kilo = 2 10 = 1024KB

How to calculate the actual capacity of the hard disk

All we need to do is to calculate the conversion of GM, MB, K to GiB, MiB and KiB.

kB – KiB: 1000 / 1024 = 0.977

MB – MiB: (1000 * 1000) / (1024 * 1024) = 0.954

GB – GiB: (1000 * 1000 * 1000) / (1024 * 1024 * 1024) = 0.931

As you can see, the higher the capacities, the greater the differences. Now it’s time to calculate the above formula in practical form. Suppose we have a drive with a capacity of 356 GB. The calculation formula is as follows:

* 0.931= 331.436 GB

The actual capacity of the hard disk

As you can see in the figure above, the value we got matches what Windows shows. Of course, there is another way to calculate the capacity, which is as follows:

Let’s take a 120GB hard drive as an example:

The method of calculating the hard drive capacity by the factory is as follows:

۱۲۰GB=120,000MB=120,000,000KB=120,000,000,000 bytes

While the hard drive capacity calculation method is as follows:

۱۲۰,۰۰۰,۰۰۰,۰۰۰ bytes/1024=117,187,500KB/1024=114, 440.9MB/1024=111.8GB

The following table shows the binary and decimal suffixes of different units.

Binary and decimal suffixes

What is the benefit of calculating the real capacity of the hard disk?

When this training course goes forward and you are familiar with the concept of RAID, you will realize that when implementing RAID, you should not pay attention to the nominal capacity of the disk drive, but you should pay attention to how much space you have available and implement the RAID architecture based on that. . Of course, there are other criteria that cause the actual capacity to not be shown correctly, for example, what file system was used when formatting a disk in the operating system.

In addition, the operating system and file system often consume some space as slag. Similarly, when installing a disk in a storage array, the array typically reduces some capacity as overhead. Furthermore; RAID architecture is an important issue that you should pay attention to in this field.

Checking the speed of the hard drive (Drive Speed)

The speed of the drive depends on the speed of rotation of the plates, here the measure of revolutions per minute (RPM) is used to express the speed of the disk drive. Simply put, this value shows the number of pages that are rotated per minute. Common drive speeds are as follows:

  1. ,RPM
  2. .       7,200 RPM
  3. .       10,000 RPM
  4. 15,000 RPM
  5. 5. 20,000 RPM (very rarely)

Here, for convenience, the abbreviations 5.4K, 7.2K, 10K, 15K and 20K are used respectively.

To get a general impression of these speeds, pay attention to this example. A 3.5-inch dial spinning at 15,000 rpm suggests that its outer edges are traveling at around 240 km/h. Therefore, the higher the speed of a disk drive, the shorter the read and write time, the better the performance and unfortunately the higher the price.

There is also a stable relationship between RPM and capacity. Typically, the higher the RPM of a drive, the lower the capacity of that drive. On the contrary, the lower the speed of the drive, the higher its capacity, which is quite logical according to the information we have provided.

Another thing to note is that 10k and 15k drives usually run the scsi command set and have a sas or fc interface. Therefore, faster drives implement a more performance-tuned protocol and interface, which still makes sense. Also, 5.4k and 7.2k drives usually implement the ata command set and have a sata interface. If you have followed the article from the beginning, you now have a detailed understanding of the following two examples:

-inch, 900 GB, 10K SAS

inch, 4 TB, 7,200 RPM SATA

As a general rule of thumb, don’t expect to see disks rated in revolutions per minute (RPM) faster than K15. The advent of solid state media, the difficulty and the increased costs required to develop discs with RPMs higher than K15 have made manufacturers reluctant to build discs with speeds higher than K15. In fact, trends show that K10 is more popular than K15 due to its lower cost and easier development for vendors.

Of course, Western Digital, as an old company in the hard disk manufacturing industry, decided to produce and market hard disks with an RPM equal to K20 in the form of a 2.5-inch form factor with a 3.5-inch enclosure to deal with the dominance of solid-state memories. However, these models of hard disks are not found in the Iranian market due to their high price, and companies outside Iran also prefer to use the same solid state memories. Now that we’ve covered the anatomy and basic features of disk drives let’s see how the components we’ve learned about affect a drive’s performance, but let’s explore that discussion in a future issue.