SATA, mSATA interface definition and mounting hard disk and speed test under linux

Definition of SATA interface

SATA power cable and data cable interface definition

SATA is the abbreviation of Serial ATA, namely Serial ATA. In 2001, the Serial ATA Committee composed of Intel, APT, Dell, IBM, Seagate, and Maxtor, formally established the Serial ATA 1.0 specification, and in 2002 established the Serial ATA 2.0 specification. Serial ATA adopts the serial connection mode. The serial ATA bus uses an embedded clock signal, which has stronger error correction capabilities, and has the advantages of simple structure and support for hot plugging. It has become the main interface for desktop hard drives.

1. SATA data and power interface diagram:

Insert picture description here
Insert picture description here

2. Internal connection diagram of power supply:

Insert picture description here

Three, power and data line interface definition diagram:

Insert picture description here

4. SATA interface definition description:

1. SATA data interface definition:

Insert picture description here

1 GND Ground (ground, generally connected to the negative pole)
2 A Transmit (data transmission positive signal interface)
3 A- Transmit (data transmission negative signal interface
4 GND Ground (ground, generally connected to the negative pole)
5 B- Receive (data receiving negative Signal interface)
-6 B Receive (data receiving positive signal interface)
7 GND Ground (ground, generally connected to negative)

2. Definition of power interface:

Insert picture description here
01 V33 3.3v Power (DC 3.3V positive power supply pin)
02 V33 3.3v Power (DC 3.3V positive power supply pin)
03 V33 3.3v Power, Pre-charge, 2nd mate (DC 3.3V positive power supply pin, pre-charge, and The second pairing)
04 Ground 1st Mate (grounded, generally connected to the negative pole, paired with the first road)
05 Ground 2nd Mate (grounded, generally connected to the negative pole, paired with the second road)
06 Ground 3rd Mate (grounded, generally connected with the Connect the negative pole and pair with the third channel)
07 V5 5v Power, pre-charge, 2nd mate (DC 5V positive power supply pin, pre-charge, paired with the second channel)
08 V5 5v Power (DC 5V positive power supply pin)
09 V5 5v Power (DC 5V positive power supply pin)
10 Ground 2nd Mate (grounded, generally connected to negative pole, paired with No. 2)
11 Reserved – reserved pin
12 Ground 1st Mate (grounded, generally connected to negative pole, paired with No. 1)
13 V12 12v Power, Pre-charge, 2nd mate (DC 12V positive power supply pin, pre-charge, paired with the second channel)
14 V12 12v Power (DC 12V positive power supply pin)
15 V12 12v Power (DC 12V positive power supply pin)

SATA interface schematic diagram

Insert picture description here

mSATA interface definition

Insert picture description here
Insert picture description here
mSATA interface schematic diagram
Insert picture description here

Mount SATA disk under linux

Linux hard disk identification:

Generally use the "fdisk -l" command to list the hard disks currently connected in the system

Device and partition information. The new hard disk has no partition information, only the hard disk size information is displayed.

1. View hard disk information

#fdisk -l

Insert picture description here

2. Create new hard disk partition command parameters:

fdisk can use the m command to see the internal commands of the fdisk command;

Insert picture description here

3. Enter the disk and partition the disk

#fdisk / dev / sda

Insert picture description here

#fdisk -l

You can see the /dev/sda1 partition

Insert picture description here

4. Partition system system
The default file system here is 83 linux,
it can also be set to other file systems and format the set partition

mkfs.ext3 /dev/sda1 //Note: format /dev/sdb1 as ext3 type

5. Create /data directory and mount

#mkdir /data

#mount /dev/sda1 /data

6. View the size of the hard disk and the mounted partition:
#df -h
Insert picture description here
7. Unmount the partition umount
The following two commands respectively unmount the file system by the device name and mount point, and output detailed information at the same time:

umount  /dev/sda1        通过设备名卸载  

umount /data    通过挂载点卸载  

SATA disk read and write speed test

Use dd command to test speed

(1) Test the read speed of the hard disk:

time dd if=/dev/sda1 of=/dev/null bs=1M count=10000

This command reads 10G data from the hard disk sda1 and writes it to the empty device, which is the data read and empty.
Insert picture description here
Reading speed: 218.4MB/S
Another way to test the reading speed

hdparm  -t /dev/sdb

Insert picture description here
(2) Test the hard disk writing speed:

time dd if=/dev/zero of=/dev/sda1 bs=1M count=10000

This command is to write 10G data from the zero device to the sda1 device.

One thing to note is that the above write command may overwrite the original data in the hard disk and destroy the file system. This can be done if there is no data in the hard disk.

If there is a file system and important data, you can mount the hard disk first

  mount /dev/sda1 /data

Execute the following command:

  time dd if=/dev/zero of=/data/10g.file bs=1M count=10000

Write the written data to a file to test, the writing speed: 145.8MB/S
Insert picture description here

sata 1.0 2.0 3.0 difference

The theoretical transmission speed of SATA1.0 is 1.5Gbit/s. The
theoretical transmission speed of SATA2.0 is 3Gbit/s. The theoretical transmission speed of
SATA2.0 is 6Gbit/s.
Difference: SATA2.0 and SATA3.0 have different transmission rates.
Insert picture description here
According to the comparison table of SATA2.0 and SATA3.0 given above, the latest SATA3.0 transfer rate can reach 6Gb/s, while the transfer rate of SATA2.0 interface is 3Gb/s. In theory, the SATA3.0 interface is twice that of SATA2.0.
Insert picture description here

View SATA version under Linux

 dmesg  | grep SATA

Insert picture description here

 hdparm  -i /dev/sdb

Insert picture description here

The essence of SSD solid state drives

Solid State Drive (Solid State Drive), abbreviated as SSD (Solid State Drive), is a hard disk made of an array of solid-state electronic storage chips, composed of a control unit, a storage unit (FLASH chip, DRAM chip) and a cache unit. Different from the mechanical hard disk, which is composed of mechanical parts such as magnetic disks and magnetic heads, the entire solid-state hard disk structure has no mechanical devices, and is entirely composed of electronic chips and circuit boards.

What is a solid state drive? Detailed internal structure of SSD

SSD is mainly composed of electronic chips and circuit boards:

According to the definition of solid state drive, we can know the internal structure of solid state drive, which is actually composed of three main control chips, flash memory particles, and cache units. Then, let's look at them one by one.

What is a solid state drive? Detailed internal structure of SSD

1. The brain of the solid state drive: the main control chip

Just like the CPU to the PC, the main control chip is actually the same as the CPU. It is the core device of the entire solid state drive. Its role is to rationally allocate the data load on each flash memory chip, and the other is to undertake the entire data transfer and connection. Flash memory chip and external SATA interface.

The capabilities of different main controllers are very different. There will be very big differences in data processing capabilities, algorithms, and the control of reading and writing flash memory chips, which will directly lead to a large gap in the performance of solid state hard disk products. .

Insert picture description here
Master

The current mainstream main control chip manufacturers include Marvell (commonly known as "horse brand"), SandForce, siliconmotion Huirong, Phison Phison, jmicron Zhiwei and so on. And these major control manufacturers all have their own corresponding characteristics, which are applied to solid-state products at different levels.

2. Core device: flash memory particle unit

As a hard disk, the storage unit is definitely the core device. In solid-state drives, flash memory particles have replaced mechanical disks as storage units.

Flash memory (Flash Memory) is essentially a long-life non-volatile memory (the stored data information can still be retained in the event of a power failure). Data deletion is not in a single byte unit but in a fixed The block is the unit.

Insert picture description here

Flash memory particles account for most of the solid state drive

Among solid-state hard drives, NAND flash memory is widely used because of its non-volatile storage characteristics, that is, it can save data after power failure.

According to the difference of electronic unit density in NAND flash memory, it can be divided into SLC (single-level memory cell), MLC (double-layer memory cell) and TLC (three-layer memory cell). These three types of memory cells have obvious life and cost. The difference.

SLC (single-layer storage), single-layer electronic structure, small voltage change interval when writing data, long life, read and write times of more than 100,000 times, high cost, and mostly used in enterprise-level high-end products.

MLC (multi-layer storage) uses high and low voltage and differently constructed double-layer electronic structure, with long life and acceptable cost. It is mostly used for civilian high-end products, and the number of reads and writes is about 5000.

TLC (three-layer storage) is an extension of MLC flash memory, with TLC reaching 3bit/cell. The storage density is the highest, and the capacity is 1.5 times that of MLC. With the lowest cost, low mission life, and read and write times of about 1,000 to 2,000, it is the flash memory particle of choice for mainstream manufacturers .

Currently, in the solid-state drive market, mainstream flash memory particle manufacturers mainly include Toshiba, Samsung, Intel, Micron, skhynix Hynix, and Sandisk.

Because flash memory particles are the core device and the main storage unit in solid state drives, their manufacturing costs account for more than 70% of the entire product. To the extreme, choosing a solid state drive is actually choosing flash memory particles.

3. Cache chip

The essence of the cache chip is DDR. DDR3 is commonly used in SSDs. It is the most overlooked piece of the three solid-state hard drives, and it is also the piece that manufacturers are least willing to invest in. Compared with the main control chip and flash memory particles, the role of the cache chip is indeed not so obvious, and the awareness of the user group is not so deep, and accordingly, it cannot be used as a gimmick to promote it.

In fact, the existence of the cache chip is meaningful, especially in the random reading and writing of commonly used files, and the fast reading and writing of fragmented files.

Insert picture description here

Due to the internal wear mechanism of the solid state drive, the solid state drive will continue to write and cache the entire block of data when reading and writing small files and commonly used files. However, exporting to flash memory particles requires a large amount of cache maintenance. Especially in the process of reading and writing large-scale fragmented files, the role of high cache is even more obvious.

This also explains why SSDs without cache chips start to slow down after a period of use. Currently, the size of the cache chip market is not too large, and mainstream manufacturers are basically concentrated in South Asia, Samsung, Kingston, etc. According to the latest news, solid state drives without external cache will come out soon. Although there have been products such as sandforce2281 with cache master control products long ago, the market response is not satisfactory. I don’t know the latest solid state drives without external cache. Please wait and see how you perform.

The main control chip, flash memory particles (essentially NAND flash), and cache chip (essentially DDR3 memory) are organically combined on a PCB board to form the overall shape of the solid state drive. When we are purchasing or evaluating solid-state drives, we can start from these three to estimate product performance, and avoid blinding our eyes by the high-speed reading and writing advocated by some vendors.

Guess you like

Origin blog.csdn.net/u014470361/article/details/99964037