On Wed, Mar 25, 2020 at 2:41 PM John wrote:
> I can confirm that it is true with an encrypted ext4 partition.  I get
> the same error, "fstrim: /mnt/test: the discard operation is not
> supported" when I try it there on the same device.  Unless there is a
> good reason for it, not having discard on LUKS encrypted partitions
> seems like a pretty serious omission.  Perhaps it is intentional.

I see now from searching that this is by design,
https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Discard/TRIM_support_for_solid_state_drives_(SSD)

I added the "discard" option to the entry in /etc/crypttab and
rebooted. I am now able to get a successful run of fstrim on this F2FS
partition:

# fstrim -v /mnt/media
/mnt/media: 0 B (0 bytes) trimmed

Is it normal to return 0 bytes trimmed for F2FS partitions?  By
contrast, if I go to my test SSD, create a LUKS partition, open it
with the --allow-discards option to cryptsetup, format it to ext4,
mount that and then run fstrim on it, I am getting non-0 values for
fstrim when I run it:

# fstrim -v /mnt/test_crypt_ext4
/mnt/test_crypt_ext4: 3.9 GiB (4123463680 bytes) trimmed

So I think something still isn't quite right with F2FS over crypto_LUKS.

Thanks for the help!


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to