rooted z3c "secure" wipe /data before sending in reapir - Xperia Z3 Compact General

Hi I finally decided to send my z3c D5803 in for repair.
I want to remove any sensitive data from the device.
It runs on rooted Android 5.1.1 and has TWRP 2.8.7.0 installed. Over the time I installed a lot of xposed modules and tweaked a lot of settings. So I really want to keep my exact system image.
I have several Questions for every step:
1. Which partitions should I backup
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
According to What should I back up in TWRP?
`The default backup options in TWRP are system, data, and boot`
1.1 Is `Kernel Image` the same as boot ?
1.2. I just go with the defualt settings ?
2. My first simple idea was to remove the external SDcard after the backup from step 1 and perform a "factory reset" using TWRP:
2.1 root and TWRP is preserved ?
3. When the phone is back from repair I just boot in recovery and recover only the /data partition from the inserted SDcard ?
3.1
Is wiping /data enough to remove all sensitive data ( password manager app) [ SdCard removed of course ] ?
What about XPOSED Modules that maybe contain sensitive data ?
4. I guess the TWRP factory reset does not secure erase data ?
4.1 Does anyone know the method that TWRP uses to remove the data from the /data partition?
-> I read about encrypt the phone but a lot of discussions say that you have to unroot before and I guess this would destroy my whole plan of just erasing the /data partition ?
4.1 Does anybody know and tested method to add a additional layer of security.
I found this:
Normal erasing via TWRP should be enough. But if you want to erase all of your data on the phone then you need to execute the TRIM command on your flash storage.
You can do this on TWRP by following the steps:
– Mount the /system partition
– Go to Advanced and then Terminal Command
– Execute the command to TRIM /system partition:
fstrim -v /system
– Execute the command to TRIM /data partition:
fstrim -v /data
– Execute the command to TRIM /cache partition:
fstrim -v /cache
When you delete data from your storage, the actual data is not cleaned but the link to the internal blocks (where the actual data is stored) is made as invalid or the block is made as dirty.
TRIM command is designed specifically for flash storage. When you execute TRIM command on flash storage, it cleans all the data of all the blocks.
NOTE:
But you need to be careful, as the TRIM actually erases block by block and flash storage has limited erase and write cycles.
Click to expand...
Click to collapse

Well personally it doesn't really matter but backup Data,System and Boot(kernel image) and if you really want to remove everything transfer pictures to your computer and wipe internal storage
And when you backup everything will be kept and when you wipe everything will be wiped including password managers and etc,and when you restore it back everything will be as you left it with everything on your device as before.

Related

[INFO] Transformer Boot Flow

I figured I'd illustrate the basic boot process flow for the Transformer. This should help conceptualize what the Transformer does when running stock Android, custom ROM with CWM Recovery, or something even more custom, like dual-booting Ubuntu. I'll add onto this as I have time and learn more.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Boot Modes
Normal Boot - By default the Transformer will boot up and load the Android boot configuration from the boot partition, which ultimately loads the OS from the System partition. Once Android loads, you'll see these partitions mounted to /boot and /system.
Recovery - When you boot the Transformer by holding Power+VolDown and then press VolUp when prompted, the Recovery partition is loaded. I don't actually know what the stock recovery looks like, since I rooted almost immediately, but this is where the ClockWorkMod (CWM) Recovery is installed. While I left this out of the diagram, this partition should have write access to most of the internal flash.
APX Mode - When you boot the Transformer by holding Power+VolUp, APX mode is started. This is a bit different from the other two boot modes, as the internal flash isn't used. Instead the APX Mode is booted from another read-only chip, which has direct write-access to the entire internal flash. This is the mode that nvflash communicates with to backup from or write to the flash. If your Transformer is nvflash-able, you should also be un-brickable because of this mode.
Partitions
Boot - This partition stored the boot configuration for Android. As with any Linux-based operating system, this partition is necessary to start the OS. Eventually the remaining OS files are loaded from the System partition.
System - This is where most of the Android OS files are located. Generally this partition is mounted as read-only, as removing or editing the wrong file could bork your Android installation.
Recovery - This partition stores the recovery software, such as the stock recovery or ClockWorkMod (CWM) Recovery.
Data - This partition is used for application and user data storage. This is generally the largest partition, so some custom configurations (such as dual-boot Ubuntu) will shrink this partition to steal some extra space for their own use.
Cache - This partition is used for Android cache. As I don't know much about how Android uses this partition, I don't have a better explanation.
Notes:
Please reply with any requests or fixes. This is a Work-In-Progress.
Reserved for future use.
Any boot involving a kernel, so all operating systems, and recovery mode the boot flow is Bootrom reads BCT, BCT tells of the device config, then the PT is read, and EBT is located from that and booted, bootmode selection is done via the bootloader.
APX boot is bootrom -> USB recovery mode, bootrom is listening to the GPIO on boot, if found it drops back into the internal nv3pserver for nvflash connectivity, nothing is accessed that is not on the Tegra2 SoC
Awesome. Thanks, lilstevie. I'll update the diagram tonight.

Storage issue on lollipop please help

Yesterday I flashed 5.0 lollipop on my nexus 7 ,it is a 16 GB model but now it says that my total storage is 6GB and that's definitely too low. Can someone help??
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my Nexus 7 using XDA Free mobile app
very common problem for nexus 4 & 7
http://forum.xda-developers.com/nexus-4/general/how-to-fix-internal-storage-16gb-8gb-t2033692
Same thing happened to me.
Sent from my Nexus 7 using XDA Free mobile app
Factory reset I've read fixes it. Of course you will lose everything.
Sent from my Nexus 7 using XDA Free mobile app
striker59 said:
Of course you will lose everything.
Click to expand...
Click to collapse
That's not true, a factory reset wipes /data, so all app data and settings are lost, but the internal storage /sdcard remains intact.
But of course a backup before doing such things is always a good idea.
luckyrumo said:
That's not true, a factory reset wipes /data, so all app data and settings are lost, but the internal storage /sdcard remains intact.
But of course a backup before doing such things is always a good idea.
Click to expand...
Click to collapse
Uh, no.
The only way to fix the problem is to recreate the entire filesystem, which completely obliterates the old filesystem. What you are thinking of is the behavior of the "factory reset" procedure of CUSTOM recoveries such as TWRP or CWM which behave the way you describe: they remove all files except those in /data/media (the /SDcard is at /data/media/0 for the first user), but otherwise leave the filesystem intact ... and therefore the total size available.
The "factory reset" procedure of the STOCK recovery apparently does re-initialize the ext4 filesystem. So if you are having the "6 GB problem", it is the STOCK recovery's "factory reset" procedure that you want.
But "make a backup" is always good advise, so do that first.
bftb0 said:
Uh, no.
The only way to fix the problem is to recreate the entire filesystem, which completely obliterates the old filesystem. What you are thinking of is the behavior of the "factory reset" procedure of CUSTOM recoveries such as TWRP or CWM which behave the way you describe: they remove all files except those in /data/media (the /SDcard is at /data/media/0 for the first user), but otherwise leave the filesystem intact ... and therefore the total size available.
The "factory reset" procedure of the STOCK recovery apparently does re-initialize the ext4 filesystem. So if you are having the "6 GB problem", it is the STOCK recovery's "factory reset" procedure that you want.
But "make a backup" is always good advise, so do that first.
Click to expand...
Click to collapse
Oh, okay, I learned something again :embarrassed:. I've never used stock recovery, hadn't expected that there's such a difference.
Yeah, the factory reset option fixed it for me.

[Q] Creating parent failed, error No space left on device while updating to Lollipop

I'm trying to side load the OTA for Lollipop using adb and the files available from Google. My device is unlocked and rooted.
I run the commands to sideload the zip file and everything seems to be working fine until I get this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I've cleared the cache partition but to no avail.
Does anyone have any insight or am I going to have to wipe everything?
Well I went ahead and did a Flash Stock + Unroot and now it's worse. No error messages. Just the android with the red triangle exclamation mark.
I'm getting fed up with this crap. Every time there is an OTA I have to jump through hoops to get it running again.
Anyone have clues about what to do now?
Skullpuck said:
Well I went ahead and did a Flash Stock + Unroot and now it's worse. No error messages. Just the android with the red triangle exclamation mark.
I'm getting fed up with this crap. Every time there is an OTA I have to jump through hoops to get it running again.
Anyone have clues about what to do now?
Click to expand...
Click to collapse
If you already flashed stock and lost you user data plus can still get into the bootloader, then I suggest using a factory image to upgrade to Lollipop. I've ignored OTA's and have been applying the factory image for a while.
Not in this case but for next time, with the aid of root, a custom recovery to make a nandroid backup, Titanium backups for apps and user data. Prior to applying a factory image save a copy of the Titanium Backup directory, the nandroid backup plus any sundry files that were not backed up to a OTG SDCard (an OTG cable plus USB SDCared reader), getting back to your specific set up is not all that complicated. Plus you get to "spring clean" any old cruft that has built up wasting internal storage.
See: How to install Android Lollipop factory image on Nexus 5, 7 and 10 (and keep your data)
I have the same problem
I had system partition full after L update. I did it with factory image. I had to remove some apps from system to get adaway, busybox and so on working.
How to get more system space??
veepee78 said:
I had system partition full after L update. I did it with factory image. I had to remove some apps from system to get adaway, busybox and so on working.
How to get more system space??
Click to expand...
Click to collapse
Deleting apps from /system is the only option that I've heard of. You cannot change the /system partition size even if you have spare internal storage. If you're rooted then this sounds worse than it is because there is plenty of apps you likely do not use (e.g. some of the google apps like news). You're also unlikely to use some of the foreign language apps. Even some of the main Google aps get updated out side of /system making the the /system apks redundant.
Without even trying hard I removed 86MBs worth then installed all I wanted (e.g. busybox, Viper4Android ... etc) and still have 54Mg free. So I could have left a lot of apps installed but I'd never use them anyway.
You can delete /system apks if your rooted with a number of different apps:
- Titanium Backup
- A Root enabled file manager like ES File Explorer
- My personal favourite System app remover (ROOT)
Lots of options.
Skullpuck, did you find a solution?
Did you guys try ADB version 1.0.32 or newer? Something has changed in the sideload command (could be only when using TWRP, not sure)

TWRP flashing issue error code 70

Hey guys i've just done full wipe and succesfuly flashed ROM but I can't flash gapps. Everytime it says : "Insufficient storage space available in System partition (blabla)" . I have about 12gb left so the free space isn't an issue I think.
System partition is not the main storage area.
I think you can check either through TWrp or through Drives application what consumes the space of system partition.
RASTAVIPER said:
System partition is not the main storage area.
I think you can check either through TWrp or through Drives application what consumes the space of system partition.
Click to expand...
Click to collapse
I am having same issue.
But I have flashed only the rom.
/system
/Data
/Cache
all were formatted before. I am still getting the same issue.
xeltos said:
I am having same issue.
But I have flashed only the rom.
/system
/Data
/Cache
all were formatted before. I am still getting the same issue.
Click to expand...
Click to collapse
If you are trying to flash Stock package of PA Gapps the size is 437MB.
Your system partition is too small. It will not fit.
Try flashing the smaller Full Modular(366MB), Mini Modular(~232MB) or Micro Modular(~182MB) Gaaps
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You can then install any missing Google apps you desire from Google Play . They will be installed as user apps instead of system apps.
I did this:
1. Install newest TWRP app
2. Download CM-12.1-20151101-UNOFFICIAL-maguro.zip (or newer) to your device
3. Download open_gapps-arm-5.1-pico-20151104.zip (or newer) to your device
4. Run TWRP
5. Wipe and factory reset
6. Install CM-12.1-20151101-UNOFFICIAL-maguro.zip
7. Install open_gapps-arm-5.1-pico-20151104.zip
8. Reboot
Voila
the reason for that you trying to install all Gaps package which is not possible for your device according to space calculation
To fix this problem do these steps
1-create text file and name it ( gaps-config)
2-add these lines
Exclude Books
Exclude Chrome
Exclude CloudPrint
Exclude Docs
Exclude Earth
Exclude ExchangeGoogle
Exclude Slides
Exclude Sheets
Exclude NewsWidget
Exclude PlayGames
Exclude Keep
Exclude Hangouts
Exclude Fitness
then save the text file in the same gaps.zip file directory
3-now flash the gaps and done..
note you can exclude more aps or include other as you want as long as you had the space requirements .
i just downloaded only one Gaps package which is the full package , and then i customize which app to include or exclude and here is my review related to this error ( skip to 13 minute )

PLEASE HELP! Trying to recover lost Mi9T data and almost there

Gentlemen. And Ladies.
First of all I'd like to all thank you for all your work and input as community of xda-developers.
I came here seeking for your help. I am trying to recover the pictures and videos I lost after accidentally performing factory reset. Since the factory reset I havent been using the phone so as least data as possible is overwritten. My phone is rooted and have Busybox installed.
So far I was able to copy a user data disk (I hope I chose correct one: '/dev/block/bootdevice/by-name/userdata' ) via adb from the device to my computer as a file 'userdata.raw' which has around 111gb. I've tried to mount the 'userdata.raw' as a virtual disk using OSFMount - this resulted in appearance of D: disk partition but it's not accessible via Windows Explorer (as it was corrupted). Afterwards I tried to recover data from that mounted D: drive using ActiveUNDELETE but the program doesnt see that D: Disk in the volumes list. Now I am trying to recover using qphotorec which is able to see D: drive as f2fs system. I'm also trying to restore the data directly from that 'userdata.raw' file using qphotorec. But both of these methods result only in outputting the one file: 'f60340268.swf' of around 3gb in size. Overall overview of the whole process is attached on the overwiew screenshot.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now I think there are three scenarios but may be more:
I chose the wrong userdata disk while copying it via adb to on my PC. I picked '/dev/block/bootdevice/by-name/userdata'.
On the screenshot above you can see all the other locations which 'adb shell' -> 'su' -> 'df' outputs (number 1. window in left top corner)
I am doing something wrong while mounting the 'userdata.raw' as a virtual disk thus ActiveUNDELETE can't see it. Or doing something wrong while recovering the data directly from 'userdata.raw'
Contents of '/dev/block/bootdevice/by-name/userdata' is encrypted which results in receiving odd 'f60340268.swf'
file weighing around 3gb. You can see both the contents of 'f60340268.swf' and'userdata.raw' after running strings command on them. See attached Strings screenshots.
It feels like I am almost there but I got stuck and dont know how to approach this any further.
For copying user data disk from mi9t to my pc I followed guides I found here: https://stackoverflow.com/a/41397418
Windows won't explore raw files, you have to use linux or some software to recover your data, like minitool mobile recovery
yaro666 said:
Windows won't explore raw files, you have to use linux or some software to recover your data, like minitool mobile recovery
Click to expand...
Click to collapse
I tried minitool mobile recovery but no luck. I also tried minitool and diskdrill but same results - both of these apps dont see the monuted userdata.raw as D: drive. As it was not there. Windows Disk Management doesnt see it neither.
The only app that's able to see it is qphotorec but it determines file system type as f2fs
anyone?

Categories

Resources