Setting up a trim job on Freya
You can add the TRIM command to /etc/rc.local. Then this command will be executed automatically on system boot. This hardly slows the boot process down.
You can do that as follows:
Type in the terminal:
sudo -i scratch-text-editor /etc/rc.local
Above the line exit 0 in that file, you now add the TRIM command
fstrim for every automatically mounted EXT4 partition.
Note: not for partitions that aren't mounted by default! And also not for the swap partition, as that's already being trimmed automatically by the system by default, during the boot process.
Your rc.local should look like this:
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# By default this script does nothing.
If you have a separate home partition, then you add the following line as well, above exit 0:
Note: if you have a separate partition for /boot/efi, don't add a trim command line for that in rc.local. It's useless, as that partition is seldom being written to. And it may even cause malfunctions.
Disable the now useless weekly trim
sudo mv -v /etc/cron.weekly/fstrim /fstrim
With that command you've transferred the script file fstrim to the root directory, thus disabling it.
Source and other ways to optimize your SSD on elementary/ubuntu 14.04: Here