Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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 at 3:09
    
@NormanRamsey for me it works, unless you have snapshots of the volume in lvm –  borrel Feb 3 at 15:55

You need to run fstrim as root. Try:

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

Your Answer

 
discard

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.