Fix SDS Reboots with TRIM
Hi all,
I have a i9300 with insane chip (SDS - Sudden Death Syndrome). When doing a clean install of a new ROM I always had random freezes or reboots. I have always provoked them with DFG (Dummy File Generator). And after running it a few times, I never (or only a long time after) had issues. The DFG workaround always seemed to work for me.
But not this time....
Environment:
Symptoms:
When running DFG, at some point the phone suddenly reboots (without shutting down). Sometimes it was hung in a bootloop afterwards (i exited after letting it loop about 6h). Sometimes it rebuilds the cache on startup (Optimizing App 1 from 100...). I considered everything of this as normal behavior when having the SDS.
The strange thing this time was: I normally had to run DFG for three or four times and had a stable system afterwards. This time (yesterday) the phone rebooted randomly every time on each and every run. I tried over 30 times and never got a stable system. Sometimes it crashed at 30 %, sometimes at 100 %, then again at 15 %. Totally random.
Thinking this was odd, I googled a lot and found nothing specific. Until I had the idea...
Idea:
What if deleting the DFG File after the reboot doesn't work as expected? What if the storage cells get scrambled by over provisioning and somehow the one bad cell is used again and again and can't be masked as bad by the kernel, because it has to be used somehow...
Solution:
After running DFG, letting it reboot and deleting the File (by Settings -> Apps -> Dummy File Generator -> Delete Data) I ran the TRIM command with
Trimmer (fstrim).
When I run DFG afterwards it runs all the way through until the last bit and then suddenly reboots. So I guess the kernel uses the bad cell as last resort. IT ****ING WORKS FINALLY!

To verify my success I repeated the Cycle (DFG -> Reboot -> Delete -> TRIM -> DFG) three times. My phone only reboots when writing the very last available bit.
So I really hope this helps you if DFG doesn't work as expected, like with my phone.
tl;dr
When Dummy File Generator (DFG) does not seem to help you do:
- Run Dummy File Generator -> Generate(FULL) on internal memory
- After finished or reboot, delete Data at Settings -> Apps -> Dummy File Generator -> Delete Data
- Run TRIM command with Trimmer (fstrim)
- Repeat until your Phone only freezes / reboots when DFG filled nearly 100 %
- Enjoy your stable ROM
Greets
Beneter