yashsingh1/xdaforums huggingface dataset:
[One (M9) Original Android Development] Johnny424:
Good lord 7gb backups.. has anyone played around with compression of backups at all?
[One (M9) Original Android Development] miggsr:
I always use compression I have a stock nand and I've restored it twice with no issues compressed its about 5gb
[One (M9) Original Android Development] Electronic Punk:
Not sure I have seen any ROMs using this yet but wanted to reiterate earlier discussions.

For TWRP 2.8.5.0 and 2.8.6.4 (after system modified) the following can be used to mount system (and data for reference)

run_program("/sbin/mount", "/system");

run_program("/sbin/mount", "/data");

TWRP 2.8.6.0 is the most public latest release and can't mount system in this way nor can TWRP 2.8.6.4 with an unmodded system, so Captain_Throwback has recommended this way:

run_program("/sbin/mount", "-t", "ext4", "/dev/block/bootdevice/by-name/system", "/system");

run_program("/sbin/mount", "/data");

This not only works for 2.8.6.0 each and every time (it just won't mount system at all, ever), but also TWRP 2.8.6.4 that first time (and times after that)

Don't use it? When users flash your rom the first time they will be stuck on the bootloader because it likely formatted system but then couldn't mount it. So you can either use the above and get it right first time, or have them flash the rom again on 2.8.6.4 which will now mount system or watch it fail again on 2.8.6.0

Hope it helps!
[One (M9) Original Android Development] jauhien:
Dear Captain,

I'm unlocked and S-OFFed..

Now I want to flash RUU .401.15 and then take the new available OTA .401.17 - and I understand that there shall be no any problem with that..

However.

My problem is that I don't have any PC at home - and then at work due to company IT security policies it is prohibited to install any third party drivers or software on the workstation. :(

So I need to find way how to flash TWRP 2.8.6.4 whilst already being UNLOCKED & S-OFF but with the stock recovery and no ROOT at that time..

Thank you!

Any help or guidance is highly appreciated.
[One (M9) Original Android Development] jureca:
2.8.5.0 Install moment, others have errors, thanks!
[One (M9) Original Android Development] Captain_Throwback:
What?
[One (M9) Original Android Development] BillTheCat:
Not sure if this is TWRP-related, or ROM-related, but when pressing and holding the power key and selecting Power Off, the phone just reboots. It does not power down. I'm on an M9 with ARHD 4.q1 and 2.8.6.4

Hope I didn't screw anything up along the way.
[One (M9) Original Android Development] Captain_Throwback:
Since that's not how you reboot in TWRP, I assume you're not in recovery. And if you're not in recovery, it has nothing to do with TWRP.
[One (M9) Original Android Development] BillTheCat:
I was thinking it might have to do with partitions, permissions or flags, which if im not mistaken TWRP does manage. Just trying to track it down.

ETA: I was referring to powering down from the ROM, and was thinking that TWRP might be 'misdirecting' in some way. I had some issues when reflashing ARHD after wiping ALL the partitions in TWRP. I though the two might be related somehow.
[One (M9) Original Android Development] Captain_Throwback:
No. Again, TWRP is a recovery. It resides on the recovery partition. When you're not booted into recovery, TWRP might as well not exist (the exception to this is when the device is completely powered off - the recovery is related to offmode charging, but that's only after it's already been turned off, and plugged in to charge). To reiterate - TWRP has nothing to do with the ROM.
[One (M9) Original Android Development] BillTheCat:
Thanks for that explanation! It helps narrow things down.
[One (M9) Original Android Development] drmoeed:
Besides doing everything you mentiones , i couldn't take 1.32.410.17 OTA ... I have stock nandroid back up of 1.32.410.15 ... did tried every method you mentioned in OP ... but ... I FAILED ...

Any Help ???
[One (M9) Original Android Development] jauhien:
Only RUU..

http://xdaforums.com/showthread.php?p=60114607
[One (M9) Original Android Development] drmoeed:
Tried this ...

Still failed man ...

it gives the same error message ...

system mounted to read/write n blah blah ... :-|
[One (M9) Original Android Development] jauhien:
OK. I see..

Flash .401.8 RUU from the OP of the other thread:

https://drive.google.com/file/d/0B17smFr95pleMjhDVXVlTjlmX0U/view?pli=1
[One (M9) Original Android Development] drmoeed:
OK ... I'll flash the stock .401.8 recovery first ... And then OPJAIMG.img through Ext SD in device download menu ... Rite ???

And Should I ReLock bootloader before doing this ... ???
[One (M9) Original Android Development] BUBBA DUB'S:
*deleted*
[One (M9) Original Android Development] jauhien:
If you don't mind RELOCKED - make it either.. :)
[One (M9) Original Android Development] drmoeed:
I'm S Offed ... With 25$ ... But still ... I'll relock it ... Lol ...
[One (M9) Original Android Development] Nekromantik:
If you forgot to take backup of your system prior to rooting then can you still return to stock via RUU?

Also I have currently unlocked but SON and flashed custom ROM.

Do I need to RUU to flash firmware update?
[One (M9) Original Android Development] BillTheCat:
Will using an RUU cause a phone to lose S-off?
[One (M9) Original Android Development] SynisterWolf:
thank you [MENTION=1162986]Captain_Throwback[/MENTION] for this recovery. Roommate is happy his new device is rooted and ready to tweak with.
[One (M9) Original Android Development] Jonny:
No, once you're S-OFF you stay S-OFF unless you deliberately use the fastboot command to go back S-ON.
[One (M9) Original Android Development] caanda45:
Captain thanks for all your hard work....Sent u a little donation!! A little question here, I have purchased SuperSu pro can I switch to that or should I stay on the beta one?
[One (M9) Original Android Development] Captain_Throwback:
Once you're rooted, it doesn't matter which version of SuperSU you use. The Beta version of only required for it to flash while system is read only.
[One (M9) Original Android Development] Electronic Punk:
The pro version is a separate paid addon that adds functionality to the version of SuperSU installed.
[One (M9) Original Android Development] caanda45:
Ok guys need a little help, I flashed the sytem.emmc.win , now I need to flash stock recovery, where is the stock recovery? Was it not in system.emmc.win? I am trying to return to stock to take the update and then back to root and twrp after..any help would be appreciated!!
[One (M9) Original Android Development] Captain_Throwback:
Have you checked in the FAQ? I believe it tells you where you can find it . . .

Also, thanks for the donation! Much appreciated :)

EDIT: Specifically, FAQ #8 (yes, I just added numbers to make them easier to refer to)
[One (M9) Original Android Development] caanda45:
Sorry a little dense today, it said it will be in the ota? But I have not downloaded the ota? Sorry for this most likly silly question, can I get a little more hand holding on this one...I` am half flashed, just need recovery......:fingers-crossed:

I assume this is what you mean?

and here...
[One (M9) Original Android Development] Captain_Throwback:
Download the OTA and pull the stock recovery from the firmware.zip included within.
[One (M9) Original Android Development] caanda45:
LOL, I get it now, so one other dumb question, when I down load the ota where does the file download to on the phone?? All the other instructions are great, me just a little dense today....had a bootloop and I am restoring the clean first back-up thanks to you!!
[One (M9) Original Android Development] Captain_Throwback:
Someone else will have to answer that. I don't have a retail M9 so I don't know where the OTA files go on it. It's likely to the same place as it is on mine, but I'm not sure.

You do need root to retrieve the file, though, if it's in the same location as it is on mine (/data/data/com.htc.updater/files).
[One (M9) Original Android Development] caanda45:
Thanks re rooted and found it, it is in the same place, copying now and will re run everything....Thanks for the hand holding!!!
[One (M9) Original Android Development] caanda45:
Ok got stock recovery back but the update fails..here is a pic...I must be doing something very simple wrong to not get the ota to work? Sorry community and advice?
[One (M9) Original Android Development] Captain_Throwback:
Did you flash stock system back after you rooted to pull the OTA file?
[One (M9) Original Android Development] caanda45:
Yes, followed your instructions to a t...but see below...off to have dinner with the daughter, but I think that is the issue!! Tell me what you think...I will root again, change the cid and do it all again.....once I do the dad thing..

Yes, the light blub just went on, I think I need to change my cid back from super cid to BM___001. I then think the ota will work..I think that is the issue.
[One (M9) Original Android Development] caanda45:
So I changed the super cid back to my original one and then downloaded the ota update again and it would not flash as it says I have a modified system? Which I do as I am s-off...is that an issue? So I just re flashed the system.emmc.win again and trying one more ota update....lets cross our fingers and hope it works!!!

Nope it did not, so does it want me to relock? Here is the screen shot..so what do I do next?
[One (M9) Original Android Development] Captain_Throwback:
You sure you have a good system backup? You fastboot flashed it, and then restored it via TWRP? Might want to try someone else's if yours isn't working.

P.S. SuperCID has nothing to do with system read-write.
[One (M9) Original Android Development] caanda45:
What about s-off? Does that have an issue? Super cid must have something to do with it as before it would flash and abort, now with the it says a different message, but does not flash. Yes I used fastboot as I copied and pasted from your thread.....driving me crazy....
[One (M9) Original Android Development] Captain_Throwback:
No, neither S-OFF nor SuperCID has anything to do with it.

Did you restore the system image with TWRP after you fastboot flashed it (you didn't answer that question)?
[One (M9) Original Android Development] caanda45:
I did at one point earlier...maybe that is the issue..had so much trouble getting the stock recovery to stick...I will try that again....

1.So I have copied the system.emmc.win to my android sdk folder.

2. I then flashed the system in fastboot..

3. Then I should restore the system in TWRP the original system back up

4. then boot back to download mode and flash the stock

That is the right sequence?
[One (M9) Original Android Development] Captain_Throwback:
Looks like it. Hopefully it works for you as I'm going to bed.
[One (M9) Original Android Development] caanda45:
Thanks Captain, I will try again all in sequence, I hope the stock sticks!!! I will let you know!

Nope did not work..got the same error message as before....damn!!!
[One (M9) Original Android Development] BillTheCat:
I wanted to report some peculiarities discovered over the last day after using the official AT&T RUU from HTC, because I felt like "starting from scratch" as though the phone was new.

After applying the update, it is expected that the bootloader and recovery will be restored to factory, losing root and TWRP. It seems that the process for re-applying TWRP and SuperSU are somewhat different this time than when applying it to a factory-new phone. However, it's possible that my selections while using TWRP to wipe partitions - dalvik, cache, system, data, internal storage, SD-Ext - caused this characteristic.

I found that I was not able to apply TWRP 2.8.6.4 and SuperSU beta at the same time - in other words, I could not do them all in the same session. It seems that the process must be to reboot between each flashing operation, otherwise a ROM (at least in the case of ARHD 5) will not properly start, throwing errors on certain apps like systemui which force closes. I had to eventually use 'fix permissions' to get things right. So, in other words, here's what I had to do:

Apply RUU for 1.32.501.31

* Reboot into recovery

Flash TWRP 2.8.6.4

* Reboot into recovery

Flash SuperSU beta

* Reboot into recovery

Flash ROM

NOTE: it also seems TWRP settings for time zone, screen brightness and vibration are not being saved

I was hoping someone could confirm or correct my findings and advise if I might have made a mistake by using 'fix permissions' or at any other point in the process, or if this is just an error in the order of operations.

Thanks in advance!
[One (M9) Original Android Development] miggsr:
Im not exactly sure what you are trying to do... But I think there is a mistake there. I also did ruu on my device for my own reasons or testing and breaking stuff purposely. Your steps should be.

1. Run ruu

2. Flash Twrp 2.8.6.4

**reboot to recovery **

3. Flash Beta SU 2.48 zip

You should have stock rooted rom. Now if you want you can skip step 3 and just flash the rom of choice.
[One (M9) Original Android Development] BillTheCat:
Ok, I tried it again. I began with your process, but as you can see, had to adapt along the way.

Apply RUU

Intercepted reboot at end of RUU process to prevent stock AT&T ROM from loading

Reboot to 'Download' mode

Flashed TWRP 2.8.6.4

Reboot to recovery

Note - Errors shown on screen in red after rebooting:

E:mount -o bind '/data/media' '/sdcard' process ended with ERROR=255

Updating partition details...

E:Unable to mount '/cache'

...done

E:Unable to mount '/cache'

Full SELinux support is present.

E:Unable to mount '/cache'

E:Unable to mount '/cache'

MTP Enabled
​

Flash SuperSU 2.48

Note - Errors shown on screen in red when done:

Updating partition details...

E:Unable to mount '/cache'

E:mount -o bind '/data/media' '/sdcard' process ended with ERROR=255

Updating partition details...

...done

E:mount -o bind '/data/media' '/sdcard' process ended with ERROR=255​

Flashed ARHD 5

In the Aroma installer, I selected 'wipe userdata partition' to clear AT&T stuff

Error on install indicating failure of flash process

Returned to TWRP main screen

Reflash ARHD (same selections in Aroma)

Successful flash of ARHD

Obviously, something wonky is going on here. I'm just trying to figure it out, and the red warnings suggested to me that using TWRP to 'Fix Permissions' was the way to go. What I'd like to understand is where those errors are coming from, and if something is wrong, how to fix it.
[One (M9) Original Android Development] Captain_Throwback:
1) Don't ever use Fix Permissions in TWRP.

2) After you flash an RUU, you MUST let the device boot up so the partitions can initialize! Why would you "intercept" that reboot?

The above is where you're going wrong.
[One (M9) Original Android Development] miggsr:
Deleted
[One (M9) Original Android Development] BillTheCat:
1) Just curious - what does 'fix permissions' do, then? Seems an ill-advised thing to have in there if it's a loaded gun.

2) By 'intercepted', I meant that I held the Volume-down key after the RUU completed, and booted into 'download mode', to prevent the OEM system from loading up. The firmware reports correct verision (1.32.502.31) so I guess it's alright, no? Wouldn't the partitions initialize properly at that point? So far, ARHD seems to be running alright after the second go at flashing.
[One (M9) Original Android Development] Captain_Throwback:
1) It doesn't do anything good. That was really there for Gingerbread and older Android versions. Updating it to work properly with SELinux has been problematic.

2) I know what you meant by intercepted. I'm trying to help you here. I'm telling you how this works. You seem to want to question everything I'm telling you. The simple fact that you got all of those errors when you booted into recovery proves it wasn't alright. You have to let the device boot up for everything to initialize. I'm not going to say it again.

If everything's working fine (now), then great - go with it. I'm just telling you what you did wrong. I'm sorry if you don't like that.
[One (M9) Original Android Development] BillTheCat:
No reason to get snarky. I learn things by asking questions because unlike other users, I actually **want** to understand what's happening under the hood.

I'll give it another go and do it per your instructions. Stand by...
[One (M9) Original Android Development] hgoldner:
Wrong thread. Bill, this isn't a TWRP thing; perhaps you want to post in the Q&A for the AT&T M9 to get some help flashing ROMs.
[One (M9) Original Android Development] BillTheCat:
Thank you for your unsolicited input, but I've been flashing ROMs since 2008 when I first became a member here to unlock and flash a TyTNII. The process in this case is different, in that I've not had to use an RUU in the seven years since then, through my HD2 (converted from WM to Android), Inspire and M7 which all never had the peculiarity I'm seeing here. So I'll ask for your indulgence because, it seemed reasonable in my mind that a beta version of a recovery just might be having trouble with my device and/or ROM, and one needs to start somewhere.

ETA: That said, we also ought not to rule out the ol' "keyboard-to-chair interface glitch".
[One (M9) Original Android Development] miggsr:
Your history of devices is irrelevant to this discussion. Your issue was pointed out. A solution has been provided... Please try to keep it related to thread topic. If there was an issue with" beta" and your model device I believe others would have also jumped in on that subject. Let's keep it clean and on topic.

This PSA was brought to you by [MENTION=3604283]miggsr[/MENTION] [emoji41] [emoji41] have a good day.
[One (M9) Original Android Development] Rolando88:
Guys im trying to install rom.. just unlocked now i installed recovery and when i try to make backup (before my first rom install) i get error message from TWRP backup file size for '/data/media/0/TWRP/Backups/blabllablablabl/datetime/system.emmc.win'is 0 bytes back up failed

!?!!?! anyone help me please?
[One (M9) Original Android Development] miggsr:
1. Did read OP and post 2?

2. What recovery did you flash 2.8.6.0 or 2.8.6.4?
[One (M9) Original Android Development] Rolando88:
2.8.6.0
[One (M9) Original Android Development] miggsr:
That's your problem
[One (M9) Original Android Development] Rolando88:
I cannot find the other version do i oversee the download link 0_o
[One (M9) Original Android Development] miggsr:
Like I said... Read the OP and post 2 you will find what you need....
[One (M9) Original Android Development] bschram:
Answer this question please...
[One (M9) Original Android Development] vtotheinay:
so I see that I should be using the beta 2.8.6.4 instead of 2.8.6.0. im currently using the beta SU. i am with an unlocked bootloader and rooted. am i safe to just flash the beta TWRP over what i have and be good to go or do I need to reflash the SU file in recovery again after?
[One (M9) Original Android Development] miggsr:
I don't see why you would have to flash beta su again after updating Twrp if the beta su is for your rom... Not for Twrp
[One (M9) Original Android Development] vtotheinay:
ok thats what i thought. thank you. and TWRP would have to be pushed to the phone via ADB again correct?
[One (M9) Original Android Development] miggsr:
You can flash Twrp within Twrp... And you can also use Flashify to install Twrp.img
[One (M9) Original Android Development] vtotheinay:
ahh so i can just flash the zip of twrp with the .4 base in recovery mode? that makes things a lot easier.
[One (M9) Original Android Development] miggsr:
No there is an option in Twrp where you select to flash zip or img when you switch to img there is another option to select what type of img you are flashing
[One (M9) Original Android Development] vtotheinay:
got it! thank you very much

edit: so i flashed the new version and it essentially froze on me on the recovery page. i see all the options but cant choose anything. hit the power button and it says slide to unlock but i cant slide anything...

2nd edit: had to reboot everything by holding power + volume and went back into recovery. now it works.
[One (M9) Original Android Development] miggsr:
No problem... Just hit the Thanks button for now lol
[One (M9) Original Android Development] evilmastr:
Unlocked bootloader.

Flashed 2.8.6.0 and realized that was the wrong version (the beta versions should be easier to locate imho).

Flashed 2.8.6.4 instead.

Now making a backup and it says

E:dd if=/dev/block/mmcblk0p66 of='/external_sd/TWRP/BACKUPS/HT****/2015-04-25--18-10-02//system.emmc.win' bs=16777216 count=280 process ended with ERROR=

What does this actually mean? I assume it failed to backup the recovery?

I'm not really bothered by it, but I would like to know what is happening. :) This is a lot different from my old M7!
[One (M9) Original Android Development] Boostjunky:
I noticed this too, and by selecting Internal Storage while /System was still mounted as R/O for the stock backup, I was able to get a full backup without any errors. I would suggest going that route for your stock backup. Seems that after you have completed a stock backup and then mounted the System as R/W, you no longer have issues with making backups to the external SD card.
[One (M9) Original Android Development] sgt. slaughter:
The answer is here for you 2: http://xdaforums.com/tmobile-one-m9/general/please-read-rooting-using-twrp-t3069022/post60312919
[One (M9) Original Android Development] sentry07:
Is there a way to revert this?

I'm on AT&T with S-on & unlocked and I followed (most) instructions and got persistent root but... did not make a backup prior to root. After rooting software status in bootloader now shows "modified" . Used TWRP 2.8.6.4 to flash SU 2.48.

Over the past week I tried reflashing stock with numerous methods RUU, ZIP, HTC's update utility . I also unrooted, reflashed boot and stock recovery., but every time after reboot it's still showing as modified.

Would you be able to help?
[One (M9) Original Android Development] jauhien:
Flash your RUU.ZIP from sd card, and check..
[One (M9) Original Android Development] sentry07:
ADB, fastboot, or with recovery (stock/TWRP)?
[One (M9) Original Android Development] miggsr:
Fastboot
[One (M9) Original Android Development] jauhien:
http://xdaforums.com/showthread.php?p=60114607
[One (M9) Original Android Development] sentry07:
Thanks and that's actually one of the methods I tried over the past week and it never worked - but today i finished with no errors.

No cigar though, it's still showing modified.

Any other ideas?
[One (M9) Original Android Development] miggsr:
You are trying to return to full stock on AT&t? Are you s-off?
[One (M9) Original Android Development] sentry07:
Yes sir.
[One (M9) Original Android Development] miggsr:
http://www.htc.com/us/support/htc-one-m9-att/news/

Download that ruu. link is at the bottom 2.1 gb run from pc put phone in download mode. Don't worry about s-off. Remember this WILL ERASE INTERNAL SD. So backup everything.
[One (M9) Original Android Development] sentry07:
Tried that also already but to no avail.

I will try returning the phone as is since I'm almost up to 30 days and take my chances with AT&T, thanks all for your help.
[One (M9) Original Android Development] phanompin23:
My apologies in advance, but on htc dev unlock bootloader website, which device do I select to begin unlock process? Don't want to screw anything up...
[One (M9) Original Android Development] Aldo101t:
all other devices
[One (M9) Original Android Development] miggsr:
With all do respect... This seems all to sketchy to me. As I have done this process on various devices I have of HTC. 4 devices to be exact... all with no problem. I also did with my m9. As long as you have the correct ruu for the device and your device is s-off. Anyways this is getting off topic. Back to our regularly scheduled program [emoji41] Twrp 2.8.6.4
[One (M9) Original Android Development] sentry07:
I was responding from my phone and missed the s-off part, I was actually s-on - it should have worked regardless according to everything I read over the past week.