Hide Forgot
Description of problem: fstrim fails despite the fact the SSD disk supports TRIM. # fstrim -v / fstrim: /: the discard operation is not supported $ sudo hdparm -I /dev/sda | grep TRIM * Data Set Management TRIM supported (limit 8 blocks) $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 500M 0 part /boot └─sda2 8:2 0 465.3G 0 part └─luks-87671703-29ad-4572-a663-bda2d7bb1ac7 253:0 0 465.3G 0 crypt ├─rhel_dhcp--27--244-root 253:1 0 50G 0 lvm / └─rhel_dhcp--27--244-home 253:2 0 415.3G 0 lvm /home $ dmesg |grep SSD [ 1.423002] ata1.00: ATA-9: Samsung SSD 850 EVO 500GB, EMT02B6Q, max UDMA/133 [ 1.424294] scsi 0:0:0:0: Direct-Access ATA Samsung SSD 850 2B6Q PQ: 0 ANSI: 5 $ uname -a Linux annapurna 3.10.0-327.36.2.el7.x86_64 #1 SMP Tue Sep 27 16:01:21 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Hi Maurizio, dm-crypt doesn't enable discard by default and this is not going to change (in kernel). First due to security reasons and secondly due to fact that you may destroy existing hidden volume in legacy true-crypt containers with discard enabled by default. Single fstrim on such volumes and hidden volume is gone for good:) On the other hand starting with cryptsetup 2.0 we will change the userspace so that any LUKSv2 containers is by default activated with discard enabled. Wrt to LUKSv1 you may change the default by adding appropriate discard option in /etc/crypttab.