<div dir="ltr">Yes, it&#39;s an issue in kernel. <div><br></div><div>As dm-crypt/luks layer isn&#39;t passing TRIM to the underlying device.</div><div><br></div><div>/boot is not encrypted that&#39;s why it works for you.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">сб, 27 апр. 2019 г. в 11:11, Narcis Garcia &lt;<a href="mailto:informatica@actiu.net">informatica@actiu.net</a>&gt;:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <p>See in the case that /dev/sda1 (Directly mounted as Ext4 on
      /boot) works with Trim/Discard.<br>
      It&#39;s the sda2_crypt (layer over sda2) that is not detected to be
      trimmable. Devuan&#39;s stock kernel does.<br>
      <br>
      CentOS issue #6548 may not be this same bug; I&#39;ve tested now with
      CentOS 6.8 with a similar (but not same) result<b>:</b><br>
    </p>
    <p><tt>$ lsb_release -d</tt><tt><br>
      </tt><tt>Description:    CentOS release 6.8 (Final)</tt><br>
    </p>
    <p><tt>$ uname -a</tt><tt><br>
      </tt><tt>Linux localhost.localdomain 2.6.32-642.el6.x86_64 #1 SMP
        Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux</tt></p>
    <p><tt>$ lsblk --discard /dev/sda</tt><tt><br>
      </tt><tt>NAME                                                
        DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO</tt><tt><br>
      </tt><tt>sda                                                        
        0      512B       2G         0</tt><tt><br>
      </tt><tt>├─sda1                                                     
        0      512B       2G         0</tt><tt><br>
      </tt><tt>└─sda2                                                     
        0      512B       2G         0</tt><tt><br>
      </tt><tt>  └─luks-f691f48b-8556-487d-ac64-50daa99ed4c9
        (dm-0)        0      512B       2G         0</tt></p>
    <p><tt>$ cat /etc/crypttab</tt><tt><br>
      </tt><tt>luks-f691f48b-8556-487d-ac64-50daa99ed4c9
        UUID=f691f48b-8556-487d-ac64-50daa99ed4c9 none luks,discard</tt></p>
    <p><tt>$ mount | grep -e discard</tt><tt><br>
      </tt><tt>/dev/mapper/luks-f691f48b-8556-487d-ac64-50daa99ed4c9 on
        / type ext4 (rw,discard)</tt><tt><br>
      </tt><tt>/dev/sda1 on /boot type ext4 (rw,discard)</tt></p>
    <p><tt>$ </tt><tt>sudo fstrim /boot<br>
        # (same result as Devuan/1 and OpenVZ/6 kernel: success)<br>
      </tt></p>
    <p><tt>$ sudo fstrim /</tt><tt><br>
      </tt><tt>fstrim: /: FITRIM ioctl failed: Operation not supported</tt></p>
    <p><br>
    </p>
    <div class="gmail-m_8223540402862015579moz-cite-prefix">El 26/4/19 a les 21:36, spameden ha
      escrit:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hi.
        <div><br>
        </div>
        <div>I&#39;ve asked this question years ago (in 2013): <a href="https://lists.openvz.org/pipermail/users/2013-August/005250.html" target="_blank">https://lists.openvz.org/pipermail/users/2013-August/005250.html</a></div>
        <div><br>
        </div>
        <div>Let me know if it helps, but this bug should have been
          fixed in CentOS and RHEL at least: <a href="https://bugs.centos.org/view.php?id=6548" target="_blank">https://bugs.centos.org/view.php?id=6548</a></div>
        <div><br>
        </div>
        <div>Maybe OpenVZ maintainers didn&#39;t pick up this fix in the
          openvz6 legacy kernel?</div>
        <div><br>
        </div>
        <div>Thanks.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">ср, 10 апр. 2019 г. в 10:45,
          Narcis Garcia &lt;<a href="mailto:informatica@actiu.net" target="_blank">informatica@actiu.net</a>&gt;:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Does
          anybody know how can I solve this?<br>
          <br>
          $ lsb_release -d<br>
          Description:    Devuan GNU/Linux 1.0 (jessie)<br>
          <br>
          $ uname -a<br>
          Linux bell1 2.6.32-openvz-042stab134.8-amd64 #1 SMP Fri Dec 7
          17:18:40<br>
          MSK 2018 x86_64 GNU/Linux<br>
          <br>
          $ lsblk --discard /dev/sda<br>
          NAME           DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO<br>
          sda                   0      512B       2G         0<br>
          ├─sda1                0      512B       2G         0<br>
          └─sda2                0      512B       2G         0<br>
            └─sda2_crypt        0        0B       0B         0<br>
          <br>
          $ cat /etc/crypttab<br>
          sda2_crypt UUID=***** none luks,discard<br>
          <br>
          $ mount | grep -e discard<br>
          /dev/mapper/sda2_crypt on / type ext4<br>
          (rw,noatime,errors=remount-ro,barrier=1,data=ordered,discard)<br>
          /dev/sda1 on /boot type ext4
          (rw,relatime,barrier=1,data=ordered,discard)<br>
          <br>
          $ sudo fstrim /<br>
          fstrim: /: the discard operation is not supported<br>
          <br>
          Thank you.<br>
          <br>
          <br>
          _______________________________________________<br>
          Users mailing list<br>
          <a href="mailto:Users@openvz.org" target="_blank">Users@openvz.org</a><br>
          <a href="https://lists.openvz.org/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/users</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="gmail-m_8223540402862015579mimeAttachmentHeader"></fieldset>
      <pre class="gmail-m_8223540402862015579moz-quote-pre">_______________________________________________
Users mailing list
<a class="gmail-m_8223540402862015579moz-txt-link-abbreviated" href="mailto:Users@openvz.org" target="_blank">Users@openvz.org</a>
<a class="gmail-m_8223540402862015579moz-txt-link-freetext" href="https://lists.openvz.org/mailman/listinfo/users" target="_blank">https://lists.openvz.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openvz.org" target="_blank">Users@openvz.org</a><br>
<a href="https://lists.openvz.org/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/users</a><br>
</blockquote></div>