Fundamentals of Disk basics and reading and writing

Source: Internet
Author: User
First, Disk Basics

The basic components of a disk can be divided into the following parts: Head, Disc, disk, track, cylinder, sector and so on. 1, platter and plate surface

A hard disk usually has multiple platters, the disc is divided into two sides, where the effective surface is called disk (that is, the disk can be stored data, in general, the upper and lower sides of the platter can be stored data, of course, only one side can be used to store data), the number of platters is the same as the number of heads: Number of discs = number of platters * 2. Disk general naming rules are from the disk and the next 0 ... N, the same is true for the naming rules for heads. 2, head

Generally, each disk is equipped with a magnetic head for reading and writing data. The approximate structure is shown in the following figure:

That is, the number of heads is generally equal to the number of effective disk. Here you have to explain the basic principle of how the head works. The magnetic head switching track reading and writing data is realized through the mechanical equipment (stepper motor), speed is slow, and the head switch disk read and write data is achieved through electronic devices, faster, so the head is generally read and write the cylinder before beginning to seek the road, so that the disk read and write efficiency faster. 3, Track (track)

As shown in the figure above, the track is centered on the middle axis of the circle, the number of different disk disks are not the same, the track is also a gap between the track is the disk storage data media. There is a layer of magnetic media on the track, through which the polarity of the magnetic medium can be converted to the data signal of the operating system (that is, the disk is read and the disk writes the exact opposite). 4, cylindrical surface (cylinder)

The cylinder is made up of tracks with equal radii in different disk surfaces. You can also understand this: assuming that the track is a two-dimensional ring (of course the magnetic medium on the track is thickness, but in the eyes of the human eye appears to be a plane), then the corresponding cylinder is the track stretching from the. It is also said that the number of cylinders = the number of tracks on a certain disk surface . 5, Sector (sector)

A single track is composed of multiple curved slices, and of course the number of sectors owned by each track on a disk is equal. Sectors are divided as shown below:

sector is the smallest storage unit of the hard disk, remember is the hard disk is the smallest storage unit, is not a small file system storage unit (file system small storage unit is block, can be set artificially). The general sector size is 512bytes.

The following is an example of my computer:
To view the operating system:

[Root@rodbate ~]# cat/etc/issue
CentOS release 6.7 (Final)
Kernel \ R on a \m

[root@rodbate ~]#
uname-a Linux rodbate 2.6.32-573.el6.i686 #1 SMP Thu 12:37:35 UTC 2015 i686 i686 i386 Gnu/linux

The following examples are based on the above operating system.

First use the fdisk-l command to view the basic information of the hard drive:

[root@rodbate ~]# fdisk-l disk/dev/sda:10.7 GB, 10737418240 bytes 255-heads, Sectors/track , 1305 cylinders Units = cylinders of 16065 *-8225280 bytes-sector size (logical/physical): bytes/512 bytes O size (minimum/optimal): bytes/512 bytes Disk identifier:0x0001d8fb Device Boot Start block
S-Id system/dev/sda1 * 1 512000 Partition 1 does not ' end on cylinder boundary. /dev/sda2 1306 9972736 8e Linux LVM 

According to the above information, the total capacity of the hard disk is 10.7 GB. The
1,255 heads represents 255 heads (that is, the number of valid disks is 255),
2,63 Sectors/track indicates that there are 63 sectors per track, 1305 cylinders indicates that the disk has 1305 cylinders, that is 1305 tracks per magnetic surface.
3, wherein units = cylinders of 16065 * = 8225280 bytes represents the capacity of the cylinder, that is, the cylinder capacity = number of cylinders (1305) * Track capacity (track capacity = number of sectors [63] * Sector size [512bytes]) = 1305 * 8225280 bytes.
4,sector Size (logical/physical): bytes/512 bytes Sector size is 512bytes in both physics and logic.
5,i/o Size (minimum/optimal): bytes/512 bytes Indicates disk minimum I/o read/write size 512bytes. The
6,disk IDENTIFIER:0X0001D8FB represents the hard disk identifier.
7, the partition of the disk is actually implemented by dividing the disk cylinder. Each disk partition has a start cylinder and end cylinder, and the capacity of the partition can also be calculated by this, the above has reached the size of the cylinder, to get the size of the hard disk partition only: disk partition size = Cylinder Size * The number of cylinders owned by the partition .

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.