yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] Nobby1960:
Indeed, I have the build 02/07. Thank you, also for your great work!
[Galaxy S II Original Android Development] Weib67:
Post edited, as what I tried doesn't seem to work as expected. Just follow rlNanDo's instructions guys, and you'll be fine ! :)

The repit file is correct, but you'll have to replace "_" with "=" if needed. It has to be named exactly as the original attached file here.

Have fun. ;)
[Galaxy S II Original Android Development] Pier_89:
Won't sdcard0 be wiped after these steps? Why have you delete some steps with a line on the text (------)? :)
[Galaxy S II Original Android Development] Weib67:
Of course it will be wiped. Sometimes it's good to do it to have a truly clean installation, as some apps make tons of folders and files on sdcard0. :)

I just took rINanDO's instructions and edit them to anwser the question I just quoted about fresh install. It's basically the same thing but the step I mentioned. :)
[Galaxy S II Original Android Development] laptopu:
So if I wanted to do clean flash in future I need to flash the repit each time is that right?
[Galaxy S II Original Android Development] shkedov:
I think you got it wrong (to my opinion).

If you have installed the latest emu-recovery (which is currently TWRP-3.0.3-EMU-MIGRATION-20170213) then I don't see a reason for needing to repit.

Maybe you understood because those tweaks of storage.xml and other system files were mentioned to be reset to non emu if you would wipe data and clean install.

BUT NOT ANYMORE!!!:victory: Since our amazing trio is working hard, the latest TWRP seems to solve all of this problem. So I can see why you have mistakingly got that this way.

I mean, it's just the partitioning which stays forever until you change it.

Maybe I missed the whole idea? Maybe I'm wrong? Don't know man, let's wait and see others opinions.
[Galaxy S II Original Android Development] laptopu:
Ah... So if I install this twrp and wipe data, cache and system which for me is a clean install, the emulated data is left untouched?
[Galaxy S II Original Android Development] shkedov:
Whhoooo, that's a feature that has been implemented for pages lol! (got it? ages...)

So yes, unless you are choosing to FORMAT also the emu-data.
[Galaxy S II Original Android Development] laptopu:
That's the bit I've struggled understanding since page 1 haha! Now I know if I do a wipe of data using the emu twrp I will still keep emulated storage it all makes sense. Right, I'm on the latest official nightly, so if I then follow your guide (and I think a good clear out to do an SD card wipe too as your guide suggests is a good idea at this point), then I'll be on clean emulated storage and I can reflash the latest nightly then gapps and root then I'll be good to go, does that sound about right? :D
[Galaxy S II Original Android Development] shkedov:
My guide? :confused: I gave a few steps here and there, so I'm not sure what are you relating to.

It sounds right though...
[Galaxy S II Original Android Development] Nobby1960:
No, I had checked this today. If you make a full wipe in the emu TWRP, the data partition would be protected. A repit is not necessary.

[MENTION=2222292]rINanDO[/MENTION]

With the latest build of TWRP repit works fine now.
[Galaxy S II Original Android Development] the.gangster:
[MENTION=2222292]rINanDO[/MENTION]

I just had a look at the TWRP-3.0.3-EMU-MIGRATION-20170213 build. What an amazing step forward.

One little issue still existing is the strange cpio behavior:

And then I had a look at your github, as it didn't make sense to me that although weib67 didn't perform a backup and restore action (and therefore also didn't check/select the 'migrate_media' variable) should have migrated his phone to emulated storage.

Is that really possible? In the sources I only found migrate-actions if that variable was set. So I don't think the recovery would migrate to emulated storage without a restore with the chosen option, would it?
[Galaxy S II Original Android Development] Weib67:
Maybe you are right man, and I was too quick. :silly: Could you tell it from these screenhots ? I wasn't expecting that some apps would want to use this tiny SD partition, so I find this strange ! (In other words, I probably screw up :p ).
[Galaxy S II Original Android Development] the.gangster:
[MENTION=3964850]Weib67[/MENTION]

simply check your /data/system/storage.xml as described earlier in this thread.
[Galaxy S II Original Android Development] laptopu:
Aargh! I have a problem - I used this guide and got emulated storage but then some apps tried to access the tiny SD partition like DSLR camera application, so I tried changing the storage.xml file and did a soft reboot which made no difference. I then tried doing a reboot into recovery to do a wipe again and now it hangs on the TWRP intro screen each time I turn the phone on. What can I do?

I can get into ODIN if I hold volume down but I am on Ubuntu at home so would need Heimdall if I need to reflash this way, if I do (it's been ages since I've used Heimdall) what do I need to reflash and where from?

Then when my phone is back up and running, how can I get around the problem of apps trying to access the SD tiny storage space instead of the emulated space? Thanks.
[Galaxy S II Original Android Development] Weib67:
[MENTION=4419266]laptopu[/MENTION]

You should have read the last two posts of this very thread before doing anything !:(

=> Skipping steps from rlNanDo's instructions doesn't seem to work actually, even for a fresh install. Now we know !:cowboy:
[Galaxy S II Original Android Development] shkedov:
Oh no!!! I realy feel bad for you :(

Maybe it's not a problem in twrp but in the files you need to configure. I believe you have a clash because you modified storage.xml only and not also the other file.

Quoting from OP:{

Can wipe be 'fixed'?

Yes, but it requires a change in the ROM. This change has to be reapplied somehow every time you upgrade your ROM.

After a wipe, Android will initialize /data/system/storage.xml based on the value of system property ro.vold.primary_physical. If set to 1, Android will use non-emulated storage. To fix wipe, set this property to 0.

}

So the modded twrp is tweaking both files and you tweaked only storage.xml, so maybe it's a clash to twrp. You will need to access your phone's storage and fix this (or with flashing a script via odin or heimdall. I don;t know how to create scripts). I wish I could help. Good luck :fingers-crossed:
[Galaxy S II Original Android Development] Weib67:
Just do this steps:

"*Backup non-emulated storage partition to Micro SD-card

* REPIT with data=max-sdcard=min+wipe (probably unnecessary, but I did it anyway)

* Restore your last backup (with non-emulated Storage) and enable "Migrate non-emulated storage"

* i9100 with emulated storage"

I did not lost any data or apps during the process. :fingers-crossed:

Now, Diskinfo shows this (see screenshot) and everything is alright. :good:
[Galaxy S II Original Android Development] laptopu:
This is all really odd.

I used Heimdall and flashed TWRP 3.0.2-1 non emulated recovery, rebooted and it stuck on the TWRP logo screen still. Full panic stations.

I ended up having to get stock pit and rom, flashing over odin, I'm now back on stock jellybean.

Before I do anything else how could this happen? I was on the 13/2 nightly that was pulled from downloads, why was it pulled, could it have caused this?

When I get back up and running I'll be going back for emulated storage, but the question is still how can I get apps to use emulated storage not the tiny SD partition left? That's what started all these problems for me.

Lessons learned here, thanks for help, proves we're still experimenting! :)

EDIT - I'm struggling to get from stock onto TWRP, I got it once by getting CWM on with an old kernel, then found ISOREC kernel and flashed that over, then booted into TWRP, then I ran the repit file which screwed my phone it couldn't mount storage to install the rom! Is there a guide how to go from stock to twrp and CM14? It's been so long I don't remember how to do this. I'm using Heimdall on ubuntu and I've been at this for hours! AND on stock recovery it's now prompting me for a password to use encrypted storage on startup WTF?!! Have I screwed my phone?
[Galaxy S II Original Android Development] shkedov:
I'm afraid because of going emulated I cannot update to the new unofficial LOS14.1-20170216, it gives me error 7 - incompatible data (I removed assert already). I googled and found that it might be related to partition filesystem, maybe it has problem with /data/media/0 being ext4? I don't know, just reporting my issue. Could be something else, maybe twrp. Staying with the official-20170213 for now.
[Galaxy S II Original Android Development] the.gangster:
Wrong

Already explained it in one of these threads here. Nothing to do with assert. It's the difference between releasekeys of CM13/14.1(including unofficial lineageOs) compared to those of the official lineageOs.

But that's off topic here.

EDIT: That's the post. [MENTION=6330684]shkedov[/MENTION]
[Galaxy S II Original Android Development] shkedov:
I get it!

So may I simply remove the whole if that is responsible for matching releasekeys or I shouldn't flash them upon each other (as an update)?

Sorry for the of topicing, I just thought it could be related to the special twrp you amazing devs are working on.

EDIT: Yes I see, thank you very much!

So I finally updated to the unofficial-20170216 but then when system loaded the SystemUI error came there like in the experimental migration ROM, which meant for me that the ROMs didn't match or something else went wrong. Since other users have reported a successful update maybe it could be a compatibility issues of the unofficial-LOS releases with emulated storage.

So I'm asking if any user here with emulated storage confirms this SystemUI problem after attempting to update to unofficial-20170216. If not then it is very off topic and I'll stop bugging here.
[Galaxy S II Original Android Development] laptopu:
Need some help here guys please? I brought my phone back from dead using Odin, stock rom, back to cwm then twrp. Did a repit, wiped data, installed ROM. Even though nothing really to back up, I backed up non emulated storage and restored it to set the markers properly. Booted up.

First problem is the camera doesn't touch emulated storage. It saves everything onto my external SD card. If I try to save to the phone it tries saving to the tiny 10mb storage non emulated.

Then if I connect the phone to my PC I can only see the tiny internal storage or external storage, can't see emulated.

Have I done something wrong somewhere or is this how emulated storage works? I would have to go back to non emulated if that's the case unless someone can help?
[Galaxy S II Original Android Development] the.gangster:
[MENTION=4419266]laptopu[/MENTION]

strange. When I migrated to emulated storage manually (see details in post #5) almost every app switched to it automatically or at least it was easy to change that in the apps' settings.

Also when connected to a PC only externalSD and shared storage are visible.

So did you really activated the option to migrate when you restored your internalsd-backup?

Looks like your phone wasn't changed to use emulated.

Was the default filestructure created on it? You should check your /data/system/storage.xml to have proof that the primary_physical-flag really got removed. See OP for details or paste your xml here.
[Galaxy S II Original Android Development] ThunderBolt_BR:
Guys, just some tips for other noobs like me that are trying to test emulated storage:

- You must run repit from the temp folder (otherwise it will not be able to unmount the partition where it is saved and the process will fail)

- Beware if you are downloading repit from a windows PC: It changes all equal signals ( = ) into underscore ( _ ) in the name of the file while saving. If you don't change them back, repit will run but won't do any change to your partitions! It took me a good couple of hours to realise that...

[]'s
[Galaxy S II Original Android Development] the.gangster:
- If it fails unmounting it copies itself to /tmp and tells you to rerun it from there anyway

- The naming is not because of the windows PC, but depending on the the provider. You obviously didn't download repit from its original location that is linked in its thread. Most likely you downloaded a copy from this forum, as that is known to exactly do those renamings (although allowed characters for windows filenames).

(but good to point it out once more)
[Galaxy S II Original Android Development] the.gangster:
Good to have your detailed report on the experiences you made in trying to change the storage-mode and all that what followed.

But maybe nevertheless some comments on it to prevent others stepping into the same pitfalls:

If you really removed the whole line, that was your first error already. Only the string ->primaryStorageUuid="primary_physical"<- should be removed. Otherwise you break the xml-stucture.

That's the danger that all current inofficial 3.0.3-builds have in common: they are build on Nougat and won't be usable on older Kernels at all. Even the reboot-to-recovery-flag (if set) will not be resetted, having the potential to leave your phone unusable and recoverable only by reflashing in download mode.

I doubt that you found an old Philz that worked with an IsoRec kernel. The old Philz recoveries are using the old kernel-embedded-recovery-style, so your IsoRec kernel was gone.

Those who make sure to have read and understood the original threads that describe the single technologies or developements for our device, so for those who know how our device works, point 1 gets much clearer and for point 2 they'll discover bad advices much easier (even if coming from a dev!) ;)
[Galaxy S II Original Android Development] Weib67:
[MENTION=4419266]laptopu[/MENTION]

You are joking, aren't you ? :rolleyes:

I already answered you in this very post.

Then, a few hours later, you just ignored my response and kept asking the very same question !:eek:

You are the one who messed up your storage.xml file, and I never asked (nor advised) you to do it.

So no disrespect intended either, but before accusing others for your poor choices, be sure to actually understand what you are reading...

Good luck tough, I know it's not always easy. Just remember that for such experimental mods, you are the only one to blame if things go wrong for you.
[Galaxy S II Original Android Development] laptopu:
I saw your posts but it was skipping parts that caused the initial problems I ran into. I wanted you to be aware how rewriting the steps didn't solve anything, it made things harder. No hard feelings though and I'm back up and running :)
[Galaxy S II Original Android Development] Weib67:
My initial post does not cause any problem at all: it just doesn't activate the emulated storage. The precisions I wrote fixed the problem easily.

Plus, the.gangster also pointed out your error: messing with storage.xml.

So you can accuse me as much as you want and say you are not disrespecful, but you just are by saying that I caused your problems. Anyway, it's OT and I won't respond anymore to you about that here. Bye !
[Galaxy S II Original Android Development] laptopu:
And i wouldn't have been touching storage.XML had I been on emulated storage hence the reason my problems began with your post. Important others don't follow the guide and fall into problems. Like you say it's getting ot now.
[Galaxy S II Original Android Development] the.gangster:
[MENTION=3964850]Weib67[/MENTION]

even if you removed your instructions already ( Thx for that! ) , may I also kindly suggest to remove the attachments from your post #102, too?

As you have learned already, the xda-forum software changes certain filenames upon download (and btw. I still haven't seen any warning in that post to explicitly give that hint). Plus, sometimes people only link to their developments instead of attaching them directly for another good reason, be it to always point to the latest versions, estimate the number of downloads or what ever else.

It's also much easier (e.g. if severe errors would proofen to be in such a version) for a devoloper to withdraw an already published version, if it is still in his workspace. So from my point of view the decision of a developer not to attach a file in here should be respected. Especially if everything is still work-in-progress and for non-final versions. IMHO it also doesn't make that much sense to have those files seperated from the descriptions on how to use them only some 14 posts later, as it is now the case.

Please don't feel verbally abused now. This is only meant to improve this thread. If I look at the current downloads of your attached repit-copy there are almost 100 users already having a zip with an unusable croppy filename.
[Galaxy S II Original Android Development] svartson:
One general warning to those who just want to switch to emulated storage...

If you remove the variable from the storage.xml and reboot your device...don't go for the "we have detected a new sdcard. would you like to format?" dialog as it formats your external sdcard.

I am now trying to "photorec" all the stuff from my 32gb microsd card ;_;

Once I'm done doing that, I will do a full TitaniumBackup onto the external sd again and then i can maybe start using/flash twrp_emu and cm14.1
[Galaxy S II Original Android Development] the.gangster:
[MENTION=8072381]svartson[/MENTION]

welcome to xda.

Would have been nice, if you'd provided more details. Like, e.g.

Which ROM and build you were on, which storage setup you had prior to that and what you did exactly.

(I also left my microsd in the slot and wasn't ask to format anything at all)
[Galaxy S II Original Android Development] svartson:
then let's do this now:

device: i9100

rom: cm13(2016-12-xx)

partitioning: pit with 1g sys, 0.5g preload, 2g data(storage0) and max sdcard

ext sd: 32g vfat (storage1)

will take another attempt after work...

PS: my steps to recover data (by accidentally formatting as internal storage)

- format again as external storage (maybe there is a better way, but i couldn't even read from the sd)

- take out the card and insert into card reader

- use photorec by christophe grenier (? testdisk)

- your Files are named f1378961.jpg eg. but at least you have it back

Gesendet von meinem GT-I9100 mit Tapatalk
[Galaxy S II Original Android Development] the.gangster:
[MENTION=8072381]svartson[/MENTION]

Thanks for the feedback. Now, if I got you correct I understand what happend.

It sounds like you either had just freshly installed CM13 or freshly plugged in the microsd into your device.

As the offer to format a newly added sdcard as internal storage (as opposed to using it as portable storage) is asked only once Marshmallow (and newer) detects a new microsd.

Answering that question will always format that card and encrypt it which makes it unreadable if used in other devices.

So IMHO that is not a result of switching to emulated storage on an already setup device, but rather a result of your decision to use adoptable storage after a fresh ROM installation or after plugging a new card.
[Galaxy S II Original Android Development] svartson:
Neither have I recently switched to CM nor have I used the external sd for the first time.

The appearance of the message was brought up by removing the uuid part of the storage.xml.

I told my working colleague about this incident today and he told me the he was facing the same issue, just that he was smarter than me and backed up everything beforehand..

So this could happen to any i9100 cm user who uses an ext sd...

Gesendet von meinem GT-I9100 mit Tapatalk
[Galaxy S II Original Android Development] the.gangster:
ok. Strange. Then this seems to be either very different to the behavior in CM14.1 or you have removed the uuid of the external storage from the storage.xml.

Only the string " primaryStorageUuid="primary_physical" " hast to be removed, not any of the UUIDs itself.

But anyway:

no matter why and when:

Whenever people see this message popping up, people should choose to use the microsd as portable storage only or be aware of the consequences.

Thank you for hinting on that once more.
[Galaxy S II Original Android Development] svartson:
Just wanted to let you also know that twrp-3.0.3-EMU-0-i9100 wasn't working for me. Had to use heimdall and twrp-3.0.2-1 again to get my recovery back.
[Galaxy S II Original Android Development] the.gangster:
At least that I mentioned already in this thread that all experimental and unofficial 3.0.3 twrp builds are build with nougat and thus won't work on older kernels.
[Galaxy S II Original Android Development] kraehetest:
[MENTION=6560258]the.gangster[/MENTION] and the other developers

At first, thank you very much for your hard work.

I’m a fan from emulated storage so I try it last weekend. After a few hours the system was running. I had nearly the same problems like laptopu. See post #127

TWRP 3.0.3 emu is not running with CM13, so I had bootloader bootloops. (Flash CWM with Odin…)

And then problems with repit script (“_” vs. “=”)

[MENTION=6560258]the.gangster[/MENTION] I have a few questions or remarks.

I can’t flash (update) the latest nightly, incompatible data partition. Clean Install is working. I create a flashable zip file with a modified storage.xml. In your emu-build, the 8MB SD Partition isn’t shown. In my modified nighty I see the partition. Are there more differences in your build? I also have trouble with default-camera, not enough space on SD card. Why?? (Maybe the 8MB SD-Card) I found the reason.

I flash open-gapps aroma package. I like the most google apps. Google camera is not installed, but I had checked the install button. If I install the camera from playstore, the camera is running. If I force install the camera in gapps aroma package (force clean install), the camera is installed. But the camera is not working, insert SD-card. Strange. I found the reason.

If you had tips for me, I would be very glad.

Thank you very much
[Galaxy S II Original Android Development] todonormal:
I think what this job is very interesting and thanks to [MENTION=4141005]Lanchon[/MENTION], but is very important new thread for future TWRP 3.1.0 emuled with install instructions. Thanks for all too to [MENTION=6560258]the.gangster[/MENTION] and [MENTION=2222292]rINanDO[/MENTION]