Disk Management mainly includes the following content:
- Disk structure
- Introduction to Partitions
- Managing partitions
- Managing File Systems
- Mounting devices
- Managing Virtual Memory
This article mainly describes the disk structure and zoning, the remainder will be described in the following article
Disk structure 1. device file Device type:
- Block devices: block, access units "blocks", such as disks
- Character device: Char, Access unit "character", such as keyboard
Device files:
Associated to a device driver to communicate with the corresponding hardware device
Device number:
- Main device number: Major numbers, identifying device types
- Second device number: Minor numbers, identifying different devices under the same type
Device file name for disk device:/dev/dev_file
- SCSI, SATA, Sas,ide,usb:/DEV/SD (the hard disk on the IDE interface on CENTOS5 is named/DEV/HD)
- Virtual Disk:/DEV/VD
- Different disk identities: A-z,aa,ab ... such as/DEV/SDA,/dev/sdb, ...
- Different partitions on the same device: 1, 2, ... For example/DEV/SDA1,/dev/sda5 ...
2. Hard drive interface type parallel:
Serial:
- sata:6gbps
- sas:6gbps
- usb:480mb/s
Rpm:
Rotations per minute, mechanical hard disk rpm, common rotational speed of 5400,7200,10000,15000
3. Mechanical hard drives and solid state drive HDD (HDD):
Hard disk drive, which is a traditional HDD, consists of a few parts: platters, heads, disc spindles and control motors, head controllers, data converters, interfaces, caches, etc. All the discs in the mechanical hard disk are mounted on a rotating shaft, each disc is parallel, there is a head on the storage surface of each disk, the distance between the head and the disk is smaller than the diameter of the head hair, all the heads are connected to a head controller, and the head controller is responsible for the movement of the heads. The head can move along the radius of the disc, plus the disk rotates at a high speed of thousands of RPM, the head can be positioned at the specified position of the disk for data read and write operations. The data is written to the disk by the magnetic flux through the magnetic head by the electromagnetic flow, or it can be read in the opposite way. Hard drive for precision equipment, air entering the hard drive must be filtered
Solid-state drives (SSDs):
Solid state drives, a hard disk made of a solid electronic memory chip array, consisting of a control unit and a memory unit (Flash chip, DRAM chip). SSD in the interface specification and definition, function and use of the same as the ordinary hard disk, in the product shape and size is also consistent with the ordinary hard disk
Compare the two:
- The SSD transfer rate performance is twice times higher than that of HDD,SSD in shock-proof, transmission rate, power, weight, and noise.
- has an absolute advantage over price, capacity, and service life compared to SSD,HDD
- Hard disk price, data priceless, the current SSD can not completely replace HHD
This article introduces mechanical hard disk as the main
4. Mechanical HDD Structure HDD storage terminology
- Head (head): Read and write data to disk
- Track: When the disk is rotated and the head remains in one position, each head will draw a circular trajectory on the disk surface called the track. A track on a disk is a set of concentric circles with different recording densities
- Sector (sector): each track on a disk is divided into segments that are sectors of the hard disk. The first sector of a hard disk, called a boot sector. The size of a sector is 512 bytes
- Cylinder (cylinder): a cylindrical face in a disk group consisting of multiple platters, consisting of faces of different platters, but with multiple tracks in the same radius circle
5. Addressing method: CHS and Lbachs
- With 24bit bit addressing
- The first 10 bits represent cylinder, the middle 8 represents head, and the back 6 bits represent sector
- Maximum addressing space 8GB
LBA (Logical Block Addressing)
- LBA is an integer that completes the disk-specific addressing by converting to CHS format
- LBA with 48 bit bit addressing
- Maximum addressing space 128PB
Since the address space of CHS is within approximately 8GB, it is possible to use CHS addressing or LBA addressing when disk capacity is less than about 8GB, and only LBA addressing is used when disk capacity is greater than approximately 8GB
Partition INTRODUCTION 1. Why Partitioning
- Optimizing I/O performance
- Implementing disk space Quota limits
- Improved repair speed
- Isolating systems and programs
- Install multiple OS
- Using different file systems
2. Two ways of partitioning: MBR and GPT (1) mbr:master boot record, master boot record, use 32 bits for sector number, partition not exceeding 2T
- How to partition: Press Cylinder
- 0 Track 0 Sector: 512bytes
446bytes:boot Loader
64bytes: Partition Table
16bytes: Identify a partition
2bytes:55aa
- 4 primary partition, 3 primary partition +1 extension (n logical partition)
HDD Master boot record MBR consists of 4 parts
- The Master Boot program (offset address 0000h--0088h), which is responsible for loading from the active partition and running the system boot program
- Error message data area, offset address 0089h--00e1h error message, 00E2H--01BDH all 0 bytes
- Partition table (Dpt,disk Partition table) with 4 partition entries, offset address 01BEH--01FDH, 16 bytes per partition table entry, 64 bytes for partition entry 1, partition entry 2, partition entry 3, partition item 4
- End glyph, offset address 01fe--01ff 2 byte value for end flag 55AA
DPT (partitioned table) structure in MBR
(2) Gpt:guid (Globals Unique Identifiers) partition table supports 128 partitions, using 64-bit, support 8Z (512byte/block) 64Z (4096byte/block)
- Use a 128-bit UUID (universally Unique Identifier) to indicate that the disk and partition GPT partition tables are automatically backed up at the head and tail two parts, and have a CRC check bit
- UEFI (Unified extension Firmware interface) hardware supports GPT, enabling the operating system to boot
The EFI section can also be divided into 4 areas: EFI Information area (GPT header), partition table, GPT partition, backup area
Linux Disk Management (i)