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 have a Thinkpad X60s with an OSZ agility SSD. I use ext2.

I read that I should execute the trim command from time to time, however, this command doesn't work on my machine:

boris@boris-ThinkPad-X60s:~$ fstrim /
fstrim: /: FITRIM ioctl failed: Inappropriate ioctl for device

What will be the consequences of me not using it? Will it affect speed, SSD life etc?

Why isn't the command working and what are the possible solutions to get it working?

share|improve this question

Update: I wrote the answer below before seeing you were using ext2. I keep the answer for reference in case anyone else has a similar problem because of LUKS or LVM.

For your case however the anser is different: ext2 does not support trimming, only ext4 or btrfs do.

----- original answer -----

Make sure to activate trim support on all filesystem abstraction layers. In particular, LVM and / or dm-crypt come to mind here!

  1. Activate trim support in lvm: /etc/lvm/lvm.conf

    issue_discards = 1
  2. Activate trim support in dm-crypt/luks: /etc/crypttab

    sda1_crypt UUID=<YOUR_DISKS_UUID> none luks,**discard**

    (adapt to your UUID and partition)

  3. write changes to your initrd:

    sudo update-initramfs -u
  4. reboot

share|improve this answer
fstrim works with all ext*, only ext4 and btrfs do it automaticly on deletion of files – borrel Oct 29 '13 at 1:31
@borrel I'm seeing it not work with ext3 – Norman Ramsey Jan 23 '14 at 3:09
@NormanRamsey for me it works, unless you have snapshots of the volume in lvm – borrel Feb 3 '14 at 15:55

You need to run fstrim as root. Try:

sudo fstrim /
share|improve this answer
same thing..... – Bobby Marinoff Apr 4 '13 at 20:53

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.