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?

Related links:

  • Re: 'discard' option: isn't it the other way around? Using TRIM on any kind of flash device should increase performance (not decrease it) because the FTL layer becomes aware that it no longer has to track a particular block (maintain the mapping from logical block to physical block, refresh the block once in a while for wear leveling, etc...)
    – Celada
    Jun 29, 2013 at 14:42
  • Technically yes, but issuing the TRIM command after each delete will degrade usability performance as seen in the second link I posted, a deletion of 30,000+ files totaling ~450MB followed by a sync command results in ~40 seconds of wait time.
    – Alistair
    Jun 29, 2013 at 14:54
  • TRIM is merely a command that allows firmware to unmap specified sector and garbage collect at a later time. I doubt it will affect performance negatively. Feb 16 at 14:26
  • BTW the link to blog doesn't work for me. Feb 16 at 15:26
  • 1
    I’m voting to close this question because question is based on old eMMC standard and older version of Linux + seems to be based on flawed understanding of TRIM + blog supporting assumption is no longer accessible. Feb 16 at 15:38

1 Answer 1


You can run fstrim once in a while. I run it daily through cron on SSD disks (desktop PC).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .