Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use the fstrim command on my machine. The configuration is as follows :

ubuntu@ip-172-16-10-56:~/test$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:    12.10
Codename:   quantal

And I have created the fstrim in the /etc/cron.daily using the following commands:

sudo root vi /etc/cron.daily/fstrim

And fstrim file contains :

#! /bin/sh  

# By default we assume only / is on an SSD. 
# You can add more SSD mount points, separated by spaces.
# Make sure all mount points are within the quotes. For example:
# SSD_MOUNT_POINTS='/ /boot /home /media/my_other_ssd'  


for mount_point in $SSD_MOUNT_POINTS
    fstrim $mount_point  

and then saved it and tried to run it using the command:

ubuntu@ip-172-16-10-56:/etc/cron.daily$ sudo /etc/cron.daily/fstrim 
fstrim: /mnt: FITRIM ioctl failed: Operation not supported

I get that error everytime. I am not sure what is it that I am doing wrong.

I am following the instructions mentioned in How to enable TRIM?

Any help will be greatly appreciated.

Thanks Anjali

share|improve this question

You appear to be trying to trim /mnt is something mounted as /mnt ? usually people use /mnt/myPartationName most likely defined in /etc/fstab

If you are only using a single partition and you are running on a SSD change this:
to this:
If that is the case you could just put fstrim / as your cron job instead of that entire script like this
fstrim /

Here is a SSD guide:

share|improve this answer

You are likely trying to TRIM a file system which doesn't have TRIM support under linux. You can't do anything with that. What type of filesystem are you trying to TRIM?

share|improve this answer
How can we determine if a file system supports TRIM? – Anjali Raman Jan 5 '14 at 1:48
@AnjaliRaman You try to trim it, and if it reports that operation not supported then it is not supported. Under linux the following file systems support TRIM: Ext4, Ext3, Btrfs, FAT, GFS2, XFS, NILFS2 and OCFS2. (AFAIK) – falconer Jan 5 '14 at 10:52
Thanks a lot. I thought there might be some command to see whether the directory is TRIm supported. – Anjali Raman Jan 6 '14 at 17:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.