I am looking into Android secure erase functions and realized a few things:
Android uses eMMC as its storage media, eMMC standards are set by the JEDEC organization (currently most of the manufactured eMMCs are >= 4.41). The 4.41 eMMC standard describes two commands SECURE ERASE and SECURE TRIM, and that these commands should be supported from now on for every eMMC manufactured. That's great, but Android runs ext4 as a filesystem, and I haven't been able to find if ext4 has a way of communicating with the storage media an eMMC SECURE ERASE command.
I know that mounting ext4 with the 'discard' option is one way of enabling TRIM after every deletion, but it is also a poor solution as it will severely slow down performance since the storage has to TRIM after each delete command.
So my question, is there a way of sending a SECURE ERASE command from an ext4 file system short of mounting with the 'discard' option?
- JEDEC eMMC standard: http://www.jedec.org/sites/default/files/Victor_Tsai.pdf
- Discard option on ext4 and performance degradation: https://patrick-nagel.net/blog/archives/337