Discussion:
[android-porting] system from SD card -- data partition gets corrupted after few hard reboots
Michał Stawiński
2018-04-16 23:44:01 UTC
Permalink
Hi,
My AOSP device (atuomation processes UI) asks for a password (thinks data
partition is encrypted) after 5-50 'hard' reboots. It's caused by data
partition getting corrupted, when device is abruptly power-cycled, and
SD-card decides to 'break'.

My device (IMX6QP-based):
- no battery - at risk of sudden power loss
- runs from SD card
- uses MBR partitioning (tried GPT as well)
- uses ext4 filesystem
- runs EVERYTHING from a single SD-card

"data" partition exploded on several different SD-cards, about 10 times so
far. I can't pretend the issue is not there...

After the issue occurs, data partition can be fixed on a PC using "fsck.ext4
-v /dev/sdf4" (but fsck has to be new enough to support

metadata_csum).


After it worked on PC (3 out of 3 times), I've tried forcing fsck on every
boot via fstab:

-$BD5 /data ext4 <blablabla> wait,encryptable=$BD10
+$BD5 /data ext4 <blablabla> wait,check,encryptable=$BD10


(in order to proactively 'fix' the issue on boot), but I got this:

e2fsck: /dev/block/mmcblk0p5 has unsupported feature(s): metadata_csum


TL;DR: Question: Is there any 'silver bullet' I can use to 'safely' run
AOSP from SD card, on a device that has no battery?
Any kernel options? Forcing 'sync' more often? Any hints how to 'protect
data partition' from sudden powerlosses? Any 'special' SD cards that will
work better than others?

I can probably port "proper" version of fsck to my tree and run it on every
boot, but I am not sure if this is the rigth way forward...
I also considered removing "encryptable" flag from fstab for data
partition, but I am affraid it will not change a lot -- I will still loose
data or... would I? I am actually not sure how AOSP recognizes my partition
as 'encrypted'...
--
Michal
--
--
unsubscribe: android-porting+***@googlegroups.com
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...