Results 1 to 3 of 3

Thread: Problem running fstrim on an encrypted partition

  1. #1
    Join Date
    Jun 2008
    Location
    Düsseldorf/Germany
    Posts
    283

    Default Problem running fstrim on an encrypted partition

    Hi all,

    I have two partitions (plus Swap) on a Laptop:
    T520:/home/docb # more /etc/fstab
    /dev/disk/by-id/ata-Samsung_SSD_840_EVO_1TB_S1D9NEADA00473E-part2 swap swap defaults 0 0
    /dev/disk/by-id/ata-Samsung_SSD_840_EVO_1TB_S1D9NEADA00473E-part1 / ext4 noatime,acl,user_xattr 1 1
    /dev/mapper/cr_ata-Samsung_SSD_840_EVO_1TB_S1D9NEADA00473E-part3 /home ext4 nofail,noatime 0 2
    As you can see, it is a Samsung EVO 840 SSD installed. Home partition is encrypted.
    Now, when I run fstrim:
    T520:/home/docb # fstrim -v /
    /: 70,9 GiB (76079407104 bytes) trimmed
    Thats fine so far. But:
    T520:/home/docb # fstrim -v /home
    fstrim: /home: FITRIM ioctl failed: Die Operation wird nicht unterstützt
    Translation: This operation is not supported.
    Any idea how to solve this?

  2. #2
    Join Date
    Sep 2014
    Location
    Wien
    Posts
    5

    Default Re: Problem running fstrim on an encrypted partition

    Hi,

    I had the same problem and had to (re)search for a while to find the (surprisingly simple. and obvious. in retrospect) solution here: http://blog.neutrino.es/2013/howto-p...m-and-dmcrypt/ : by default, neither LVM nor DM-crypt pass any discard (TRIM) commands. The text I linked shows how to change these settings. In short, for the respective filesystem, add the filesystem option discard in /etc/crypttab; and set issue_discards to 1 in /etc/lvm/lvm.conf). Then you have to rebuild initramfs by executing mkinitrd, then you'll have to reboot - and that's all. Afterwards, the fstrim command will work again.

    Best regards,
    Christian


    Quote Originally Posted by DocB View Post
    Hi all,

    I have two partitions (plus Swap) on a Laptop:

    As you can see, it is a Samsung EVO 840 SSD installed. Home partition is encrypted.
    Now, when I run fstrim:

    Thats fine so far. But:

    Translation: This operation is not supported.
    Any idea how to solve this?

  3. #3
    Join Date
    Jun 2008
    Location
    Düsseldorf/Germany
    Posts
    283

    Default Re: Problem running fstrim on an encrypted partition

    Hi Christian,
    thanks for the hint!
    By chance, the german computer-mag c't had a similar hint in its issue 22/2014.
    After applying the extent to /etc/crypttab, the fstrim command did not issue any error message, but the 'blocks used' on the encrypted device (/home) were before and after trim the same, unlike on '/'. So it is very likely that it still failed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •