How to check TRIM is working on your SSD running Linux
来源:互联网 发布:python gui qt pdf 编辑:程序博客网 时间:2024/05/19 23:02
Does your drive need a trim?
SSDs really spank traditional disks. But due to a quirk of how they work, they can lose some speed over time. To make sure your disk stays at the same blazing speeds as when you first got it you need to have TRIM enabled. TRIM is a slight optimisation that allows the disk to do some housekeeping behind the scenes.
What you need for TRIM:
- An SSD with firmware that supports TRIM
- Linux kernel version 2.6.33 or higher. That means Ubuntu 10.10, Fedora 13 or better.
- The “discard” option in your /etc/fstab
If you haven’t already done this you can find out how here.
To check that TRIM is working the way it should we’ll create a small file on your SSD, inspect it, then delete it and make sure TRIM has zeroed all the data out.
Open a root terminal, or if on an Ubuntu-based system become root with:
sudo -i
Create a small file in /root (this is all one line):
dd if=/dev/urandom of=tempfile bs=1M count=3
Find the start of the file:
hdparm --fibmap tempfile
Note the address that the file starts at and then inspect that address (if you have more than one disk you should substitute sda for the disk you are checking):
hdparm --read-sector [ADDRESS] /dev/sda
You should see random data. Now delete the file, sync the filesystem, and wait a couple of minutes for the disk to do it’s thing:
rm tempfile && sync && sleep 120
Now let’s inspect that piece of the drive again to make sure the data is gone:
hdparm --read-sector [ADDRESS] /dev/sda
If TRIM is working, you should see all zeros. If you see anything except a sea of zeros then try updating the drive’s firmware. That’s pretty straightforward on recent drives. On Intel SSDs you just burn a small utility to a CD and boot up from it. Make sure you back up your data before you do that, just in case.
- How to check TRIM is working on your SSD running Linux
- How to Secure Your Web Site Running on IBM i
- How to check graphics card on Linux
- Working on your thesis: how to get started and how to keep it going?
- How to fix “Firefox is already running” error by Matt Cutts on January 2, 2007 in How to,Linux/Ubu
- 6 Things to Check if your Web Part is Not Working in Kentico CMS
- How to change your default locale on Ubuntu Linux
- How to Install Ubuntu Linux on your Dell PC
- 72.You want to enable archiving on your database. Presently, the database is running in NOARCHIVELOG
- SSD: how to optimize your Solid State Drive for Linux Mint 17.3, Ubuntu 16.04 and Debian
- How to resolve: The PsExec service running on ?????????????? is an incompatible version.
- How to determine if running on Emulator?
- How to running hadoop mapreduce on tachyon
- How to check linux version
- Summary on 2008-06-12: How to check one session is valid
- How to check iscsi issue on Nexenta
- How to get your ASP.NET application working in IE11
- how to check oracle current running sql status?
- Android Toast 五种显示方式
- 简单的IOCP程序(TCP)
- plist字段列表,很全
- Python3.x和Python2.x的区别
- secureCRT下vim是下划线,不高亮问题
- How to check TRIM is working on your SSD running Linux
- NSString中识别中文字符
- 如和将常用工具添加到“发送到”功能中
- stdint.h/stdio.h,no such file or directory in MDK
- HDFS API的简单使用(1)
- 图形渲染管线
- 引发类型为“Antlr.Runtime.MismatchedTokenException”的异常
- 关于Qt中的调试问题
- 有6种不同颜色的球,每种球有无数个。现在取5个球,求取出5、4、3、2种不同颜色球的概率分别为多少----网易游戏