What is SSD TRIM (by quqi99)

Source: Internet
Author: User

Zhang Hua posted: 2016-03-23Copyright Notice: Can be reproduced arbitrarily, please be sure to use hyperlinks in the form of the original source of the article and the author's information and this copyright notice(http://blog.csdn.net/quqi99)
ordinary hard disk does not really delete data from the hard disk, only the operating system marked for deletion, the next direct overwrite write, but SSD physical overwrite write is very slow (for SSD, can be 4KB size page (128 pages to form a block) to read and write data, but only with 512KB ( page) size to delete. To overwrite a 4KB page, first copy the 512KB block to the cache, then delete the 4KB page and replace it with the new write data, then empty the SSD's 512KB block area and write the new data back from the cache. So when all the free blocks of an SSD are used, then a write operation can only overwrite the area that was previously marked for deletion by the operating system, which is also the beginning of a slowdown. In particular, a series of small files random write overwrite the write a lot of blocks, so that the cache will quickly overload and become very slow, so the SSD manufacturers are on the new host controller added more and more large external cache, although it can be a program to solve the problem of random write cards, However, it does not solve the problem that SSD slows down when overwriting writes. If the operating system deletes a 4KB page not only in the operating system record, but also control the SSD master physically delete it, this is the trim dry thing, it will write when the delay moved to delete. The need for kernel, firmware (SSD vendor trim algorithm in firmware), drivers (such as Intel's AHCI driver) are all supported by trim. You can use the Fstrim command to reclaim all unused blocks (sudo fstrim-v) on a mounted file system;You can also use the Smartctl-a/DEV/SDA command to detect if the disk is wrong, from the results of similar "177 wear_leveling_count 0x0013 099 099" Pre-fail Always-9 ", the 9 SSD manufacturers estimate 0 represents the new SSD disk, and 100 means it may be broken tomorrow.
here is the basic use of the Smartmontools Self-test tool1, installation packagesudo apt-get install Smartmontools

2. To see if the hard drive is able to enable the Smart self-test feature, if not, use the command "sudo smartctl--smart=on--offlineauto=on--saveauto=on/dev/sda "open.
[Email protected]:~$ sudo smartctl-i/dev/sda
SMARTCTL 6.2 2013-07-26 r3841 [x86_64-linux-4.4.0-9-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org


= = = START of Information section = = =
Model family:seagate Barracuda 7200.14 (AF)
Device model:st2000dm001-9yn164
Serial number:w1e0s44q
LU WWN Device id:5 000C50 052bb6b91
Firmware version:cc4b
User capacity:2,000,398,934,016 bytes [2.00 TB]
Sector sizes:512 bytes Logical, 4096 bytes physical
Rotation rate:7200 rpm
Device is:in smartctl Database [for details use:-P show]
ATA Version Is:ata8-acs t13/1699-d Revision 4
SATA Version Is:sata 3.0, 6.0 GB/s (current:6.0 GB/s)
Local time is:wed Mar 14:50:55 CST


==> warning:a firmware update for this drive is available,
See the following Seagate Web pages:
Http://knowledge.seagate.com/articles/en_US/FAQ/207931en
Http://knowledge.seagate.com/articles/en_US/FAQ/223651en


Smart support Is:available-device have smart capability.
SMART Support is:enabled

3, detection
[Email protected]:~$ sudo smartctl-h/dev/sda
SMARTCTL 6.2 2013-07-26 r3841 [x86_64-linux-4.4.0-9-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org


= = = START of READ SMART DATA section = = =
SMART overall-health Self-Assessment Test result:passed


4, detailed detection
[Email protected]:~$ sudo smartctl-a/dev/sda
SMARTCTL 6.2 2013-07-26 r3841 [x86_64-linux-4.4.0-9-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org


= = = START of READ SMART DATA section = = =
SMART Attributes Data Structure revision number:10
Vendor specific SMART Attributes with thresholds:
id# attribute_name FLAG VALUE worst thresh TYPE UPDATED when_failed raw_value
1 raw_read_error_rate 0x000f 117 099 006 Pre-fail Always-141775376
3 spin_up_time 0x0003 095 094 pre-fail Always-0
4 Start_stop_count 0x0032 020 old_age Always-561
5 reallocated_sector_ct 0x0033 036 pre-fail Always-0
7 seek_error_rate 0x000f 084 060 030 Pre-fail Always-306606505
9 power_on_hours 0x0032 095 095 old_age Always-5237
Ten Spin_retry_count 0x0013 097 pre-fail Always-0
Power_cycle_count 0x0032 020 old_age Always-667
183 Runtime_bad_block 0x0032 Old_age Always-0
184 end-to-end_error 0x0032 099 old_age Always-0
187 Reported_uncorrect 0x0032 099 099 old_age Always-1
188 command_timeout 0x0032 099 old_age Always-0 0 1
189 high_fly_writes 0x003a Old_age Always-0
Airflow_temperature_cel 0x0022 067 054 045 old_age Always-33 (Min/max 20/36)
191 g-sense_error_rate 0x0032 Old_age Always-0
192 Power-off_retract_count 0x0032 Old_age Always-77
193 Load_cycle_count 0x0032 Old_age Always-1907
194 Temperature_celsius 0x0022 033 046 old_age Always-33 (0 8 0 0 0)
197 Current_pending_sector 0x0012 Old_age Always-0
198 offline_uncorrectable 0x0010 Old_age Offline-0
199 Udma_crc_error_count 0x003e Old_age Always-0
Head_flying_hours 0x0000 253 old_age offline-5111h+51m+54.467s
241 Total_lbas_written 0x0000 253 old_age Offline-12778926325684
242 total_lbas_read 0x0000 253 old_age Offline-42981342412817

What is SSD TRIM (by quqi99)

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.