Every day it is more common to find solid state hard drives in our computer. This new type of hard drive gives us a very high performance compared to its traditional brother, but it also requires a «special maintenance»That is usually the hit of this hard drive. As with 64-bit systems, Ubuntu and other GNU / Linux distributions have utilities and tricks that allow them to handle these devices very well. One of these tools or utilities is called TRIM and is the one we will see in today’s post.
Table of Contents
What is TRIM?
TRIM is a system application that allows us to maintain the performance of our SSD hard drives as if it were the first day. Not all operating systems on the market carry the option to enable TRIM although Ubuntu not only brings this possibility but manages it automatically by choosing the file format. Not only is it advisable to enable this option but almost mandatory if we do not want our SSD hard drive to have a short life.
How to activate TRIM?
To activate TRIM we must have the following requirements:
- Ext4 or Btrfs file format. (By default Ubuntu installs Ext4)
- A kernel higher than 2.6.33 (the latest versions of Ubuntu far exceed it)
- An SSD hard drive that supports TRIM (currently all SSD hard drives support this utility)
If we still doubt whether or not we are suitable for this tool, we open the terminal and write:
suo hdparm-I / dev / sda | grep «TRIM support»
In “/ dev / sda” we can replace it with the SSD hard drive we have, that is, if we have several hard drives, we look for the ssd, if not leave it as it is will work. If we have it activated, a message like this or similar appears
Support TRIM data set management (8-frame limit)
If the message does not appear it is better to leave it as our computer does not support it, if it appears we continue.
Now we open the console again and write:
gksu gedit /etc/cron.daily/trim
It will open a file where we will paste the text into the document:
#! / Bin / sh
LOG = / var / log / trim.log
find «*** $ (date -R) ***» >> $ LOG
fstrim -v / >> $ LOG
fstrim -v / home >> $ LOG
We save it and now check that TRIM works:
suo fstrim -v /
If it works a message like “should appear”8158715904 bytes were trimmed«, If we don’t have it we will try to restart the system or modify the last two lines of the text we have pasted, replacing« / »and« / home »with the directories that are physically on the SSD hard disk.
If in the end it works we will not only have extended the performance of our SSD hard drive but also its life, one of the main flaws I see in SSD hard drives
More Information – How to adjust Ubuntu to the format of a Netbook, How to partition hard drive in Ubuntu
Source and Image – Webupd8