Axon 7 how to fix persist partition?need help - ZTE Axon 7 Questions & Answers

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.

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.

Crashing Nook

Well, my Nook appears to be in trouble.
The long and the short of it is that it got wet. Not too wet, but wet.
It boots but whatever I boot to crashes. This includes sdcard installs. The ROM completes the boot, and I can sometimes even open the app drawer, but it crashes before I can interact with it in any meaningful way.
All ROMs complain of "System process" and Wireless issues, with FCs.
I cannot get adb to recognize the device anymore. lsusb does find the Google Inc. entry, though. When I try and run adb devices (ubuntu), it returns ?????? and says insufficient permissions. I have, in response, set up the 99-android.rules in etc/udev/rules.d but it still cannot connect. I have also tried to quickly access the android terminal in the brief period I am allowed before the device crashes with no luck. My goal with this was to try fdisk -l.
The sdcard never mounts while in the ROM, and the emmc storage appears completely wiped.
However, I was able to see I had the correct files in /rom once, so those are there.
Thinking that the wireless chip might be the problem (as when even when I return to stock the set-up fails there, well, until it crashes again...) I tried to just turn off Wifi in 7.2. But as I unchecked the box, right under the setting just displayed "error"
CWM appears to be working EXACTLY as it should, including mounting the sdcard and allowing me to choose update zips.
The uboot and the uboot menu work as well.
I have tried flashing CM7, 9 and stock, as well as booting from sdcard in CM9. All flash and boot normally, but crash.
I have done the 8x reboots, succesully, but when the B&N set-up begins, I cannot connect to wireless. Which would be okay, in the long run, but it then crashes, which is not okay.
I was hesitant to reveal that it got wet, because I can see this being written off as a hardware issue (which it may be, don't get me wrong). But the fact that CWM works and the ROMs boot sure look like software problems to me.
I have tried flashing just about everything that looked promising. I have not dd any images, because I cannot get adb to work, and don't have any idea which partitions are in what shape.
Any suggestions?
Position the unit upside down with the SD flap open. Blowdry it from the bottom up on medium several times over a couple of days. If it's still doing it after that you can probably eliminate moisture as a cause.
old cell phone trick
Fill a bowl with rice (uncooked).....the rice will draw the moisture out.
you can also submerge it in ispropol rubbing alcohol... is what we use to clean electronic components... it will combine with the water... also used for water in gas on a car
Whoa, isopropyl alcohol. I feel like that would take some stones...
I have already put it through a 30 or so hour rice regimen (if that is true, even. It makes some kind of weird intuitive sense, which is usually the kiss of death...)
I have it standing up now and will see about a little air dry method while I investigate where to find the alcohol.
It didn't get submerged, it was lying on a counter and a glass got knocked over. I grabbed it right up, and then left it off like I said.
It boots, CWM works, but since it has been set all the way back to stock and all iterations have the same issue I am fearing the worst...
Thanks for the ideas...any and all welcome!
You can take the back off. I have not done it, but somebody just said they did it to disconnect the battery to reset. Look at that recent thread in q/a. Maybe he can tell you how he did it.
Attempt at your own risk, no support will be provided.
I'm not the battery guy leapinlar was talking about but,
Open the battery flap, remove SD card, remove the tape dots from the T-5 torque screws then remove the screws. Slowly and carefully so as not to break any of the hooky thingies that are holding the back on pry the cover up from that point moving slowly around the unit.
I've only done this once, it was a while back and I ended up breaking two of the little hooky thingies. That's why I suggested providing points for evaporation to escape and attempting to accelerate evaporation. Heck we don't even know if moisture is the issue anymore.
Thanks for the extra suggestions.
I tend to think at this point that whatever water got in there is gone. It's been four days, and it wasn't soaking. I may just go ahead and try and take out the battery, I don't know exactly why that would help, but what have I got to lose?
If I had to guess, I would think that the wifi chip might be shorted, as that is the only thing that doesn't seem to work at least for some period of time.
The FC's sure do look software related though. I fail to see how CWM could read and mount the sdcard while the ROM cannot as being anything other than sotware. Unless they use wildly different methods to do the same thing.
This nagging feeling that I should be able to at least fix that with some software methods keeps me thinking the same or the other problems. I'd be okay with an non-networked tablet, if it came to that. But maybe the thing has to have wifi as an option to work right. I don't know...
Two weeks ago my daughter managed to completely soak her nook.The nook would just constantly reboot with the stock os and system process would repeatedly fc with the cm7 sdcard. I pulled the back cover off and let it stand for a week. Today I pulled the battery and power button cable and it booted up just fine so far. So there is hope.
Malave said:
Two weeks ago my daughter managed to completely soak her nook.The nook would just constantly reboot with the stock os and system process would repeatedly fc with the cm7 sdcard. I pulled the back cover off and let it stand for a week. Today I pulled the battery and power button cable and it booted up just fine so far. So there is hope.
Click to expand...
Click to collapse
Considering that this is basically what is happening to me (but with some additional Wifi setting crashes) this gives me hope.
I had burned a bootable CWM card, from Leapinlar, which was a higher version than I usually used. I think 5.5.0.4 (?)
Anyway, of interest (before I shut it down 2 days ago):
internal sd card is not wiped, it can be explored in CWM.
The /ROM partition is at least somewhat functional, as battery stats can be wiped
When I request a log, I get:
Code:
Battery Stats
Block Groups: 3
reserved block group size: 23
Created filesystem with 11/22608 inodes
and 2883/90357 blocks
warning: wipe_block_device: Discard Failed
W: failed to mount /dev/block/mmcblk1p2 (no such file or dir)
also at one point:
Code:
make_ext4fs failed on /dev/block/mmcblk1p2
(note: both of the above from hastily scrawled notes)
It looks like mmcblk1p2 is related to system mounting, although I am not sure. Maybe that is why I am having trouble with ADB. It just kept saying insufficient permissions and ???????????. I tried setting up android-rules for udev with no luck.
Unless I hear anything else promising, I will go get the proper screwdriver and try the battery thing. It has been sitting off for a couple days now...
Thanks for all the ideas, people.
I'm confused... but trying to help you out... why are you trying that stuff on /dev/block/mmcblk1p2 when /dev/block/mmcblk0p2 is the ROM partition?
Try your edits to /rom... and if you have to try: mount /dev/block/mmcblk0p2 /rom
DizzyDen said:
I'm confused... but trying to help you out... why are you trying that stuff on /dev/block/mmcblk1p2 when /dev/block/mmcblk0p2 is the ROM partition?
Click to expand...
Click to collapse
I actually didn't try to do anything. I just wiped system, cache, davlik, battery stats and asked for a log prior to flashing a new zip in the hopes that the rom would work if provided a blank slate.
I wiped battery stats since the .bin that holds them is in /rom. The log was something I had never done before.
The notes from above were just the CWM output from the log.
edit: I just saw your second paragraph. Don't know how I missed it.
But I don't know what you mean by edits. I haven't been able to get ADB working. I have been able to mount and unmount through CWM that's it. Unless you might know anther way to resolve insufficient permissions with beaucoup question marks instead of device number?
Ok... sorry about my confusion on that... It appears that you are using a CWM that is modifid to work on SD... since it is trying to access /dev/block/mmcblk1p2 since the rom partition is on /dev/mmcblk0.
I would try a different version of recovery.
DizzyDen said:
Ok... sorry about my confusion on that... It appears that you are using a CWM that is modifid to work on SD... since it is trying to access /dev/block/mmcblk1p2 since the rom partition is on /dev/mmcblk0.
I would try a different version of recovery.
Click to expand...
Click to collapse
Which I was. I got it from Leapinlar, and was under the impression, since I had seen him warn that roms flashed from that recovery would go to emmc, that it would work.
I did make a regular 3.2.0.1 bootable, and tried again, but with the same result, so I don't know if that made a difference. But it did seem hopeful, so thanks for the response.
I am going to finally go get the torque screwdriver and take this battery off and give it some days. It's been almost a week already, but you never know.
Thanks a bunch for the reponses, Diz.
mateorod said:
I had burned a bootable CWM card, from Leapinlar, which was a higher version than I usually used. I think 5.5.0.4 (?)
warning: wipe_block_device: Discard Failed
W: failed to mount /dev/block/mmcblk1p2 (no such file or dir)[/CODE]
also at one point:
Code:
make_ext4fs failed on /dev/block/mmcblk1p2
(note: both of the above from hastily scrawled notes)
It looks like mmcblk1p2 is related to system mounting, although I am not sure.
Click to expand...
Click to collapse
Mateorod, if you got that log using my CWM boot SD version 5.5.0.4, the recovery.fstab lists /dev/block/mmcblk1p2 as SD-EXT, which for some devices is the extended partition on SD for storing additional apps to supplement /data. Our implementation of CM does not use that. So when recovery tries to do some wiping, formating, backing up, etc, it always fails when it looks for that partition. It has nothing to do with /system or /rom.
If you told it to do a factory reset, it tries to wipe /SD-EXT as part of that and it fails to wipe that because it cannot find that partition.
Edit: That CWM SD does do its modifications to emmc. It only referenced mmcblk1p2 because of sd-ext.
Here is the filesystem table from my log using it on SD:
0 /tmp ramdisk (null) (null) 0
1 /boot vfat /dev/block/mmcblk0p1 (null) 0
2 /system ext4 /dev/block/mmcblk0p5 (null) 0
3 /data ext4 /dev/block/mmcblk0p6 (null) 0
4 /cache ext4 /dev/block/mmcblk0p7 (null) 0
5 /emmc vfat /dev/block/mmcblk0p8 (null) 0
6 /sdcard vfat /dev/block/mmcblk1p1 (null) 0
7 /sd-ext ext4 /dev/block/mmcblk1p2 (null) 0
The alcohol trick does work, I did it on my old HTC Kaiser. I disassemble it as much as I was comfortable, and then completely submerged it in alcohol until It stopped throwing up air bubbles; Thus showing there was no air left in the unit. I then removed the pieces from the alcohol and put them in a bowl of rice. I let it stand for about a week. Once the time was up a reassembled and turned it on like nothing had happened.
Little note: I was in the possession of a AT&T Go Phone for use as a back up in case this destroyed the unit. If you feel that there might be another way to repair it, I would suggest you explore that option first as I do not know what a significant time in alcohol will do to the inner workings of the Nook. However if you are at the point of already replacing or upgrading to a different tablet, than you have nothing to lose and can only gain a working Tablet or fancy Paper-weight from this.
Okay, a little update.
I had taken apart the Nook and let it sit for almost a week. But upon reconnecting the battery and clearing system/cache/davlik and reflashing anything, it still wouldn't allow in-ROM mounting of sdcard or adb or wireless and I would still get some version of "process System not responding" and "Setting Wireless not responding" toasts and then a crash, either in CM7, CM9 or Stock. Unusable.
What I think I have is a totally borked wifi chip. Which is okay, in the long run, but the Nook kept crashing and I would have liked to use it in some capacity.
What I decided (which was difficult to diagnose with no terminal or no ADB) was that the Nook was crashing upon trying to access the network and the saved network info. (which I know is mad persistent, as the wifi network I used to originally register the device still shows up in the stats, even after many many system wipes and 8x reboots and so forth.)
I had never reset to factory from stock settings and I couldn't now completely erase and deregister because you need wifi to do so.
However, I found this (which I had never heard of, sounds like a boon to thieves everywhere). After skipping out-of-box experience I could boot into stock recovery and finally erase the wireless settings.
Now I have a stable (albeit un-registered) stock nook, where I can at least read the books I have on sdcard.
I will eventually reflash a CM build now that the network settings have been forgotten and see if that is usable, even if there is no wifi.
But I am pretty happy to have some semblance of the Nook back, even if it is just a neutered (literally) stock.
I'll let you know how CM goes one day soon.
Thanks for the help!
Excellent, (and powerful), link.
And by virtue of that link I will find a way to proclaim my absolute geekitude within the company by dropping Kate's name. :good:
Well, I finally tried flashing Cyanogen 7 and 9 to the thing, but as it crashes when it tries to access wifi, I can't get it stable.
Unless anyone knows a code edit (smali maybe? I know there are a bunch of boolean settings in the SystemUI.apk, maybe there) where I can change the default wifi setting, I may just be stuck with stock.
Which is way better than nothing, at least it has use. Skipping OOBE was a life-saver for getting to a place where I could erase the WiFi info.
Okay, here's another shot in the dark, still trying to get this thing to successfully boot in CM...
I am working on a little project for the Nook, which will be infinitely easier to debug if I can actually boot into CM.
Does anyone familiar with the source code know how to modify it so that WiFi is set to off by default? I am thinking about changing the 'true' to 'false' in the /device/bn/encore/overlay/frameworks/base/core/res/res/values/config.xml entry for wifi found here...
Code:
<!-- This string array should be overridden by the device to present a list of network
attributes. This is used by the connectivity manager to decide which networks can coexist
based on the hardware -->
<!-- An Array of "[Connection name],[ConnectivityManager connection type],
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
<!-- the 5th element "resore-time" indicates the number of milliseconds to delay
before automatically restore the default connection. Set -1 if the connection
does not require auto-restore. -->
<!-- the 6th element indicates boot-time dependency-met value. -->
<string-array translatable="false" name="networkAttributes">
<item>"wifi,1,1,1,-1,true"</item>
<item>"bluetooth,7,7,0,-1,true"</item>
<!-- item>"ethernet,9,9,2,-1,true"</item -->
</string-array>
This looks like I am on the right track (this will eventually end up being compiled into the res folder of framework-res.apk) but I may need to track down the ConnectivityManager. Although the cursory look I have given this seems like I may be close to on the right track...
(The wifi being on at boot always crashes my CM installs due to shorted wifi chip, for those of you who may be new to the thread.)
I am asking here just in case someone knows, I may just go ahead and try it if no one chimes in. But better to ask than to blindly shoot in the dark, I figure...
Update: Success. I am back on CM9 (well, a hybrid, actually...HINT), without wifi.
Update 2: Due to the fact that this nook is now in a Cyanogen-usable state, a new rom will be posted in development tomorrow from eyeballer and I. Thanks for the suggestions, everyone. I wish I had dipped it in isopropyl alcohol, just so I could say I did it...

[Q] Nexus 7 /system corruption?

Hi all,
Has anyone else experienced data corruption on the /system partition? I'll probably have to return my tablet for replacement, but am wondering if it's happened to anyone else, or if it's just me.
Background:
A few weeks ago my Nexus 7 rebooted itself and became stuck at the 'X' logo - recovered by doing a full system re-image. It then worked for a week or so, then suddenly everything started force-closing, and after reboot I was back at the 'X' logo hang. This time fortunately I had debugging enabled and was able to dig a little further - turned out that several files in /system/framework differed from the ones in the original system image, even though they'd only just been reflashed - restoring those files from the image was sufficient to repair the system.
Just tonight it started happening again, and yet again one of the /system/framework files had changed. Comparing against the originals, it looks like a small number of bit errors, rather than any deliberate attack. In this case, framework.odex had a little over 1000 bytes with 1- or 2-bit errors, mostly (~80%) changes from 0 to 1. At this stage, I'm presuming that some kind of hardware corruption is going on here (considering it's normally a read-only partition).
Regards,
Nathan
I have experienced significant filesystem (ext4) corruption in /system (cross-linked block allocations), but I haven't observe "bit rot" in individual files afaik. I suppose bit-rot in filesystem metadata could produce the symptoms I observed, so I can't rule it out.
I thought I had a working hypothesis about why it was happening, and attributed it to something I was doing in TWRP, but I haven't run that hypothesis down yet. I am using lightly-rooted stock, so when this happened to me, I had only done a few things in /system such as the SuperSU kit and adding in the AOSP stock browser.
Anyhow - for the moment - the bit rot you describe does sound like media read errors & probably different than what I experienced. In either case, I certainly sympathize - it doesn't exactly instill a sense of confidence.
I thought that eMMC flash was supposed to be a lot more robust than MTD flash - things like automatic block remapping & wear leveling inside the controller allowing ext3/4 to be safe to use without causing premature failure... and even more so (you would think) with filesystems which are mostly used with read-only mounts.
Anyhow - because it keeps happening to you - you might want to revert to pure stock & relock your bootloader if your tablet is still under warranty. The next time it happens, set up an RMA, factory reset (using the stock recovery...) and send it in. (Even though it is a legitimate warranty defect situation, you can't really describe your diligence in tracking the problem down.)
good luck

[HOW TO] Trim Partitions in TWRP Before a Clean Installing a New ROM

How to Trim Your Partitions in TWRP for a Truly Clean Install​
Do you flash a lot of ROMs? Do you ever think to yourself, "I wish I could go through extra steps to get a performance boost?" Do you lie awake at night and wonder what happens to your old data when the "mkfs.ext4" command gets passed in TWRP?
If you answered 'Yes!' to 2 or more of those questions then this guide is for you! I'll explain how to run the Trim command in TWRP prior to a clean flash of a ROM to give you peace of mind and perhaps a performance boost! I emphasize perhaps because the level of performance we're talking about here may or may not translate to real world applicability, but I do it anyway because science!
Steps!​***WARNING: I highly recommend making a backup of your previous ROM because if you follow this guide we are going to send everything that isn't a binary zero to the data abyss until the only thing left on your device is a bunch of zeroes and TWRP. YOU'VE BEEN WARNED!***
Follow this method prior to a clean install only (TRIM command can be run at any time)
1.) Reboot to TWRP and Choose 'Wipe' from the main menu
2.) Choose 'Advanced Wipe' and select Data, System, Cache, and Dalvik Cache
OPTIONAL (Most people shouldn't do this step): If you copied your TWRP backup to your PC and want to wipe out your SD card select 'Internal Storage' otherwise do NOT check this option!
3.) Swipe to wipe the selected partitions
4.) Hit the home button and choose 'Mount'
5.) Mount the System partition (data and cache should already be mounted)
6.) Hit back or home, choose, 'Advanced', and then choose 'Terminal Command'
7.) Hit 'Select' in the bottom right corner to get to the command prompt (you'll be in the root directory)
8.) type this at the prompt, "fstrim -v /system" and hit enter (do not add the quotes)--it will show wiped space
9.) type this at the prompt, "fstrim -v /data" and hit enter (do not add the quotes)--it will show wiped space
10.) type this at the prompt, "fstrim -v /cache" and hit enter (do not add the quotes)--it will show wiped space
11.) Reboot to Recovery
12.) Install ROM and Gapps of choice then reboot to system when prompted
13.) Super clean install complete
But, Why?!​Here's a good article that sums up the answer to this question: http://arstechnica.com/gadgets/2015/04/ask-ars-my-ssd-does-garbage-collection-so-i-dont-need-trim-right/
F.A.Q.​Q: What does the TRIM command do?
A: When data is deleted by an operating system it gets flagged for deletion. Which basically means that it gets overwritten if the OS needs more space. Otherwise, it just sits there invisible on your drive for an arbitrary amount of time. I can't stand arbitrary. I prefer weekly.
Q: Who else uses this command?
A: fstrim specifically is a Linux/GNU command, but if you try to defrag an SSD in any modern version of Windows they pass this command as well. OSX recently decided to extend this trick to third-party drives that owners installed themselves. How...kind of them.
Q: Do I need to run this?
A: Absolutely not. Running fstrim just accelerates a process that Android will do itself eventually. There is even a hardware trim built into modern SSD drives, but I don't know that all smartphone flash memory has this feature.
Q: Break down the "fstrim -v / " command for me cause I wanna learn!
A: fstrim is the linux command, -v stands for verbose output so you can see the results, and / is your partition that you are calling to run trim on. We only have 3 partitions to choose from and those are: System, Cache, and Data.
Q: I get the error: fstrim command not found. Halp?
A: Reboot to TWRP, re-mount the System partition, and re-run the commands.
Q: Does it work on F2FS?
A: It seems to. I ran it on my data and cache partition after converting them to F2FS and it trimmed like normal.
Q: Running fstrim, rebooting recovery, and running fstrim nets the same output. Why?
A: I don't know why this happens. If you run fstrim twice in a row you'll see the first one gives a byte output and the second run shows zero if passed on the same partition. However, rebooting recovery and perhaps remounting the drives causes it to think trim hasn't been passed yet and does it anyway? I'm guessing honestly.
Q: Will you add more questions to this as members find errors in your guide and remind you that you left something out because you're human and clearly don't know everything?
A: Absolutely.
Wow... nice!!
Great OP, too. Very informative!
"give you peace of mind and perhaps a performance boost"..
lol, perhaps? performance boost you will not get, its more like when you just run a rom after clearing your "dalvik". it will "feel" quicker for about an hour or so. i say "feel" because there actually isnt a boost there, its just cleaner on the first run. anyways, and regardless, this is still a good thread
Redundant file fragments take up space and slow performance as they're automatically deleted. You may not notice much of a difference, but it's definitely not a bad thing
This is great!! Thank you for this information
simms22 said:
"give you peace of mind and perhaps a performance boost"..
lol, perhaps? performance boost you will not get, its more like when you just run a rom after clearing your "dalvik". it will "feel" quicker for about an hour or so. i say "feel" because there actually isnt a boost there, its just cleaner on the first run. anyways, and regardless, this is still a good thread
Click to expand...
Click to collapse
Lol you're correct to an extent, it is a lot like clearing cache/dalvik in a sense. But the main difference is that it actually overwrites the written sections and not just wiping the MFT like mkfs.ext4 does when you wipe a partition.
I'll put it this way, if the fine people at ASUS include it in my UEFI BIOS for prepping a new install of Windows, I think it should be a recommended step in installing a new phone ROM. For advanced users of course
Sounds like a great idea. So to clarify, by doing this trim we do not delete the internal storage (SD card) files we use such as files listed under the "downloads" folder. Is that correct?
Nickchapstick said:
Sounds like a great idea. So to clarify, by doing this trim we do not delete the internal storage (SD card) files we use such as files listed under the "downloads" folder. Is that correct?
Click to expand...
Click to collapse
Correct. As long as you don't choose 'Internal Storage' when wiping with TWRP you can safely trim the entire data partition. The fstrim command only overwrites data that has been marked for deletion through user intervention or from a wipe command in TWRP.
So I just did this and wow there was a lot of data there. For me that short 5 minutes was worth knowing my phone has less trash just sitting around. Kudos AlkaliV2. I'll remember this til the end of time.
Followed the instructions perfectly and enjoyed the next few hours reapplying all of my settings.
enginuity2 said:
Followed the instructions perfectly and enjoyed the next few hours reapplying all of my settings.
Click to expand...
Click to collapse
I love a good clean flash. I even deny automatic restore and pick, "Setup as new device" each time because I love choosing what will and won't be on my phone. It's a rush exceeded by many things. But still a pretty good way to end the day.
After Years Of installing many roms on my s3 mini (download mode showed 180 counts of custom binaries download!!!) this article brings first day freshness to my phone :laugh:
this gave me performance again; but my progress bar in some apps is bad again
AlkaliV2 said:
I love a good clean flash. I even deny automatic restore and pick, "Setup as new device" each time because I love choosing what will and won't be on my phone. It's a rush exceeded by many things. But still a pretty good way to end the day.
Click to expand...
Click to collapse
Is this method feasible on a device that has a A/B partitions?

[GUIDE] Re-partition your device using REPIT

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

Categories

Resources