[GUIDE] Re-partition your device using REPIT - Galaxy S III General

You might have seen this guide on XDA, but is out-dated and only seems to work on stock firmware. What about people people running CM13, will it work, or will it brick your device?
This guide is updated and works with CM13 tested by me, it was also written with the i9300 16GB model in mind.
FAQ: next post
I take NO responcebility for any bricks, that's on you. Exactly like rooting, or installing anything 3:rd party (right?). Either is is my responsibility if any data is lost.
If you don't follow the guide, and adventure on your own, there's no one to blame but yourself when **** hits the fan.
Now, let's have a look at my partitions before modifying them (kB):
Code:
Filesystem Total Used Available Use% Mounted on
mmcblk0p8 1032088 17732 1014356 2% /cache
mmcblk0p12 11901576 6355436 5546140 53% /data
mmcblk0p12 11901576 6355436 5546140 53% /sdcard
mmcblk0p10 564416 8964 555452 2% /preload
mmcblk0p9 1548144 632704 915440 41% /system
mmcblk0p3 20144 9568 10576 47% /efs
As you can see, stock paritioning is bad. /preload and /cache has a lot of available space which takes up a lot of unnecessary space.
We can minimize all the partitions and use the space to increase your internal storage, neat; let's do it!
1. Check for buggy eMMC chip
First of all we'll be checking if your chip is possible to SDS (sudden death syndrome) which basicly corrupts your eMMC (internal storage) chip.
This only effects the 16GB model, if you're on another model just skip to the flashing part.
A. Download the app eMMC Brickbug Check app from the Play Store.
B. Check eMMC
Check if your device has the following under eMMC chip:
Type: VTU00M
FwRev: 0xF1
If the values match, you should update to the latest ROM + kernel available ASAP, which should fix SDS, if you don't; your eMMC chip might corrupt under the process of flashing REPIT.
2. Flashing guide
A. Before we begin
- Make sure that you're running the latest version of TWRP (i9300, i9305). Any other recovery and the script will NOT work.
- Do NOT continue if you're running stock, or planning to do so. This script is only tested on official CM13.
- Make sure you're plugged into a power source, and not a computer; or else partitions may fail to un-mount.
- Do a backup of your rare cat images so they don't get lost in the worst scenario.
- (optional) If you want to configure the script, see this.
B. Download required tool
We'll be using ourselves with the tool REPIT made by @Lanchon.
Without it I wouldn't make this guide as it is the only(CN) flexible tool for modifying partitions in Android.
Download the required flashable zip file: [updated 2017-01-22]
- i9300 - here
- i9305 - here
Make sure you DON'T rename it; copy it to your device.
C. Boot into recovery - volume up + home button + power button when powered off
D. Flash the zip file
- This process is a really long one, do NOT interrupt the process.
- If the flashing fails, it may tell you that it copied itself to /tmp, navigate to /tmp and flash the script again.
- If x partition fails to un-mount, try un-mounting it via TWRP > Mount.
Inside TWRP navigate to Install > Navigate to saved REPIT and select > Swipe to confirm flash.
3. Done!
You may now restart your device and verify the extra utilized internal storage.
It's not that hard eh? That's because @Lanchon did a great job on his project available on GitHub. Him and I worked closely on #22 to add support for the i9300.
After re-partitioning (still kB):
Code:
Filesystem Total Used Available Use% Mounted on
mmcblk0p8 32240 4200 26404 14% /cache
mmcblk0p12 13457732 574316 12199796 4% /data
mmcblk0p12 13457732 574316 12199796 4% /sdcard
mmcblk0p10 8048 4120 3520 54% /preload
mmcblk0p9 1548144 638168 909976 41% /system
mmcblk0p3 20144 9568 10576 47% /efs
It seems like we've gained 1.5GB in local storage, hoorah! Totally didn't steal from other partitions
Worth it? (my opinion)
Unless you REALLY need that 1.5GB of extra storage; NO, not at all.
On Android 6+ (CM13) sd-cards are now implemented like normal internal storage. Just buy a 8GB micro sd-card which costs a couple of bucks these days and save yourself some trouble.
Not only that, recently a user possibly got SDS (sudden death syndrome, do your own research) after flashing REPIT. Did my own research and I updated the guide with a step to check for this buggy eMMC chip.
Credit:
- @Lanchon for REPIT.
- @forumber2 for original guide.

QnA:
The questions are kinda copied from the old guide.
Q: Why is /cache a large partition?
A: It's because stock software updates saves in the partition. The partition was extended(CN) when upgrading to Android 4.3, as the update was so large, the cache partition had to be as well. AOSP does NOT use the partition when updating.
Q: What is the /preload partition for?
A: It's only really used if you bought the phone locked. Many mobile operators put in extra apps, and bloatware too in the partition only utilized in stock firmware; and even then... There's some random Samsung crap too. REPIT minimizes the partition.
Q: Any consequences of flashing?
A: Yes, you will NOT be able to install stock firmwares (assuming that you're not running stock). A undo is easy as the script is so flexible.
You will also burn a lot of eMMC life cycles using REPIT so don't do it often, and I hope you've read 1. where I covered the buggy eMMC chip thingy.
Q: Something went wrong with flashing the zip file!
A: Please upload the REPIT log usally found in the folder where you placed the flashable zip file to dropbox, or https://paste.tinyw.in; apparently pastebin doesn't like long logs. Can also be in /tmp. Otherwise you can copy the whole TWRP log found in /tmp/recovery.log, /cache/recovery/log or /cache/recovery/last_log. NEVER copy the whole log and make a post out of it, you're spamming the thread by doing so. Issues with REPIT should NOT be reported here, instead go to the REPIT GitHub page here.
Q: I want to undo these changes!
A: Since @Lanchon is taking over this thread :laugh:, ask him. Sorry for me not doing my homework.
Q: How about the x GB model?
A: They all work, REPIT is designed to assign any leftovers to the partition we use.
More questions? Bring them on.

Reserved #2

May be it's better to give proper credits too considering it was a big mess up in past.
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery

nicesoni_ash said:
May be it's better to give proper credits too considering it was a big mess up in past.
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery
Click to expand...
Click to collapse
Woops, I made the guide in notepad++, and accedently removed some lines when editing it; including a better credit to @Lanchon; adding in a new one now.

Hawaii_Beach said:
Woops, I made the guide in notepad++, and accedently removed some lines when editing it; including a better credit to @Lanchon; adding in a new one now.
Click to expand...
Click to collapse
I meant in your op too.
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery

Btw, is it possible to modify this script somehow so that you can reformat the /cache partition to f2fs? Afaik the minimum size is 100mb.

Sincci said:
Btw, is it possible to modify this script somehow so that you can reformat the /cache partition to f2fs? Afaik the minimum size is 100mb.
Click to expand...
Click to collapse
No, I'm sorry. It is already known, on GitHub: #8.
The minimum size of /cache? The script sets /cache to 32240kB which is 32MB..

nicesoni_ash said:
I meant in your op too.
Click to expand...
Click to collapse
OP?

Hawaii_Beach said:
No, I'm sorry. It is already known, on GitHub: #8.
The minimum size of /cache? The script sets /cache to 32240kB which is 32MB..
Click to expand...
Click to collapse
After I read your conversation with @Lanchon on git, it seems to me that there is no need to wipe data and it will still work, it's that right?
OP - Original Post basically referred to first post.
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery

nicesoni_ash said:
After I read your conversation with @Lanchon on git, it seems to me that there is no need to wipe data and it will still work, it's that right?
OP - Original Post basically referred to first post.
Click to expand...
Click to collapse
Yes, you don't need to wipe /data. It just makes things faster; as you wont have to move the content around. Without wiping, it will take a longer time to re-partition.
The script will NOT wipe /data except you add +wipe to -data=max (-data=max+wipe-i9300)
OP has so many meanings, it's f***ed.

Hawaii_Beach said:
On Android 6+ (CM13) sd-cards are now implemented like normal internal storage. Just buy a 8GB micro sd-card which basicly costs a couple of bucks and save yourself some trouble.
Click to expand...
Click to collapse
hi, thanks for the guide!
actually, the external sdcard will always be slower than the internal eMMC. also, the extra free space gets auto-TRIMmed in /data, making the whole eMMC (and thus your phone) faster. also, adopted storage diminishes the total reliability of your phone and data (more devices can fail).
in all, i'd recommend anybody with less than 2 or 3GB free space in /data to REPIT; it's safe and easy.
---------- Post added at 05:35 PM ---------- Previous post was at 05:22 PM ----------
Sincci said:
Btw, is it possible to modify this script somehow so that you can reformat the /cache partition to f2fs? Afaik the minimum size is 100mb.
Click to expand...
Click to collapse
REPIT does not support f2fs for now.
(future support will not include wipe without resizing, as f2fs does not support that yet.)
but you can get what you want anyway:
"-cache=0.03125+wipe"
actually means
"-cache=0.03125+wipe+ext4"
given that ext4 is the default FS for "cache".
"wipe" means format, and never mind what was there before. even if it was something that wasn't ext4 at all, it will succeed.
so you can use:
"-cache=0.0976+wipe"
to get exactly 100MiB-sized cache (in ext4)
then, afterwards, use TWRP to format cache in F2FS
and you'd get what you want.
but...
DON'T!!!
dont use F2FS in ANY partition besides /data! it makes NO sense!
F2FS has an overhead of about 100MB, so basically you would be creating a /cache that is unable to hold any files at all. (ext4 has 5MB overhead.)
and why have a dysfunctional /cache? what for? to have problems? incompatibilities?
certainly not performance, because cache is NEVER used in android. so why do it?
it's soft of a crazy fad, like /system in f2fs.
/system, the one partition we never write to, lol
---------- Post added at 05:39 PM ---------- Previous post was at 05:35 PM ----------
nicesoni_ash said:
May be it's better to give proper credits too considering it was a big mess up in past.
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery
Click to expand...
Click to collapse
thanks!
no credit required!!! the GPL allows him to do as he pleases, as long as he doesn't remove the license or claims copyright.
but anyway, thanks for the credit appreciated!
and thanks for invaluable help to port to i9300!!
---------- Post added at 05:43 PM ---------- Previous post was at 05:39 PM ----------
btw, i should start thanking the people who helped with the ports in the comments of the device port file. so far 2. i will back-credit when i get the time.
and i9305 and others are probably trivially supported, i just need the dumps done.

Lanchon said:
really long stuff going on
Click to expand...
Click to collapse
The thing is that not only could REPIT be ported to i9300, but any other Samsung device, right? They all run TouchWiz; for example s4, s5, s6? Have anyone even checked partitions on those devices?
The thing with partitions and the Android community is that almost no one discusses it. If you do a google on partitions on Android; very Little information / threads exist.

Lanchon said:
hi, thanks for the guide!
actually, the external sdcard will always be slower than the internal eMMC. also, the extra free space gets auto-TRIMmed in /data, making the whole eMMC (and thus your phone) faster. also, adopted storage diminishes the total reliability of your phone and data (more devices can fail).
in all, i'd recommend anybody with less than 2 or 3GB free space in /data to REPIT; it's safe and easy
Click to expand...
Click to collapse
To be honest, I never cared about storage speed (same goes for trim), not a heavy user on my phone, and have never been, just doesn't go well when I'm the operator. As long as it doesn't take 1 year to copy my secret .mp4's (ransom.mp4 and many more), there's no worries.
About failure, it's like running a computer. If you shut down a computer without sending signals (unplug from wall etc), it may damage the harddrive; right? Same here. Right?
Any how, If I ever run out of space on my i9300, I'd just add a sd-card. I don't save anything important on my device that doesn't get backed up via TWRP. But..
that's never going to happen! Because my OnePlus One is coming back from RMA service! (finally after 4 months (not kidding)). kinda off topic, but hey; it's my thread right :good:

Hawaii_Beach said:
The thing is that not only could REPIT be ported to i9300, but any other Samsung device, right? They all run TouchWiz; for example s4, s5, s6? Have anyone even checked partitions on those devices?
The thing with partitions and the Android community is that almost no one discusses it. If you do a google on partitions on Android; very Little information / threads exist.
Click to expand...
Click to collapse
lol about the quote
besides the name playing on samsung's PIT files, REPIT can actually work on any device with TWRP support. but the partition layout in most newer devices is friendly enough not to bother. even the stock i9300 layout is sort of friendly. highly problematic are only the devices that shipped before ICS with android 2.x (galaxy S2) or devices that shipped with non-emulated internal sdcard.
discussion is low volume because partitioning is considered 'dangerous'. and it can be, you can brick if you mess up. the idea of REPIT was to make it safe by encapsulating a bit of knowledge of each device in the device port file. motivation was that S2 users suddenly all needed to repit: their devices stopped working after a nightly flash because of /system being too small, it was a mess, lol.
btw, since you asked before, that's the reason why porting is needed: because you can't trust users not to make mistakes with full freedom. users that want full freedom have other tools: gdisk, parted, mkfs.xxx, resize2fs, etc.

Lanchon said:
lol ab...
Click to expand...
Click to collapse
Yeah, I know that other devices doesn't even need to touch the partitions, as it is a waste of time. (so is this??)
edit: still, maybe I want a extra 1.5gb on my s6 Active or whatever.
edit: by for today, it's 00:00 here..
discussion is low volume because partitioning is considered 'dangerous'. and it can be, you can brick if you mess up. the idea of REPIT was to make it safe by encapsulating a bit of knowledge of each device in the device port file. motivation was that S2 users suddenly all needed to repit: their devices stopped working after a nightly flash because of /system being too small, it was a mess, lol.
Click to expand...
Click to collapse
Dangerous!? I've seen way more people fu** their IMEI number (including ME on MINE i9300) by doing something dumb to the /efs content (totally didn't try to unlock the phone), that's dangerous. (got 0049)
The phone was just lying round until I got around to fix it, not going to get into details as XDA doesn't allow this stuff. It was really fustrating as people said that reflashing stock would get back the IMEI (should apparantly work, etc etc).
yet again side tracked, but i'm the operator right? :good: :highfive:

@Lanchon
Since we are talking abt partitions, I would like to ask a question that's not related to this tool but the other way mentioned in first post by flashing a zip file with manually entering the size in script file.
I tried that a while back on my s3 and it worked great. I was on kitkat that time and it was fine till lollipop came. So I flashed lollipop but since the system size was only about 500mb, it failed to flash so I made another zip with system size to 800mb and flashed it again. Although everything went fine but after flashing a new rom or restoring my old backup phone always showed some encryption error and asked to factory reset and even after doing that, still showed the same error even though I never encrypted anything. So the only option was to flash stock with pit file and change the partitions to stock size and then restore or flash a new rom.
I was never able to partition my phone after that coz that error always came back. I have op2 now so all molding goes on it and s3 is like a backup phone but I am still interested to know what was that all about and what could I do to fix that or whether my emmc worn out?
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery

Hawaii_Beach said:
Dangerous!? I've seen way more people fu** their IMEI number (including ME on MINE i9300) by doing something dumb to the /efs content (totally didn't try to unlock the phone), that's dangerous. (got 0049)
The phone was just lying round until I got around to fix it, not going to get into details as XDA doesn't allow this stuff. It was really fustrating as people said that reflashing stock would get back the IMEI (should apparantly work, etc etc).
yet again side tracked, but i'm the operator right? :good: :highfive:
Click to expand...
Click to collapse
well... effing the bootloader i way worse than borking /efs, believe me.
now, trying to hack /efs WITHOUT A BACKUP (!!) is big jesus f*cking christ sh*t u talking lol!!!

Lanchon said:
well... effing the bootloader i way worse than borking /efs, believe me.
now, trying to hack /efs WITHOUT A BACKUP (!!) is big jesus f*cking christ sh*t u talking lol!!!
Click to expand...
Click to collapse
Hahahaha yep. Didn't know the risk dude.

nicesoni_ash said:
@Lanchon
Since we are talking abt partitions, I would like to ask a question that's not related to this tool but the other way mentioned in first post by flashing a zip file with manually entering the size in script file.
I tried that a while back on my s3 and it worked great. I was on kitkat that time and it was fine till lollipop came. So I flashed lollipop but since the system size was only about 500mb, it failed to flash so I made another zip with system size to 800mb and flashed it again. Although everything went fine but after flashing a new rom or restoring my old backup phone always showed some encryption error and asked to factory reset and even after doing that, still showed the same error even though I never encrypted anything. So the only option was to flash stock with pit file and change the partitions to stock size and then restore or flash a new rom.
I was never able to partition my phone after that coz that error always came back. I have op2 now so all molding goes on it and s3 is like a backup phone but I am still interested to know what was that all about and what could I do to fix that or whether my emmc worn out?
Sent from my "i9300/1+2" powered by Carbon/Temasek
Fueled by 7000mAh ZeroLemon Battery
Click to expand...
Click to collapse
well i cannot answer about scripts and procedures unknown to me but...
an encrypted disk typically is made of 2 things:
-the encrypted disk 'surface' or area (ie: the data)
-and metadata (data describing the data, ie: data describing the encrypted disk)
metadata typically contains:
-cipher info
-and the disk surface encryption key (generated at random), itself encrypted with the access key (such as a passphrase).
why the indirect key? without it:
-changing the passphrase (say, your phone lock pattern) would be a very dangerous operation that would require reading, reencrypting and writing the complete disk, would take a huge amount of time and would drain your battery completely
-erasing the disk would similarly take a long time.
with it:
-when changing the passphrase you just need to reencrypt the surface key with the new passphrase and rewrite the metadata.
-when erasing, just wipe the metadata.
for example the metadata in recent android phones with hardware backing store for keys probably contains:
-cipher info
-and the disk surface encryption key (generated at random), itself encrypted with a secondary key (also random).
the secondary key lives in the hardware keystore. it's generated there and can never leave that processor. the keystore will decrypt the surface key during boot, only if the main processor informs the right passphrase (say, the PIN or pattern). a 4-digit PIN would be very easy to bruteforce, except that the keystore throttles down guesses, and can even wipe the key (rendering the disk forever unreadable) after so many bad guesses.
the keystore should be tamper-proof: a silly small processor, but resistant to voltage spike attacks, rays, etc and decapping to read the storage, to pick up signals in traces, to inject signals in traces, to chip modifications, etc. think of it as the chip in any recent credit card or even some sim cards, but on the main circuit board.
anyway back to metadata in android: it needs to be stored somewhere. the obvious place is an ultra small metadata partition containing just the raw metadata, no file system or anything of the like. this is simple and works great, except for one detail: older phones don't have this partition. basically this means that an android upgrade couldn't give you encryption.
so android can use a "crypto footer": with this scheme the encryptable partition (say /data) has a file system that is 16KiByte short of filling the actual partition, and the 16KiB footer follows. the footer is the metadata.
when you repartitioned before, you probably created a file system that used the complete partition area. there was no space left for the footer, so encryption couldn't be enabled.
you could have solved your issue today by flashing repit with all-default parameters: repit always resizes the encryptable partition's file system to make room for the footer, if not already there.
in REPIT, these commits add general and ext4-particular support for crypto footers:
https://github.com/Lanchon/REPIT/commit/591961adb180a6a03594053a846b698240b4d507
https://github.com/Lanchon/REPIT/commit/de3d3af9813afef7de3a798ce5314c0fb210e30f
https://github.com/Lanchon/REPIT/commit/5c3360b572ff25c7c01d796cabb9400066451ec3
this configures the footer on the i9300:
https://github.com/Lanchon/REPIT/blob/f46b0aafdfeb7860be17a315b4aceb43966325f9/device/i9300.sh#L85

Related

Quick Idea about permanent root

I'm no expert when it comes to the topics of rooting and getting access to the emmc and all of that good stuff. I more specialize in ROMs and themes and stuff, the less complexed stuff lol
Someone has posted an idea in the general forums in relation to permanent root, I'm not sure if he posted it here or not. So here's what he wrote....and is it possible? Or does it have to be done manually first before this idea can happen?
Originally Posted by deliberate187
In order to unlock the phone, we have to figure out what the protected sectors are first and all related flags. If an Android app could be made to have direct read access to the eMMC filesystems (including write protect flags) and save a log to the SD card detailing these items, this would be ideal.
Then all that would remain is a program to undo the write protection (and re-do it if necessary to unvoid warranty)
If anyone is willing to create these programs, I would be more than happy to test them out on my own G2.
However, I think the keys to the mystery may lie in the recovery image, and/or in the bootloader itself. Has anyone disassembled these yet?
Click to expand...
Click to collapse
Sorry to have to tell you but this is all old information stuff we already know just are unable to do anything about it. Its harder then just coming up with an idea of something. Now if we knew a person that programed the g2 in htc factory then all would be good but as of now we just dont have the information we need to do anything
thanks
Thanks for the idea. Some people will be mad you didn't post in the root thread though.
File under "I'm no expert but..."
Here is one observation I have noted in my exploration. The root filesystem and system partition are mounted with the flags "-o ro,relatime" but in addition the /system partition has ",errors=continue" leading me to believe that this change is in fact written to the release configuration rather than to the eMMC itself. Can anyone try to get a permanent write to the fstab and see if this can net us permanent root? Possibly take a temp root session and remount the system and / filesystems read/write to see if writes stick... just an idea.
The errors=continue flag allows the ext3 filesystem to continue working even if there was a read/write error.
I've been able to get the system to change to r/w a couple times while wandering through root explorer. I have made subtle changes to certain folders such as moving txt files but nothing has ever been permanent. I can't really tell you how I did it either seeing as I can't replicate it on demand...I'm assuming it still gets written to cache despite being in the /system
Sent from my T-Mobile G2 using XDA App
heyy, I'm not punchie, I've got what the doctor calls a relaxed brain
I am thinking there should be a set of adb commands to unlock the nand. I am definitely thinking a nand dump and full disassembly of the bootloader and recovery image could be absolutely crucial in discovering what needs to be done. Just a thought, has anyone done a nandroid backup of the G2 yet? I'm pretty sure TMob doesn't have HTC encrypt its bootloaders...
deliberate187 said:
I am thinking there should be a set of adb commands to unlock the nand. I am definitely thinking a nand dump and full disassembly of the bootloader and recovery image could be absolutely crucial in discovering what needs to be done. Just a thought, has anyone done a nandroid backup of the G2 yet? I'm pretty sure TMob doesn't have HTC encrypt its bootloaders...
Click to expand...
Click to collapse
if you can figure it out, go for it and i wish you luck
deliberate187 said:
Here is one observation I have noted in my exploration. The root filesystem and system partition are mounted with the flags "-o ro,relatime" but in addition the /system partition has ",errors=continue" leading me to believe that this change is in fact written to the release configuration rather than to the eMMC itself. Can anyone try to get a permanent write to the fstab and see if this can net us permanent root? Possibly take a temp root session and remount the system and / filesystems read/write to see if writes stick... just an idea.
The errors=continue flag allows the ext3 filesystem to continue working even if there was a read/write error.
Click to expand...
Click to collapse
If it were only this easy.
Re-mounting /system as r/w is part of the rooting process. This does not result in changes written to eMMC. In fact, the controller "lies" to Linux that the change has been synced. From then on, Linux holds the changes in its cache which, when dropped or rebooted, reverts changed files to their original state (because they were never written in the first place.)
The ext3 continue on errors thing is merely a way to skip fsck in the event that the read-only system has issues in the journal (very unlikely to happen, since nothing can write to it.) Presumably, this only covers an oversight in OTA updates (where the journal of the image provided by the OEM is dirty for some odd reason.) Again, since nothing can write to /system, it's all but an impossible scenario (nothing can write to the journal either...)
As for marking "sectors" as write-protected or not, that's also easier said than done. Entire partitions are locked, and half of the space is mysteriously "missing." It's difficult to see what's really going on from userland, as the device is deceptive as to what is and is not being written, or what is even stored on the eMMC in the first place.
The real solution is to exploit either the boot-loader or eMMC (re)/initialization somehow to allow a) unsigned firmware to be loaded and/or b) allow booting without write protection, allowing us to c) flash rooted rom to the phone and/or d) disable said protection. The unlock procedure will likely be similar to Unrevoked, as that is essentially the same situation (aside from the controller issue.)
All of this is covered in the wiki and various threads - check those out, if you find a way around it everyone would be glad to hear it.
HamNCheese said:
If it were only this easy.
Re-mounting /system as r/w is part of the rooting process. This does not result in changes written to eMMC. In fact, the controller "lies" to Linux that the change has been synced. From then on, Linux holds the changes in its cache which, when dropped or rebooted, reverts changed files to their original state (because they were never written in the first place.)
The ext3 continue on errors thing is merely a way to skip fsck in the event that the read-only system has issues in the journal (very unlikely to happen, since nothing can write to it.) Presumably, this only covers an oversight in OTA updates (where the journal of the image provided by the OEM is dirty for some odd reason.) Again, since nothing can write to /system, it's all but an impossible scenario (nothing can write to the journal either...)
As for marking "sectors" as write-protected or not, that's also easier said than done. Entire partitions are locked, and half of the space is mysteriously "missing." It's difficult to see what's really going on from userland, as the device is deceptive as to what is and is not being written, or what is even stored on the eMMC in the first place.
The real solution is to exploit either the boot-loader or eMMC (re)/initialization somehow to allow a) unsigned firmware to be loaded and/or b) allow booting without write protection, allowing us to c) flash rooted rom to the phone and/or d) disable said protection. The unlock procedure will likely be similar to Unrevoked, as that is essentially the same situation (aside from the controller issue.)
All of this is covered in the wiki and various threads - check those out, if you find a way around it everyone would be glad to hear it.
Click to expand...
Click to collapse
Listen to this dude. Absolutely correct.

LVM - Possible solution for customizing partition sizes

So I found this interesting read. I don't recommend attempting doing any of this until you get a full grasp and I am even hesitant on my Dinc as I've read that messing with partition sizes will lead the bootloader overriding it. I could be wrong though and this is still worth a read.
Basically you can use Linux Volume Manager to use the existing partitions and make a pool to share among partitions. Not sure if it can add /data/data to the pool. If it can then I found a true fix to the /data/data issue. If not at least system could be resized and avoid symlinks or cache could be shrunk and added to /data. It looks complicated but read the link below if you feel technically inclined but a warning not to try anything on this device just yet.
http://forum.xda-developers.com/showthread.php?t=1656794
Jeebus, that's brilliant!
For anyone thinking about tinkering with this: This requires a replacement boot/kernel and recovery with LVM support compiled in. If you're not already comfortable building kernels and recovery images, don't do anything for now.
It makes perfect sense though, especially if all the phone's flash is homogenous. According to this, the Galaxy S used different flash for /data/data than the rest of the phone for speed. With heterogeneous flash it'd still be doable, but it would require some fine-tuning to prevent performance problems.
Beyond that though, I can't see why /data/data and /cache couldn't be added to the pool. Heck, /emmc could be added to the pool too!
This doesn't alter the original partition layout -- it merely allows for pooling all the storage and repartitioning out of that pool.
ardax said:
/emmc could be added to the pool too!
Click to expand...
Click to collapse
Now THAT would be amazing. Talka about really solving 'low on space' problems!
musical_chairs said:
Now THAT would be amazing. Talka about really solving 'low on space' problems!
Click to expand...
Click to collapse
Yeah
Sent from my 1st Gen Droid Inc on Pons CM10 using xda app-developers app

[FIX]Enable encryption - Check&Shrink ext4 filesystem

If you ever used CWM, CWMT or other non factory recoveries to wipe your data, you probably noticed that you lost the ability to encrypt your phone. Or maybe you did not even realize this is why encryption does not work.
For the Android phone encryption to work, it needs the /data (usrdata) partition to have a little bit of unused space between the end of the filesystem and the end of the partition. And as soon as you use CWM to wipe, it actually reformats using all space, and encryption does not work anymore.
User lolo250612 brought this to my attention, and together we created a update.zip that shrinks the /data filesystem by 1MB
In fact, we created 2 patches: One to shrink, and one to first repair the filesystem. The first will refuse to shrink if the file system is not clean and healthy. They will automatically find the correct usrdata partition device and its size. The shrink will then resize to 1MB less then the partition size (which means it could also be used to grow if you somehow had a filesystem a lot smaller, for example because you restored an smaller image from somewhere).
Both patches are created with statically linked e2fsprogs binaries and its own static copy of busybox shell interpreter. So they should work on all Android devices that use ext file system (probably all V2.3.1 Gingerbread and higher androids), and you should not lose any data because of this. But it is always good to make a backup.
We tested this on 2 phones, both ICS phones, and with both CWM and TWRP type recoveries, and are fairly certain it is safe to use. But to repeat, you should always take a backup of your phone.
Both patches can be found on my shared drive:
ICS_usrdata_fix-fs.zip
ICS_usrdata_shrink.zip
Procedure:
- Make backup of your phone
- Place files on SD card
- Boot into recovery
- Apply the shrink update
- If it tells you the filesystem is damaged apply the fix-fs update first
The patch only shrinks the filesystem, nothing is actually installed or removed on the phone. But if you use encryption, you could leave this patch on your SD card so that every time you wipe data, you can run the shrink patch again afterward to enable encryption again.
If you do use this, please report back in this thread, possibly mentioning your phone model and ROM you are using.
Quick encryption guide (and more)
I won't go deep into useless details as everything has already been described about Android phone protection somewhere on the internet. I will just give some meaningful links and tips by illustrating how I have protected my phone. Really nothing new or innovative, just a compilation of a few hints that I have put in practice to protect the numerous pieces of information that are on my phone.
Step 0: awareness
----------------------------
Why bother with phone security?
In short, I am clearly paranoid. Well, in fact, I don’t really feel at ease when I know all the information, both personal and professional I have on my phone. Over the month, my Androphone has become a real digital Swiss-knife and personal secretary. This includes:
Personal and professional contacts
Personal and professional agendas
Personal and professional digital exchanges (SMS and email)
Personal and professional photos
Banking account information
Trails where I run
Etc… etc…
Don't want someone looks at them. Not you?
Fist step: on-line protection
----------------------------------------
The first step in protecting your data consists in making hard to access indirectly the data that lay on your phone memory. This access consists in using the system when the phone is on, either via the GUI and the phone controls, or remotely (essentially by network connections, or phone basic functionalities like sms). So, basically, you need to lock efficiently your phone from preventing someone else to unlock the user interface that allows interactions with the system, and protect all communication channels.
To lock efficiently your phone, you must use a pin code of at least 4 digits (6 is better) or a pass-phrase. The latter is much less practical without improving online security that much. Above all, you must avoid those silly locking solutions like face recognition unlocking, or pattern lock. Those are toys for naive young boys. Not for those concerned seriously by security.
For protecting remote access to your phone, I would suggest:
1) Double check that USB debugging is disabled. This a major security hole.
2) Turn on data connections (bluetooth, wifi and 2/G/3G/4G) only when required (email checking, web-surfing session, data synchronising), and off rest of the time.
3) Avoid install cracked unofficial apks, or applications that asks for permission far beyond their obvious and principal utility
4) Install a software security app, if possible, open source and recognised by xda members. Once an adept of Droiwall, I have switched to Avast mobile security because of its extra features. But it is not opensource and it is a question of taste. But do this carefully, see that for instance before making a choice: http://download.cnet.com/8301-2007_4-57391170-12/dont-get-faked-by-android-antivirus-apps/ and http://www.av-test.org/fileadmin/pdf/avtest_2012-02_android_anti-malware_report_english.pdf.
But, you must be rooted (which is in itself a security hole if not mastered) and one must have a kernel with netfilter functionalities activated. This is the case with the stock kernel of the phone I use at the present time (Lenovo A789). But was not the case of 2 Samsung phones I used before. You have to either install a custom kernel adapted to your phone, or make your own if you have access to its sources (see tutorials as: http://forum.xda-developers.com/showpost.php?p=22941057&postcount=1)
5) Personally, I would feel more at ease if I could find an easy to use firewall solution that could close, and better, make stealth all the local ports of my phone, especially when I am not behind a wifi router. But I haven’t found one yet. Droidwall, nor Avast, addresses this functionality, whereas it would be fairly easy to implement it with the netfilter system layer underneath.
Second step: offline protection
-------------------------------------------
Here we are. Now your phone is protected when it is on. But, what if you switch it off, or remove its sdcard? The data lay on the internal memory, unprotected (at best obfuscated). Really easy to find a custom recovery for almost all phones, write a script to dump /data on a sdcard and then make whatever you want with the copy.
Don’t like that? The only solution to prevent /data from being read by someone else is to encrypt the /data partition. To do that, your phone or tablet internal storage partitions must be seen by your system as block devices. This is the case with eMMC but not with Yaffs. So beware, if you want encryption you need to buy a device that answers this requirement. This is not always true and almost never documented. Notes on the implementation of Android encryption are there: http://source.android.com/tech/encryption/android_crypto_implementation.html
Now, as me, if you are reading these lines, you are certainly looking for extra information about your Android device and probably extra functionalities.
Certainly, the most frequent way to install extra functionalities and custom ROMs to your phone is to use an update zip file. With stock recovery, this zip file needs to be signed, otherwise it is rejected. For maximum flexibility and ease of use, alternative boot recovery have been developed, of which CWRP is certainly the most famous.
Usually, for 99% of users and operations, CWRP operates great. Sometimes, as nothing is perfect, a bug may occur. This is the case for built in ICS encryption process. As Cybermaus indicates in the first post, to be able to perform this encryption the /data filesystem must be slightly smaller than the underlying partition. But CWRP, at least up to the version 5.5, formats all the corresponding partition leaving no place for Android to store the required information to be able to start the encryption process. This is clearly described in the following links: http://forum.xda-developers.com/showthread.php?t=1792101 and http://rootzwiki.com/topic/25652-fixing-galaxy-tab-2-encryption/
I have discovered that by using aLogcat to track down the origin of the failure. The interesting part revealed to be: E/Cryptfs ( 87): Orig filesystem overlaps crypto footer region. Cannot encrypt in place.
To circumvent this problem, you will find in Cybermaus first post, two CWM update zip files that will do the trick in a simple and secure way. After flashing your ROM and wiping data with CWM, apply them, go to system encryption as described here:http://support.google.com/android/bin/answer.py?hl=en&answer=1663755, and after waiting one or two minutes (not more), the system should restart automagically to encrypt your /data partition.
Third step: making your phone even more secure and practical at the same time
-------------------------------------------------------------------------------------------------------------------
Android built-in encryption is in fact more or less Linux LUKS (http://en.wikipedia.org/wiki/Linux_Unified_Key_Setup). Plus, it is open-source so that everyone with the required skills can make an audit of the code to see if no security hole is present in the Android implementation. The underlying mechanism is strong and secure, as long as you use a strong password. I mean by strong, at least 12 characters that includes at the same time lower-case letters, upper-case letters, numbers and symbols. And it must be something impossible to guess for others while easy to remember for yourself. You will find a lot of resources on the internet on how to create such a password. For instance: https://help.ubuntu.com/community/StrongPasswords .
The problem with Android, in its attempt to keep the system not too complicated to use, is that the GUI (I insist: only the GUI, not the system) does not distinguish between the PIN or passphrase that you use to lock your phone when it is on, and the password used to encrypt the data that lay physically on your phone storage. So the casual user is in front of a paradigm: either he chooses a strong password for its data, but this will rapidly become tedious to type at least 12 characters to unlock his device several times a day; or he decides to use a PIN code, which is more practical to unlock the phone, and consequently uses a really weak password to encrypt its data which contains only digits, and thus may be cracked in a breath by any PC.
Fortunately, this paradigm is addressed and solved by small tools like EncPassChanger or Cryptfs Password (both requiring that your phone be rooted, which is by the way, paradoxically, a security hole if not used with caution ). See: http://nelenkov.blogspot.fr/2012/08/changing-androids-disk-encryption.html for complete notes about that. So for me, the only way, both secure and practical, to secure your phone is by using a PIN code of at least 4 numbers (6 is better). Then use a handy tool like EncPassChanger to have a true complex password for decryption at boot time.
Fourth step: increase security, without sacrifying practicability
-----------------------------------------------------------------------------------------
As I am paranoid, but at the same time don’t want my phone to become a source of annoyances, the previous “basic” steps were not enough for me.
So I decided to improve security in two ways:
1) By following the following tip, which I find great and is itself self-explaining: http://forum.xda-developers.com/showpost.php?p=26730989&postcount=2
2) By encrypting the photos I take with my phone, because these are linked with my private life and I won’t like that somebody gain access to them.
3) By encrypting documents I scan with CamScanner, for home and work, which may be sensitive.
4) By automating the action that disables USB debugging in case I forget to put it off after using it .
For point 2 and 3, documents lay on your sd card uncrypted. Android built-in encryption does not deal with both internal and external sdcard (just to be clear, by sdcards I mean partitions mounted as /mnt/scard or /mnt/scard2). To encrypt them you have to use once again an external tool. As I am an opensource fanatic for all that deal with security, I would recommend to use LUKS Manager (https://play.google.com/store/apps/details?id=com.nemesis2.luksmanager&feature=search_result and http://forum.xda-developers.com/showthread.php?t=1141467) which is based on dm-crypt module (yes, the same that Android uses for its build-in encryption), or Cryptonite (https://play.google.com/store/apps/details?id=csh.cryptonite&feature=search_result) which is completely open-source and implements the rock-solid Linux encfs on Android.
The latter is my personal choice. I do not use Crytonite in itself, except for creating the initial .encfs6.xml file. For everyday use, I use directly the Android port of the binary file encfs that comes with Cryptonite, and embed it into shell scripts. Up to now, no flaw, no problem. The password to open my encfs encrypted volumes is stored in a text file located on the /data partition. It is thus encrypted by Android and made accessible on boot when you decrypt this partition. So nothing more to remember.
To make things usable and practical, I use Tasker to automate the following things:
- Mount encfs volumes on start-up, by reading directly the password in the file located on /data
- Umount encfs volumes when usb is plugged
- Copy photos on a regular basis from the unencrypted /mnt/sdcard/DCIM to the safe place I created with encfs, delete AND wipe the original ones
Fifth step: be coherent about security
-----------------------------------------------------
Some people, torn apart by the paradigm described in Third step, by negligence or by lack of knowledge, strongly secure one part of the system, but make other parts big security holes.
Concretely, I am thinking about two examples: mixing encryption with pattern lock (or, even worse, with face unlock), or mixing encryption with usb debugging. Face recognition is just a jock. It is not reliable and fails very often. Moreover it is really easy to crack, with a photo for example. One of my colleague even achieved to unlock my phone with its own face, just because we are morphologically close enough. Pattern lock is not much better. (See: http://forum.xda-developers.com/showpost.php?p=37649447&postcount=6 and https://www.google.fr/search?q=smudge+attack).
So always ponder over (two times rather than one) each action you take that may touch system security.
Thanks lolo
I'm trying to use this on my VZW Galaxy S3 16Gb and this is what I'm seeing in TWRP v2.2.0:
Mounting System
Extracting system fixes
Update script starting...
Update script started
Disk /dev/block/mmcblk0p15: 13.1GB, 13140754432
4 heads, 10 sectors/track, 401024 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
ERROR: unlikely size of KB
aborting operation!
Update script ended
Unmounting system...
Update Complete
Click to expand...
Click to collapse
edit: The same thing happens with both scripts.
I need to enable device encryption because my employer requires it for email and other Google Apps for Business apps. Thank you for your help!
Anyone know why full disk encryption isn't available on some (if not most roms)? Is it something that needs to be added with intent aside in the building process, or dependent on how the stock rom was set-up to work with?
I was hoping this would help get encryption working on an EVO ics rom which has encryption available, but when you click "encrypt phone" it just hangs on an android screen and doesn't actually do anything.
i was really happy to find your solution to enable encryption on my HTC desire S (ICS, rooted), but unfotunately it doesn't work. the same thing happen to me as it happened to mushu13, only different numbers in lines 5 and 6. same result whichever script i choose. please help, i really need system encryption.
thanky you very much!
First thing you should know, I am not an Android Guru. And unfortunately, if your phone is not an A789, I won't be able to help you deep in technical details. Cybermaus is the most skilled of the two of us, technically speaking, and he may lack time to answer correctly every request he is regurlarly faced with.
Okay, I do not know your phones and don't own them. So, distant debugging is much harder in these conditions. But the first things you should check, before applying Cybermaus' patches, are :
1) if encryption works with stock rom
2) follow thoroughly all steps I described in "Second step: offline protection" of the second post of this thread :
- your phone or tablet internal storage partitions must be seen by your system as block devices. This is the case with eMMC but not with Yaffs. If you don't have this information from the manufacturer, install Terminal Emulator from the Play Store and type 'mount' in it. You should see lines beginning with /[email protected] and /[email protected] If this is not the case, I fear encryption won't be able to work on your device.
- use aLogcat to track down the origin of the failure (see resources on the internet to learn how to use it, and links I have put in the second post)
3) Be sure that required modules are built into the kernel you use, especially dm-crypt
4) Post your results and cross your fingers that either this is a problem I have already encountered (in this case I may help you further), or Cybermaus see your posts.
While this script did allow me to encrypt my phone, it also shrunk my /data partition to roughly 1.1 GB.
Any ideas on how to expand it back to a reasonable size? I supposedly have 4 GB of ROM, and I assume more than 1 GB ought to be available for data.
Sent from my HTC Sensation using xda app-developers app
Thank you for your nice guide.
Only one thing is missing: baseband security.
Attacks on the baseband system requires very skilled people. Such as government agencies. It is believed they use baseband attacks to break into almost every mobile device. And there is only little you can do. Some vendors like Cryptophone have mobile devices with a hardened Android system. All others have no way to protect their device against baseband attacks.
Is this patch and reasoning still valid for newer android releases.
I am running a custom kitkat rom and twrp on a note 3 and can't encrypt so im looking for a fix.
I have been looking around for fixes but different posts blame different things.
Sometimes its the fact its a custom recovery, sometimes its that root is on the device and then there is this reasoning
Is there a way to find out the cause and fix for kitkat?
Virus
Hi, i tried to download your files
ICS_usrdata_fix-fs.zip
ICS_usrdata_shrink.zip
But the file are exe files with viruses.
Any ideas?
u2funker said:
Hi, i tried to download your files
ICS_usrdata_fix-fs.zip
ICS_usrdata_shrink.zip
But the file are exe files with viruses.
Any ideas?
Click to expand...
Click to collapse
Maybe false alarm.
Lossyx said:
Maybe false alarm.
Click to expand...
Click to collapse
no, but if you search for these file, you will find some which work and which are without viruses. Check the link..it is not an zip file..it is an exe file
@cybermaus: just tried flashing the two *.zips on my Galaxy S 4 Mini running CM 12 (Android Lollipop) because my logcat tells me I'm getting the described cryptfs error. It seems my /data partition doesn't have that 1 MB of unused space needed for encryption. Now I would love to encrypt my phone using CM's integrated function without having to completely format the internal storage (because that's the other workaround I found: flash stock rom, wipe data (factory reset), flash Custom Recovery, flash CM again)
Do you have the time and device to update your script so it works with Android Lollipop as well? I see a lot of people come across this issue recently so there would be definetly use for such a nice script like yours!
Thanks for sharing this with us!
-Teutone
no available for download any mirror ?
Or write the script on the thread.
Thanks
Can you post the scripts? links are dead!
---------- Post added at 16:33 ---------- Previous post was at 16:32 ----------
cybermaus said:
If you ever used CWM, CWMT or other non factory recoveries to wipe your data, you probably noticed that you lost the ability to encrypt your phone. Or maybe you did not even realize this is why encryption does not work.
For the Android phone encryption to work, it needs the /data (usrdata) partition to have a little bit of unused space between the end of the filesystem and the end of the partition. And as soon as you use CWM to wipe, it actually reformats using all space, and encryption does not work anymore.
User lolo250612 brought this to my attention, and together we created a update.zip that shrinks the /data filesystem by 1MB
In fact, we created 2 patches: One to shrink, and one to first repair the filesystem. The first will refuse to shrink if the file system is not clean and healthy. They will automatically find the correct usrdata partition device and its size. The shrink will then resize to 1MB less then the partition size (which means it could also be used to grow if you somehow had a filesystem a lot smaller, for example because you restored an smaller image from somewhere).
Both patches are created with statically linked e2fsprogs binaries and its own static copy of busybox shell interpreter. So they should work on all Android devices that use ext file system (probably all V2.3.1 Gingerbread and higher androids), and you should not lose any data because of this. But it is always good to make a backup.
We tested this on 2 phones, both ICS phones, and with both CWM and TWRP type recoveries, and are fairly certain it is safe to use. But to repeat, you should always take a backup of your phone.
Both patches can be found on my shared drive:
ICS_usrdata_fix-fs.zip
ICS_usrdata_shrink.zip
Procedure:
- Make backup of your phone
- Place files on SD card
- Boot into recovery
- Apply the shrink update
- If it tells you the filesystem is damaged apply the fix-fs update first
The patch only shrinks the filesystem, nothing is actually installed or removed on the phone. But if you use encryption, you could leave this patch on your SD card so that every time you wipe data, you can run the shrink patch again afterward to enable encryption again.
If you do use this, please report back in this thread, possibly mentioning your phone model and ROM you are using.
Click to expand...
Click to collapse
links are dead. Can you post the scripts?

TWRP 3.2.1 for H901

The following is the latest version of TWRP compiled for the T-mobile V10 Model H901.
https://androidfilehost.com/?fid=818070582850501883
MD5SUM: b89d341cd61da31a5348d8f6b3c75c97
The heavy lifting was done by the twrpbuilder project who were generous enough to compile TWRP for our device. They also provide their services to see TWRP is available for devices that don't yet have it. I've personally used this version to do a backup and restore but can't guarantee there won't be issues. If there are while you are still in twrp you should go to the advanced section and copy the log to your external sd card. This log will help them diagnose any issues.
The project is located at: https://twrpbuilder.github.io
Their XDA thread is located here: https://forum.xda-developers.com/android/apps-games/twrpbuilder-t3744253
If you already have TWRP installed installation is as follows: Click Install, choose Image file, navigate to where the TWRP img file is located on your external sdcard and flash that img to the recovery partition. Back out to the root dir and you can select reboot then recovery...it should bounce you right back into recovery and you should see the new version loaded. If you have root in the rom and run into issues the app "flashify" can reflash TWRP 3.0 so make sure you also have it's img available.
This is pretty much only for folks who already have twrp to update to the latest. If you are on nougat you are still stuck until an exploit is released that works for nougat the way dirtycow did for marshmallow and below. *update* an exploit to give root to nougat users is now available thanks to @runningnak3d here: https://forum.xda-developers.com/tmobile-lg-v10/general/root-h901-nougat-t3773942
Reserved Post #1
Reserved Post #2
famewolf said:
The following is the latest version of TWRP compiled for the T-mobile V10 Model H901.
https://www.androidfilehost.com/?fid=8180705828505018
MD5SUM: b89d341cd61da31a5348d8f6b3c75c97
Click to expand...
Click to collapse
Looks to me like that URL should read
https://androidfilehost.com/?fid=818070582850501883
[ EDIT ] Yup, confirmed.. The URL I listed works fine.
Thanks for the file!
:laugh::silly:
NYLimited said:
Looks to me like that URL should read
https://androidfilehost.com/?fid=818070582850501883
[ EDIT ] Yup, confirmed.. The URL I listed works fine.
Thanks for the file!
:laugh::silly:
Click to expand...
Click to collapse
You are correct. For some reason a few characters got truncated. I've corrected the url in post #1.
famewolf said:
The following is the latest version of TWRP compiled for the T-mobile V10 Model H901.
https://androidfilehost.com/?fid=818070582850501883
MD5SUM: b89d341cd61da31a5348d8f6b3c75c97
The heavy lifting was done by the twrpbuilder project who were generous enough to compile TWRP for our device. They also provide their services to see TWRP is available for devices that don't yet have it.
Click to expand...
Click to collapse
Just as an aside, this version seems to correct (mostly) the date issue of previous TWRP versions for the V10. Versions before this one used to generate a default date (folder name) for the backup dating back to the 1970s as I recall.
This one has the correct month and day and time and the year is only 1 off - it showed 2017 on my very quick attempt to play with it.
One additional note to those installing it via TWRP itself - after selecting image flash , MAKE SURE you specify RECOVERY partition, not BOOT! Specifying BOOT will most likely have some less than desirable results.. :laugh:
NYLimited said:
Just as an aside, this version seems to correct (mostly) the date issue of previous TWRP versions for the V10. Versions before this one used to generate a default date (folder name) for the backup dating back to the 1970s as I recall.
This one has the correct month and day and time and the year is only 1 off - it showed 2017 on my very quick attempt to play with it.
One additional note to those installing it via TWRP itself - after selecting image flash , MAKE SURE you specify RECOVERY partition, not BOOT! Specifying BOOT will most likely have some less than desirable results.. :laugh:
Click to expand...
Click to collapse
I've passed on the date issue. Uncertain if he'll generate another build though.
famewolf said:
I've passed on the date issue. Uncertain if he'll generate another build though.
Click to expand...
Click to collapse
Seems that either nobody is using this version or nobody knows about it or they just have nothing to say..
Anyway, as you know, I have spent a fair amount of time recently working with this and installing it. A couple of observations that may be worth noting..
I double checked and I did set a screen timeout on TWRP. Previous versions would first, dim the screen, followed by turning it off completely. If you had the device near you on a desk while backing up the screen lighting up again when TWRP completed was a sure signal that it was finished.
This version of TWRP dims the screen but the screen is never turned off completely. A minor annoyance I suppose but something is different from previous versions.
During the /data partition backup I noted a (to me) new display in yellow: "Backups of data do not include any files in internal storage such as pictures or downloads"
Seriously? Is this something new? Certainly the display is but I always kinda relied on all that being backed up with /data and having the ability to restore them. This is a more serious issue for me which may make me consider going backward..
Thoughts?
NYLimited said:
Seems that either nobody is using this version or nobody knows about it or they just have nothing to say..
Anyway, as you know, I have spent a fair amount of time recently working with this and installing it. A couple of observations that may be worth noting..
I double checked and I did set a screen timeout on TWRP. Previous versions would first, dim the screen, followed by turning it off completely. If you had the device near you on a desk while backing up the screen lighting up again when TWRP completed was a sure signal that it was finished.
This version of TWRP dims the screen but the screen is never turned off completely. A minor annoyance I suppose but something is different from previous versions.
During the /data partition backup I noted a (to me) new display in yellow: "Backups of data do not include any files in internal storage such as pictures or downloads"
Seriously? Is this something new? Certainly the display is but I always kinda relied on all that being backed up with /data and having the ability to restore them. This is a more serious issue for me which may make me consider going backward..
Thoughts?
Click to expand...
Click to collapse
I use my v10 as my backup phone now. On my HTC U11 life when I make a nandroid it shows that it is not backing up files on internal storage. I think this is normal now on the latest version of twrp.
NYLimited said:
Seems that either nobody is using this version or nobody knows about it or they just have nothing to say..
Anyway, as you know, I have spent a fair amount of time recently working with this and installing it. A couple of observations that may be worth noting..
I double checked and I did set a screen timeout on TWRP. Previous versions would first, dim the screen, followed by turning it off completely. If you had the device near you on a desk while backing up the screen lighting up again when TWRP completed was a sure signal that it was finished.
This version of TWRP dims the screen but the screen is never turned off completely. A minor annoyance I suppose but something is different from previous versions.
During the /data partition backup I noted a (to me) new display in yellow: "Backups of data do not include any files in internal storage such as pictures or downloads"
Seriously? Is this something new? Certainly the display is but I always kinda relied on all that being backed up with /data and having the ability to restore them. This is a more serious issue for me which may make me consider going backward..
Thoughts?
Click to expand...
Click to collapse
On your last issue this is business as usual...twrp has NEVER backed up the internal SDCARD unless you selected the sdcard entry in the list of sections to be backed up. DCIM (pictures) and the Downloads folder/dir have never been included.
As to the dimming, you can check in settings to see if something can be configured however each person compiling twrp can set their own options as to how they want it to function. There is no guarantee or expectation that Person B is going to use the same options as Person A. You are of course free to compile your own copy configured the way you would prefer it to behave but the process was enough of a pain in the butt I just requested twrpbuilder to generate one as I kept getting errors. The process to compile it also appears poorly documented.
sabresfan said:
I use my v10 as my backup phone now. On my HTC U11 life when I make a nandroid it shows that it is not backing up files on internal storage. I think this is normal now on the latest version of twrp.
Click to expand...
Click to collapse
I kinda suspected that but that is, at best, a questionable choice since I don't even have the option to check or uncheck a selection for it. Not happy..
famewolf said:
On your last issue this is business as usual...twrp has NEVER backed up the internal SDCARD unless you selected the sdcard entry in the list of sections to be backed up. DCIM (pictures) and the Downloads folder/dir have never been included.
Click to expand...
Click to collapse
Not quite. INTERNAL is not the SD Card. Internal is emulated sd on /0. In TWRP if you tap select storage, for example, you can pick "internal" or "SD" for backup destination, as one example.
I keep a fair number of things in /Download - things I grab in my travels, things I save there for later use.. whatever. I'll have to device a Tasker module or something for copying all those to the actual SD card...
NYLimited said:
I kinda suspected that but that is, at best, a questionable choice since I don't even have the option to check or uncheck a selection for it. Not happy..
Not quite. INTERNAL is not the SD Card. Internal is emulated sd on /0. In TWRP if you tap select storage, for example, you can pick "internal" or "SD" for backup destination, as one example.
I keep a fair number of things in /Download - things I grab in my travels, things I save there for later use.. whatever. I'll have to device a Tasker module or something for copying all those to the actual SD card...
Click to expand...
Click to collapse
A fairly recent app/utility created by @kdrag0n called Tipatch brings a long-needed resolution to the table regarding "full backups" of Data using TWRP. In a nutshell, Tipatch installs to your Android device as a basic APK. Within the simple GUI, once root permissions are granted (In-Place Patching) Tipatch will decompile, patch, recompile and flash the patched TWRP to /recovery, effectively patching your TWRP build to backup the contents of Internal Storage (emulated SD card) as part of Data itself, so that backups will now include those Internal Storage contents such as downloads, photos, videos, game data, and other various files. I've tried it on this particular build of TWRP and it works without any issues. There are options to patch TWRP without root permissions as well. There are Windows, Mac & Linux versions available too. If you are patching TWRP on a device with an A/B partitioning scheme, the patched TWRP can be installed on both A & B using a one-click option. Of course, one insurmountable caveat to patching TWRP with Tipatch is that wiping Data now will also wipe Internal Storage (emulated SD card). In short, the utility works on pretty well all device types and chipset platforms (Exynos, Kirin, Snapdragon, MediaTek, etc.). The latest Tipatch update, v1.6, includes support for TWRP builds that use LZMA compression, and removes the now-misleading notification previously listed when backing up Data -- that Internal Storage (/data/media/ path / emulated SD card) contents are not backed up. Anyway guys, here is a link to the Tipatch Discussion & Support thread: https://forum.xda-developers.com/android/apps-games/app-twrp-tipatch-backup-internal-t3831217
The latest Tipatch v1.6 app is also available on the Play Store and many other app & apk repos for Android. Versions for Windows, Mac and Linux can be downloaded using the above link.

Axon 7 how to fix persist partition?need help

Hi!
trying to fix my imei I accidentally wiped my "persist" partition
A2017 Chinese model convert to A2017u
twrp 3.2.3.0 bootloader unlocked
persist partition is missing in my twrp backup
error:failed to mount '/persist' (invalid argument)
realy need help
Regards!
@netphone: You can format the persist partition from TWRP, with mke2fs or mkfs.ext4, as ext4 filesystem. But then your device's auto-rotate, sensors, etc probably won't be working. This is because some of the persist partition's contents aren't automatically regenerated even after it is formatted.
Quite some time ago I made a backup of this partition in case of issues listed above, and then subsequently wiped it by accident. Luckily I had a backup I could restore. You can find it at:
https://forum.xda-developers.com/showpost.php?p=75981746&postcount=1844
Several members tried it and said it works fine. Just flash the zip in TWRP.
I have an A2017U, and since you are converting to A2017U from A2017, then it should work. It's not like you have anything to lose, your partition is already wrecked anyway, the most that happens is it doesn't work out. In the future, I would advise making your own backup. It (the partition) is only 32MB in size.
AnonVendetta said:
@netphone: You can format the persist partition from TWRP, with mke2fs or mkfs.ext4, as ext4 filesystem. But then your device's auto-rotate, sensors, etc probably won't be working. This is because some of the persist partition's contents aren't automatically regenerated even after it is formatted.
Quite some time ago I made a backup of this partition in case of issues listed above, and then subsequently wiped it by accident. Luckily I had a backup I could restore. You can find it at:
https://forum.xda-developers.com/showpost.php?p=75981746&postcount=1844
Several members tried it and said it works fine. Just flash the zip in TWRP.
I have an A2017U, and since you are converting to A2017U from A2017, then it should work. It's not like you have anything to lose, your partition is already wrecked anyway, the most that happens is it doesn't work out. In the future, I would advise making your own backup. It (the partition) is only 32MB in size.
Click to expand...
Click to collapse
can i also use it on G version? i think something messed up in my persist partition.
i have read this on xda:
PERSIST - contains data which shouldn't be changed after the device is shipped, e.g. DRM related files, sensor reg file (sns.reg) and calibration data of chips; wifi, bluetooth, camera etc.
Some package installers such as OpenGapps also make use of this partition to read configuration file.
also contains calibration data etc.I like to try this as i counter calibration issues.
If yes,any recommend on what OS i should flash this? And should i wipe my persist partition before flashing yours?
I try to backup my own persist partition in TWRP,but in backup it shows my perist partition is 0mb.On diskinfo it says my partition is 27,5mb in size,but others report theirs are 32mb in size.
EDIT; i still did a backup in twrp even though it says the size is 0mb.The backup map is like 300kb.
how did you wiped persist partition? In twrp wipe section persist is not showed
@Predatorhaze: My zip may work on G, or not, you can try and let me know.
You can "wipe" persist with the command:
dd if=/dev/zero of=/dev/block/bootdevice/by-name/persist
And back it up with:
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img
Run these commands from TWRP terminal. dd is a famous Linux command line utility.
The partition is exactly 32MB in size.
AnonVendetta said:
@Predatorhaze: My zip may work on G, or not, you can try and let me know.
You can "wipe" persist with the command:
dd if=/dev/zero of=/dev/block/bootdevice/by-name/persist
And back it up with:
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img
Run these commands from TWRP terminal. dd is a famous Linux command line utility.
The partition is exactly 32MB in size.
Click to expand...
Click to collapse
and after the command,i mount persist and flash the zip?
thanks!
@Predatorhaze: If you wipe persist with my command, then it will be unmountable prior to flashing the zip. This is because dd destroys persist's ext4 filesystem by zeroing it out. After the zip is mounted TWRP should mount persist automatically, but if not you can do it manually.
You should Google the difference between partition, volume, and filesystem.
AnonVendetta said:
@Predatorhaze: If you wipe persist with my command, then it will be unmountable prior to flashing the zip. This is because dd destroys persist's ext4 filesystem by zeroing it out. After the zip is mounted TWRP should mount persist automatically, but if not you can do it manually.
You should Google the difference between partition, volume, and filesystem.
Click to expand...
Click to collapse
When i used your command it says no more space left,32mb copied,0mb.Then i flashed your persist zip and rebooted twrp.
Now i flashed ROM and gapps magisk etc.I see playstore mounts persist (dont know why),after flashing all files i manually wiped all folders and files from persist folder and flashed your persist zip again,then ive powered off my phone,turned on and booted.Thanks
I already noticed the size is different,my persist folder was smaller in size,and also the thermal kicked in when booted on os.Phone was warm and CPU limited to 1036mhz.I noticed this thermal kick in was gone since i complained about battery.
My battery was sitting on 12%,i run geekbench cpu bench...half way of the bench my phone shut down (shows 0% battery,but half way in bench it was still 12%).I decided to just power on my phone and boot.My phone booted the os and shows 10% battery.Dont know if this is a bug in geekbench or something else..
I reached 4+ hours sot with 2 hour of gaming (from 100% to 10%).
Also i charged my phone at night ( i do this rarely).when i woked up my battery was 100% and unplugged the charger,when i unplugged it droppped direct to 99%.Is this normal? I can remember with my previous devices when i charged at night,and unplugged in the morning,it sits on 100% for a while
@Predatorhaze: It is possible for a computer (which a phone is) to shut down while running stress testing software, if this happens then it means your setup is unstable and couldn't handle the tests. Sometimes the OS will intentionally crash itself (BSOD) to prevent damage to itself or hardware. I like to overclock PCs as a hobby, and while there's a lot I don't know, I've been at it long enough to master the basics. I regularly do benchmarking and stress testing to see if my setups are rock solid, or need more tuning.
AnonVendetta said:
@Predatorhaze: It is possible for a computer (which a phone is) to shut down while running stress testing software, if this happens then it means your setup is unstable and couldn't handle the tests. Sometimes the OS will intentionally crash itself (BSOD) to prevent damage to itself or hardware. I like to overclock PCs as a hobby, and while there's a lot I don't know, I've been at it long enough to master the basics. I regularly do benchmarking and stress testing to see if my setups are rock solid, or need more tuning.
Click to expand...
Click to collapse
Thanks.
Can you maybe share your stock /sys folder also?
@Predatorhaze: Why do you need my sys directory? I'm not running a stock ROM, BTW.
AnonVendetta said:
@Predatorhaze: Why do you need my sys directory? I'm not running a stock ROM, BTW.
Click to expand...
Click to collapse
To compare with mine and maybe replace it
@Predatorhaze: Umm...no. That directory contains thousands of subdirectories and quite a few files. As well as a bunch of symbolic links that point to other places. It wouldnt be quick or convenient to make a zip. Do you even know what Android/Linux use /sys for? I do, and I'm pretty sure you don't even understand what you're really asking for. In any case, sys won't hold the answer to your questions. It seems to me that you are off on a wild goose chase.
AnonVendetta said:
@Predatorhaze: Umm...no. That directory contains thousands of subdirectories and quite a few files. As well as a bunch of symbolic links that point to other places. It wouldnt be quick or convenient to make a zip. Do you even know what Android/Linux use /sys for? I do, and I'm pretty sure you don't even understand what you're really asking for. In any case, sys won't hold the answer to your questions. It seems to me that you are off on a wild goose chase.
Click to expand...
Click to collapse
No,i dont really know,and you are right.Im still trying to find out my battery % problems (And no,its not because my battery is degraded)
i used in terminal cat /sys/class/power_supply/bms/charge_full and it showed something with 29xxxxxx,where i think my battery cap is around 2900mah and i believe this,as i reach more than 4 hours sot with gaming included.
Thank anyway for all your help!
AnonVendetta said:
@Predatorhaze: It is possible for a computer (which a phone is) to shut down while running stress testing software, if this happens then it means your setup is unstable and couldn't handle the tests. Sometimes the OS will intentionally crash itself (BSOD) to prevent damage to itself or hardware. I like to overclock PCs as a hobby, and while there's a lot I don't know, I've been at it long enough to master the basics. I regularly do benchmarking and stress testing to see if my setups are rock solid, or need more tuning.
Click to expand...
Click to collapse
this shutdown only happens when its less than 20% or something.I also noticed when its less than 20%,geekbench shows 3 clusters where one of them is at 0.0ghz.
maybe some problem with fuel gauge.
i tried to reset the gauge at 100%,but sot is just worse now
@Predatorhaze: I recently received a private message from @Choose an username..., his unedited PM is below:
heads-up about ter
Just some info, do what you want with it:
This Predatorhaze guy is the most toxic user in our side of xda, he thinks his battery is pristine, asks for help, then refuses it and tries to find a culprit anywhere
A couple months ago he claimed that Oki's "Deep Wipe" function made his battery go bad (which he claimed beforehand too) and his explanation was that it made the system believe he had two batteries...
His shutdown problem when he ran a benchmark is not because of system instability or whatever, that's rather overclock/volt specific as we don't really have any oc kernel. The problem he has is that BCL acts when voltage goes below the safe threshold, because his battery is so wrecked that it can't withstand high current usage (i.e. high internal resistance and other stuff). I'm not going to tell this to him because he'll branch out as he usually does.
He's blaming the persist partition because his lockscreen says 5V charging speed, that's what he said in Telegram ? i mean we appreciate you keeping him busy, but you're just wasting your time. if anything just try to convince him that his battery is K.O., maybe he can change it and stop destroying whatever's left of this...
My response:
Re: heads-up about ter
I don't really need a heads up about anyone, although he is a waste of time. He doesn't know much of anything, but he is looking for any excuse at all that will explain his battery issues. If you ask me his battery is bad, I already tried telling him this. I only continue to try to help him because I figure he might listen at some point, but he's wearing my patience thin.
You dont need to tell him anything directly, I've decided I'm going to forward him a verbatim copy of your PM, and maybe my response as well. I really don't feel that it's OK to trash talk someone behind their back, especially when you wouldn't say the same things to them directly. If I have an issue with someone, then I take it to them direct, I'm not known for mincing words. Maybe he will just "lose it" on the forum and get himself permabanned. But then it will be his fault.
Mind if I ask what Telegram group you are a member of? Is it related to LOS?
His response:
Re: heads-up about ter
Who says I wouldn't say it to him directly? All of us did, he eventually got banned on the Schwifty group, made a different account, got banned again. It's borderline bullying on the GSI testing group. Now he's going around every old ROM thread commenting how they don't work
Also attach a verbatim copy of your comment, of course ?
Which has led up to now...honestly, your battery is going bad, you are just unwilling to accept it. Please stop wasting people's time, being antagonistic in general, and being more stubborn than a pack mule. Your request for my /sys directory is asinine, up until this point I've just been trying to help you, but you are deluding yourself. The sooner you replace your battery, the sooner your issues will be resolved. I will no longer continue to post in threads where you complain about your battery and post about weird off the wall **** that you think are supposedly causing your problems. Enough is enough.....
ok enough said.
i already told 100 times,these problem occurs on different setups,what they say is wrong.
that thing about geekbench,doesnt happen always.
and i have changed my battery...it sits on 50%.Doesnt chharge up,doesnt go down,just sits on 50%.
also sometimes when i change bootstack+vendor partition,my battery shows different % after.

Categories

Resources