Unprecedented Corruption in Adopted Storage: Please Insert SD Card Again

Search This thread

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
I have adopted my whole SD card and I have flashed Syberia custom kernel latest version and SELinux is permissive. It was working fine until I have used SWAPRAM by HuskyDG magisk module and rebooted It became unmountable though the encryption key exists in /data/misc/vold, but It does not work and even though I tried “sm mount private:179,194”, It seems applied as It does not throw any error but still It is not working after I recheck with “sm list-volumes” as It stills show unmountable. My /data is decrypted, but the SD card is not decrypted. How can I decrypt the card without losing data and prevent the problem from happening again?
 

Droidriven

Senior Member
Jan 27, 2014
15,877
11
5,478
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
I have adopted my whole SD card and I have flashed Syberia custom kernel latest version and SELinux is permissive. It was working fine until I have used SWAPRAM by HuskyDG magisk module and rebooted It became unmountable though the encryption key exists in /data/misc/vold, but It does not work and even though I tried “sm mount private:179,194”, It seems applied as It does not throw any error but still It is not working after I recheck with “sm list-volumes” as It stills show unmountable. My /data is decrypted, but the SD card is not decrypted. How can I decrypt the card without losing data and prevent the problem from happening again?
Try flashing the kernel you had before. Then undo the Adoptable Storage process to return to default storage settings. Then boot into recovery and wipe the cache partition and dalvik cache. Then install the new kernel and reboot into system. Then set up Adoptable Storage again.
 

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
Try flashing the kernel you had before. Then undo the Adoptable Storage process to return to default storage settings. Then boot into recovery and wipe the cache partition and dalvik cache. Then install the new kernel and reboot into system. Then set up Adoptable Storage again.
Well, I was trying to recover, not to destroy the data in my SD. It seems whenever It changes fingerprint and/or use swap file It breaks along with /data.
 

Droidriven

Senior Member
Jan 27, 2014
15,877
11
5,478
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
After Ejecting SD temporally I managed to enter to TWRP, but It shows (I/O error) When I try to wipe Cache and Dalvik-Cache
When you setup adoptable storage, the external sdcard became incorporated into internal as if they are one complete drive. TWRP is looking for the external sdcard so it can wipe the cache partition.
 

Droidriven

Senior Member
Jan 27, 2014
15,877
11
5,478
NC
Verizon Samsung Galaxy S III
HTC Thunderbolt
Why should I undo the Adoptable Storage then?
I'm saying to return the device to an unmodified stock working state without the custom kernel and without Adoptable Storage. Then you can install your custom kernel then setup adoptable storage again.

If flashing the kernel caused the issue and if the kernel and adoptable storage are able to work together, then, what I posted would be the best way to get to that point.
 

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
I'm saying to return the device to an unmodified stock working state without the custom kernel and without Adoptable Storage. Then you can install your custom kernel then setup adoptable storage again.

If flashing the kernel caused the issue and if the kernel and adoptable storage are able to work together, then, what I posted would be the best way to get to that point.
I can't verify if It is a kernel problem. I need some many experiences. Still, I had to flash Syberia kernel for SELinux to be permissive. However, can you compile this new updated kernel for me, hopefully It fixes it? https://github.com/hi6250-oss-old/android_kernel_huawei_hi6250-8
 

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
I'm saying to return the device to an unmodified stock working state without the custom kernel and without Adoptable Storage. Then you can install your custom kernel then setup adoptable storage again.

If flashing the kernel caused the issue and if the kernel and adoptable storage are able to work together, then, what I posted would be the best way to get to that point.
I was trying to insert my SD using Syberia kernel into the EMUI 8 ROM, but I could not and the UI gets freeze until I flashed stock kernel. I become able to use my SD. However, I cannot use this kernel on GSI because It is not permissive. Therefore, It is a kernel issue as far as I can see.
 

xXx yYy

Senior Member
Feb 4, 2017
1,190
6
230
Android's kernel is the most important component to run a mobile device as it is a bridge between hardware and software of a mobile device. Without kernel it is not possible for a device to run. Installing a new kernel can be a bit dicey, but when done correctly there’s really a minimal risk. But, it is not necessary to flash a Custom Kernel in your device unless you want some additional features because the Stock Kernel provided by OEMs works out of the box and without any issues.

IMO a replacement of Stock Kernel by a Custom Kernel like Syberia doesn't always benefit you, especially if it wasn't compiled for the mobile device in question.
 
Last edited:

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
Android's kernel is the most important component to run a mobile device as it is a bridge between hardware and software of a mobile device. Without kernel it is not possible for a device to run. Installing a new kernel can be a bit dicey, but when done correctly there’s really a minimal risk. But, it is not necessary to flash a Custom Kernel in your device unless you want some additional features because the Stock Kernel provided by OEMs works out of the box and without any issues.

IMO a replacement of Stock Kernel by a Custom Kernel like Syberia doesn't always benefit you, especially if it wasn't compiled for the mobile device in question.
Stock kernel does not support Selinux Permissive
 

xXx yYy

Senior Member
Feb 4, 2017
1,190
6
230
Stock kernel does not support Selinux Permissive
This statement for me is absolute nonsense. Each Android's SELinux can set to permissive if Android is got rooted.

Depending on how your device was rooted and what Android ROM your running will determine how you can disable it. The first thing to try is:

adb shell su 0 setenforce 0

This is NOT the same as:

adb shell setenforce 0

The execute on su causes a domain transition from shell (which cannot setenforce) into the su domain (which can call setenforce).
 

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
This statement for me is absolute nonsense. Each Android's SELinux can set to permissive if Android is got rooted.

Depending on how your device was rooted and what Android ROM your running will determine how you can disable it. The first thing to try is:

adb shell su 0 setenforce 0

This is NOT the same as:

adb shell setenforce 0

The execute on su causes a domain transition from shell (which cannot setenforce) into the su domain (which can call setenforce).
Still, It throws an error until I change the kernel. It is something famous with HW Hi6250.
 

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
This statement for me is absolute nonsense. Each Android's SELinux can set to permissive if Android is got rooted.

Depending on how your device was rooted and what Android ROM your running will determine how you can disable it. The first thing to try is:

adb shell su 0 setenforce 0

This is NOT the same as:

adb shell setenforce 0

The execute on su causes a domain transition from shell (which cannot setenforce) into the su domain (which can call setenforce).
This is the error: setenforce: Couldn't set enforcing status to '0': Invalid argument
 

tberma

Senior Member
Dec 29, 2015
111
11
Fez
www.facebook.com
I went through a big error when the battery drained and the phone shutdown and could not turn it back on and redirect me to ERecovery until I flash the stock kernel. I booted, but ADB needs to be authorized from TWRP, therefore I have launched the command in Termux: "su" then "setenforce permissive": same error: Invalid argument.