I have a rooted Lenovo A369i. I use LagFix (fstrim) to TRIM partitions. Previously it was working well with /data but after I encrypted my phone it doesn't. I decrypted my phone by formatting. But now in the app it shows /data partition having kernel or hardware issues. It's not hardware because before encryption it was working well.
- 20,353
- 3
- 70
- 213
- 159
- 1
- 5
1 Answers
Just if someone stumbles upon this, following conditions should be met for TRIM to work:
Underlying hardware (eMMC) must support TRIM. For instance
Redmi Note 4comes with MCP: RX1BMB which containseMMC 5.1and hence supports TRIM.Kernel must have support for TRIM, was added in v3.1, but it is disabled by default and
volddaemon must mapuserdatapartition withallow_discardsoption, which it didn't in my case.If your
/datapartition is encrypted (FDE), Support for allow_discards was added in version 1.11.0 (1) of device-mapper crypt (1) target, but may not work e.g. on devices with Qualcomm SoCs. See this issue for more details.Filesystem must also support TRIM (1) (except if you want to TRIM a whole partition with
blkdiscard). Android usesext4orf2fson/datapartition, both support TRIM.
If these conditions meet, you can perform TRIM manually (fstrim -v /data) or periodically (scheduled service) or continuously (with discard mount option). See this answer for details on how often you should perform fstrim.
- 20,353
- 3
- 70
- 213