Disk devices for Linux systems _ "All"

Source: Internet
Author: User

Disk->raid, partition-and format-mount

The basic framework

A. external and internal hardware structure of the hard disk, working principle and reading and writing principle
B.raid partition (a disk divided into one or more small virtual disk, can be redundant, can)
C. Knowledge of disk terminology and the knowledge system of partitioning
D. format, create file system, initialize Inode and block; Understand file system terminology knowledge and system
E. Hanging on to the Linux file system, mastering system command Operation knowledge

Disk internal structure
Front: Origin, size, generation date, barcode, brand, etc. reverse: Green circuit board, Chip, capacitance, resistance, porosity        buffer write buffer   cache read Buffer side: Data converter, power cord, interface (SATA,SAS,IDE,SCSI) Internal structure: Platters (2-14, each face can be stored data), head, disc spindle, control motor, head controller and    all the discs are fixed on a rotating shaft, that is, the disc spindle,    all the discs are directly parallel, each disc each storage surface has a head, The head has a small distance between the discs. The rotation of the spindle of the disk is one of the important references to the disk reading and writing performance; The interface of the disk determines the read performance SATA serial port disk, the structure is simple, reliable, high performance SAS  combined SATA and SCSI benefits of SSD SSD: Solid state Driver     Classification:        Flash-based SSD: Removable, data protection is not power-controlled, suitable for a variety of environments,  such as a USB flash drive and other        DRAM-based SSDs: using DRAM as a storage medium, high performance , need power support    advantages:        Fast Start, debris does not affect the read time, write fast, no noise, low fever, no fault, vibration    disadvantage;        high cost, small capacity, limited life, data difficult to recover

The process of working with disks:
Self-Understanding:

    When the disk is working, the disk will move at a high speed, when it reaches a certain speed, the airflow is strong enough to hold the head up and maintain a small distance (the smaller the distance, the higher the flexibility of the head reading data), the head will slowly be moved outward from the start Stop area, the head reads the data of the outermost 0 tracks (guided by The        head is radially moving along the diameter, the disc rotates, and a circle of data is read. • Return to the start-stop area when not working. Spec version:        1. The disk reads and writes are carried out according to the cylinder, starting from 0, reading the data, reading 1 disks of the same radius of data, and so on, read the data of the same radius of the disk to read another radius of data        2. Switching between different heads is an electronic switch, Direct switching of different radii is mechanical (depending on the motor moving the head arm)

The principle of disk access data: The conversion of electrical pulse signals to computer-identifiable information

1. Use the polarity of a particular magnetic particle to record data. 2. When the head reads the data, it converts the magnetic field to a different electrical pulse signal, and then uses the data converter to turn the original signal into the usable data of the computer.    write to this contrary to the    disk read and write data, should be as far as possible to let the head motionless, so as to read as much as possible more data
Disk-related knowledge

1. Basic knowledge
The boot program at boot time is 512 bytes in the 1 sectors of the 0-cylinder 0 track (the outer No. 0 data area of the first platter)
Partitioning a disk is actually dividing the cylinder number and the sector code
Number of cylinders = number of tracks on a single disk
Disk head Head Sector sector track tracks Cylinder cylinder Units unit block (one cylinder size)
2. Disk Face
1 fast disk = several valid platters (7 full disks) The effective disk surface (2 sides) of each platter corresponds to a read-write head, numbered from top to bottom by 0, and different disk disks are logically divided into tracks, cylinders, and sectors (factory-set).
One head corresponds to an effective disk (head number =2* platter)
When the disk is stopped, the head is placed in the Head Start-stop area, outside the start-stop area is the data area
When the disk is working, the disk will move at a high speed, when it reaches a certain speed, the airflow is strong enough to hold the head up and maintain a small distance (the smaller the distance, the higher the flexibility of the head reading data), the head will slowly be moved outward from the start Stop area, the head reads the data of the outermost 0 tracks (guided by
The head is radially moving along the diameter, the disc rotates, and a circle of data is read. • Return to the start-stop area when not working.
3. Track of the disk
When the disk (disc) is formatted, it is divided into a number of concentric circles, these concentric circles are called tracks
The number of the track, which is numbered from the outside, and the head reads the data by 0 tracks.
4. Cylinder of the disk
The concentric circles of the same track on all the discs form a cylinder, called a cylinder, from top to bottom.
Heads on each cylinder are numbered from top to bottom starting with "0"
How many tracks correspond to the number of cylinders
5. Sectors of the disk
The operating system is a sector-wide unit that stores information on disk, typically a sector of big trifle 512 bytes
Definition: Dividing a line from the center to the periphery, dividing the track into multiple sector regions called sectors
A sector consists of 2 components: identifiers, Data segments
identifier of the location where the data is stored: the head (disk face) where the sector is located, the track (cylinder number), the position of the sector in the track (Sector code)
Data segment where data is stored:
multiple sectors = = one track
The size of each sector is 512 bytes
The number of sectors per track is the same, sector numbering starts at 1
6. Summary of disks
1. A disk has 2-14 platters, each disc has 2 effective faces, each face a read-write head, with the magnetic number one to distinguish the disk surface
That is, the number of disk is the number of read and write heads, number of discs *2= heads (number of disks)
2. When the disc is formatted, the center of the disc will be divided into concentric circles, and these concentric circles are the tracks we are talking about.
The tracks are numbered outside and inside 0-n
3. Different tracks are divided into a plurality of sector regions, each sector is called a slice
Sector consists of 512 bytes per identifier + data segment
4. Different discs of the same radius are composed of a cylindrical surface called a cylinder.
One cylinder contains multiple tracks (with radius), and one track contains multiple slices
5. The data information record can be expressed as:
A magnetic head (disc) a certain sector of a track (cylinder)
6. The system's boot disk is the 1th sector of the 0 cylinder 0 track

Calculation of disk capacity
Fdisk-l    -  -View disk Partitions disk/dev/mapper/volgroup-lv_root:16.8 GB, 16752050176 bytes255 heads, Sectors/track, 2610 cylindersunits = Cylinders of 16065 * 1 = 8225280 bytes        --size of a cylinder method: Disk capacity =512b * Number of Sectors * number of tracks (per disc) * Number of heads =512< c3/>* 2636   *             255echo $ ((255*63*2036*512))-          only integer ==>echo "255*2636*63*255" |BC   You can calculate the Decimal Method 2: Disk capacity = number of cylinders (number of tracks) * Cylinder size (track size * Number of heads) =512b* sectors * Number of tracks * Number of heads =units * 2610echo $ ((8225280*2036))  
How mechanical disk read data works

1. The disk read and write is based on the cylinder unit, starting from 0, read the data, read 1 disk surface of the same radius of data, and so on, read the data of the same radius of the disk to the end of the reading of another radius of data
2. The switch between the different heads is electronic switching, the direct switching of different radii is mechanical (depending on the motor moving the head arm)

Summary of DISK commands
1. Tip 1. The characteristic of the Linux system is to cache the system's unused physical memory 2.buffers to write buffer  sync to write buffer data to disk 3.cache to read the data buffer 4. The mechanical hard disk reads and writes all uses the Cache technology 2. Command free:    - M: shows the calculated memory size as   shown below and the remaining memory is 347M     [[email protected] ~]# free-m        total        used       free     shared    Buffers     Cached Mem:             482        247        235          0         85/+ buffers/cache:         135        347
Other

Problem: The sector size of the different tracks does not look the same, the intuitive feel more on the outside, the larger the track fan
Answer: 1. The storage density of the data is not the same in different tracks
2. Track clearance density is different, outside small, inside dozen

Disk devices for Linux systems _ "All"

Related Article

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.