yashsingh1/xdaforums huggingface dataset:
[Nexus S General] sumit.nathany:
Use LVM with SlimROMs

Hello,

First of all. My thanks to you for such a wonderful guide. Really this guide is a life saver for me. Now I can install as many apps as I want without any issue.

I customised CyanogenMod ROM using your method and it worked perfectly fine. However, to be frank, Nexus S has such an old hardwarer that even bloatfree CM also runs very slow. The only ROM worth using on this device is SlimKat. So, I tried modifying SlimKat according to your guide. Everything went fine except that I cannot decompile its framework-res.apk. I tried several tools/methods but none of them succeeded. I researched more about this and came to know that since SlimKat is a "hybrid" ROM, its framework-res.apk won't decompile with normal apktool (http://xdaforums.com/showthread.php?t=2547805) SlimROM guys provided a custom APK tool for this but it works only for JB version.

I know its not related to this thread, but will it be possible for you to guide me or atleast tell me how can I decompile such hybrid apks. Or is there any other workaround I can use to modify SlimKat to use LVM.
[Nexus S General] KreAch3R:
Hello to you, too! I am glad you managed to follow the guide without any problems until the framework step. Unfortunately, this is the first time I head about these hybrid .apks. From my experience, Nexus S is indeed too slow to handle multiple apps running in the background (both cpu and ram wise). Using my posted rom, I manage to get a good performance by using the performance governor, disabling google location everything, using the Seeder app (questionable, but I think it does something for me) and limiting the background apps from the Developer Options. That is why I haven't resolved to Slimkat yet, which I am intrigued to do now.

Regarding your problem, you can try modifying the storage_list.xml in the cm framework-res.apk, and try to drag 'n' drop it in the Slimkat .apk (is Slimkat CM based?). Small chances that it would work, though.

Another option would be to try to create an Xposed module (wiki) (xda), but I don't know how to do that (or if it is even possible. I can find multiple guides changing the layout.xmls, but I couldn't find any instructions to change /res/xml files).

Then, the nuclear one would be to download slimkat source, and build specifically the framework-res.apk (you can build specific files only).

These 2 require that you can already do app development/building from source, otherwise they are both very difficult tasks for the newcomer.

One more option would be to find someone who can build from source and build this one for you. If I had the storage space, I would do that for you. But I only have space for one source tree (lollipop one). :/
[Nexus S General] sumit.nathany:
Success in booting up SlimKat with LVM support (partial)

Hello again,

Thanks for such a quick response.

I have been using Nexus S for a long time now and as you said it works only when every performance parameter is optimised - CPU is overclocked, governer modified, minimum services running at any time, unnecessary apps frozen and things like that. (I haven't tried seeder on it, though). But SlimKat ROM is way better than anyother ROM for Nexus S. Definitely worth a try.

Coming back to the problem, I managed to get SlimKat running on my device with LVM support. I 'drag-and-dropped' the storage-list.xml from your LVM-Supported-CM11 ROM (SlimKat is CM based). But I think something was messed up. Device did bootup and is working. However, media process always crashes. Also, any file explorer crashes.

I am not sure if an Xposed module will work. Also, I will need to learn to make one. I had considered building SlimKat from source but couldn't find any reliable guide to build SlimKat. I will find more about this. (Btw, I can do platform framework and app development. I work in Samsung India's Tizen Platform development team. :)

For the geek in you - Today Samsung launched world's first Tizen powered phone in India (proud to be a part of it :) - I am way too excited)
[Nexus S General] KreAch3R:
Oh, wow! Congratulations! I read about that on the news, great work, competition is always good for us, users! It's weird/awesome to speak to someone involved!

Back on topic, I will try it when I get my hands on my Nexus S (down-loaned to mother).

I should be the one learning from you, but, given my limited experience with this mod, I am troubled by these errors that you mentioned (I would expect it to not even boot, or boot normally). If you don't modify the framework at all, does it boot? Maybe check again if you modifed the boot.img correctly? During development, I remember having explorer related crashes when I had problems with the permissions set in init.rc, I think.

Of course though, I suppose these FCs could happen due to a corrupt framework-res.apk.

If Slimkat is CM-based, I doubt building from source will be much different. Check this guide here: Cyanogenmod official building guide and the Slimkat platform_manifest to get things going.
[Nexus S General] KreAch3R:
[MENTION=5667792]sumit.nathany[/MENTION]

I have good news for you! I managed to find a way to download only the specific parts of the crespo's slimkat source, and build you a framework-res.apk file! I built if blindly, so I have no idea if it is going to work, but I hope so. Grab it from the attachments.
[Nexus S General] sumit.nathany:
Will try this

Wow! That was fast! Many many thanks to you sir. I will try this and update you.

I am not sure if the issue of file explorer crashing was due to permissions. This is what I observed:-

1. File explorer like Solid Explorer or ES File Explorer are able to access sd card (media) only after they acquire root permissions.

2. Titanium Backup says media not mounted.

3. Most of the apps are not able to access (properly) my sd card.

I also took a relook at what I changed in SlimKat kernel and couldn't find any permission related issues. I took a diff of your LVM-Supported-CM11-M12 kernel with the official CM11-M12 and included the similar changes in SlimKat kernel but still found the same issues.

Also, I flashed kernel from your LVM-Supported-CM11-M12 on top of my LVM-Supported-SlmiKat but still found the same issues.

Anyways, I am gonna try with this new framework-res.apk.
[Nexus S General] KreAch3R:
I used to have similar problems when I had permissions errors. If I remember correctly, I had them before I introduced these:

#emulated SDcard storage
mkdir /data/media 0770 media_rw media_rw
chown media_rw media_rw /data/media

#FUSE NEW virtual sdcard daemon running as media_rw (1023)
service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated

I remember that the kernel log was producing errors. Can you post it, or even grab logcat, too?

I don't think a simple .xml edit with solve these errors, unfortunately. And I have no idea what Slimkat might have changed.
[Nexus S General] mrmabs:
It's about 3am here, I have been on this for a few hours now, so my post may not be completely coherent... My phone is the i9023 variant of the Nexus S.

I couldn't really get the method mentioned in the first few posts working. The TWRP didn't initialise the LVM partitions, wouldn't format, rebooted randomly when dealing with the partitions, it became a bit of a mess... What it looks like is the custom recover didn't initialise the lvm, so I manually made them, using http://xdaforums.com/nexus-s/genera...-using-lvm-t1656794/post26164488#post26164488 as a guide. I then manually made the lvm group (no previous knowledge of LVM before today), using clues in post 2 (for partition sizes, I used 1G & 13.82G).

After that I modified the CM11 download myself. But every time I tried to transfer the file via MTP, TWRP would crash, so I manually pushed it over with adb. I also had problems with permissions on /sdcard (/data/media). (permission issue not solved quite yet)

First attempt to run the CM11 install zip formatted one of the lvpool partitions (made the change from post 2), so I just ended up copying over the update-script from your file as it played nicer with formatting and mounting the userdata and system partitions.

I finally got a spinning cynaogenmod screen and became very happy, my Nexus S now tells me it has 13.6GB total internal storage :D
[Nexus S General] KreAch3R:
[MENTION=1009234]mrmabs[/MENTION]

I am glad you got it working! :D Enjoy your "new" phone!

Please share a bit more of your experience, so that I can update the guide if we find any errors. First of all, you were supposed to use the LVM guide to create the lvm partitions, it couldn't work otherwise. Was it confusing?

Secondly, did you manage to format system, data internal-storage, sdcard, etc successfully using TWRP? What permissions errors did you have? Maybe you have something in common with the errors [MENTION=5667792]sumit.nathany[/MENTION] is reporting.

Thirdly, I suppose I could post my updater-script, too. What changes were you making that weren't working correctly?
[Nexus S General] mrmabs:
[MENTION=3190122]KreAch3R[/MENTION]

The disadvantages of being tired, that is how I ended up making the partitions, the userdata one I made maximum size after using "# /lvm/sbin/lvm vgdisplay" to work out how much space I had left after making the 1Gb system partition. In step 3 I would put the link to the other guide in there, and maybe include the full command lines used to create the partitions.

TWRP LVM 2.8.0.0 (in post 3) was the biggest problem, I needed to manually format the data partition for the first time (and as a linux user, I couldn't find mkfs.ext4, eventually found make_ext4fs). If it had problems finding the partition it would crash (ie restart recovery) with no error message. Most times when I tried transferring files it would also crash, some times immediately, sometimes after a few seconds; if it made it past that, there wasn't a problem (I was transferring files with that TWRP before I built the LVM). Oh, and no amount of reformatting /data or Internal Storage seemed to fix the permissions. I will have a go at the permissions again in the morning.

In the update-scripts file, I missed the "/system" formatting line, which killed the LVM that had to be manually pulled apart and redone.

PS: chown I think needs a colon ":" between the user and group name
[Nexus S General] KreAch3R:
Gotcha. Thank you. So I am thinking about these changes:

complete LVM commands from start to finish

Streamline TWRP formatting/flashing. If I can, use adb commands there, too.

Post the updater-script of the ROM

Unfortunately, I can't do this soon because I don't have the device in my disposal, I only get to it during holidays. But in the next big one (in April, I think) I will try to update the guide.

I didn't understand what you said about the permissions, though. Are you still having permission problems after all? Did you try my uploaded rom, and if yes, did you experience these errors with it, too?
[Nexus S General] ekerazha:
KreAch3R, you used the TWRP recovery for this howto... did you also try the CWM recovery?
[Nexus S General] mrmabs:
~ # chown media_rw media_rw /data/media
chown media_rw media_rw /data/media
chown: media_rw: No such file or directory
~ #

~ # chown media_rw:media_rw /data/media
chown media_rw:media_rw /data/media
~ #
[Nexus S General] KreAch3R:
No I haven't unfortunately. Firstly, because the original LVM guide is using TWRP, and secondly because, well, I think CWM is dead, isn't it? Why do you prefer CWM?

I don't have my device, I can't test these commands. Why do they differ? Is it a "before vs after" ? Is your ROM working correctly now? Did my slimkat framework worked?
[Nexus S General] leap_ahead:
I think user is 50%-50% on s4 ..but I use twrp
[Nexus S General] KreAch3R:
On s4? As in "Galaxy S4"? I have no idea about this device, but in my Nexus line I have a feeling that very few still use it.

Anyway, modifying CWM might still be possible. The guide is there, anyone can try it. :)
[Nexus S General] leap_ahead:
Ne file sto galaxy s4
[Nexus S General] ekerazha:
I usually use CWM because TWRP had issues with backup/restore in the past.
[Nexus S General] KreAch3R:
I see. I haven't had issues while developing this mod. I would like to try to port it, but only after a month at least (exams). You should try it, it shouldn't be very hard, unless cwm is completely different from twrp.
[Nexus S General] KreAch3R:
[MENTION=5667792]sumit.nathany[/MENTION]

So, how did it go? Do you still have problems? Did the framework-res.apk worked? I would like to delete the slimkat source :)
[Nexus S General] sumit.nathany:
Didn't work

Hello,

Sorry. I got caught up in few other things. I tried with framework-res.apk. But still the same problem is happening. Looks like there is some other problem. You can go ahead and delete the SlimKat source :)

I will try to experiment more on this and see if it works.
[Nexus S General] KreAch3R:
I guess then that it is indeed something different in Slimkat. I will get to play with my Nexus S around April. If you are still using it, I will let you know my findings. If you have any problems with my CM11 mod, let me know. :D
[Nexus S General] KreAch3R:
New custom built 2.8.4.0 TWRP!

Hello again, another big update, in the form of a new TWRP recovery!

I took [MENTION=3122936]daxxter[/MENTION]'s advice and built a new 2.8.4.0 TWRP recovery that fits this project and recognizes the lvm / internal sdcard partition scheme:

I am using the Materialised theme port found here.

So, go ahead and flash the latest TWRP recovery for our modified Nexus S's! :D Links in the 3rd post.
[Nexus S General] g33k0 b3lk0w:
First of all I'm getting my Nexus 4 tommorow, I'm giving Nexus S to my brother and he likes a lot of apps so for the last dich effort I tried this guide to give him as much space for apps as possible. With a lot of fiddeling with everything I managed to do it just now and I'm installing all the apps and stuff. Thank you so much Krearch. I can't thank you enough for this. I'll still be around Nexus S threads if they live again but this was just a great ending to a great story with me and my curvy Nexus S. Thanks and good luck to everyone :D
[Nexus S General] KreAch3R:
I am very happy for you. :) This is the reason I wrote this guide for this dying phone, because it can truly be a blessing for the person that will get it second-handed. I went through the same phone changes as you (Nexus S -> Nexus 4, now on Nexus 5), and my brother was following. He got to use it with the limited 1GB internal space for a lot of time and he loved the transition! I hope your brother does, too. Thanks for taking the time to thank me. Good luck to you, too! :D
[Nexus S General] sumit.nathany:
It works - SlimKat ROM with LVM support

Hello [MENTION=3190122]KreAch3R[/MENTION]

I managed to get SlimKat running properly with LVM support. I didn't have to do much - just added your LVM related changes to SlimKat and it worked like a charm. I don't know why it did't work the last time (may be I had missed something that time)

Here's what I did:-

1. Take the latest SlimKat ROM (9.0-WEEKLY-8321)

2. Replace its kernel with your lvm supported kernel of CM12

3. Replace its framework-res.apk with the one provided by you a few weeks back.

And we are ready to roll.

A SlimKat ROM with entire 16GB available for apps - Its like a dream come true for us crespo users. I hope to use this ROM for a long time now (crespo is still my main phone - can't afford to keep trying new ROMs daily). I also believe next time I will flash an L ROM - it probably would be on a new phone :(

This is the best farewell I could have expected for my Nexus. Ton of thanks to you. None of this would have been possible without you. I have just collected pieces from your original work into a different ROM. You are doing a great job. Continue the work. Who knows we may have similar kind of great farewell for bacon in 2020 :)

Even though its easy to "create" this LVM-Supported-SlimKat ROM, I will still upload it - may save some effort for other users.

Here's the link to ROM - http://www.mediafire.com/download/j7imvg94ep34crg/LVM-Slim-crespo-4.4.4.build.9.0-WEEKLY-8321.zip
[Nexus S General] KreAch3R:
[MENTION=5667792]sumit.nathany[/MENTION]

Thank you for your kind words! It means a lot to me. This is exactly what I wanted, when I started creating this guide. I wanted to let others give a great end of life gift to this awesome phone.

And please, yes, upload the ROM. Link it to the comments, also, so other users can grab it if they want.
[Nexus S General] sumit.nathany:
I have given a link to ROM in my thread but I do not know how to 'Link it to comments section' (or what does it even mean :))
[Nexus S General] KreAch3R:
Derp. :P

I wanted to say "link it to your comment, too". Basically, I was urging you to post the upload link here, too. :)
[Nexus S General] spider623:
Megale thanks, will test later
[Nexus S General] spider623:
It lives!!!

Forgot to add a 512MB swap but it lives!

now if we only had a lollipop rom like nexus s 4G has....
[Nexus S General] KreAch3R:
Good job! :D

What??!! Where? I can't find it
[Nexus S General] spider623:
it's more of a joke, 3 parts from survey download site, ~400MB each
[Nexus S General] KreAch3R:
Aaah, you had me completely ready to dive into whatever was necessary to port it over... :/ Unfortunately, I don't have the knowledge to do it by myself (yet, at least). Did you share the thread in the BitSyko Development Community? If so, thank you! :) :good:
[Nexus S General] spider623:
yep, a few hours ago
[Nexus S General] RappyBMX:
is there a way to do this without having a backup !?

just by flashing twrp, making the partitions and then flashing a clean rom/kernel !?
[Nexus S General] KreAch3R:
Of course, yes. If you don't care about anything on your device, including the sdcard, or if you have a completely empty phone, you can do it. I have done it multiple times during testing.
[Nexus S General] RappyBMX:
I have titanium backups, and everything else is backed... If you could tell me what rom to download and the structure of the partitions since i tried this about a month ago and couldn't get it to work...
[Nexus S General] KreAch3R:
Then you 're good. I have uploaded an already modified CM11 ROM, check the third post. As for the partition scheme, it is included in the guide. You can use whatever you want. I use a 1GB system and 13,5GB data, I think.

What problem did you have? Try the guide again and post back if you have problems again. I'm here to help. :)
[Nexus S General] RappyBMX:
# flash recovery lvm-twrp-ext4-2.8.4.0.img
# adb shell
# /lvm/sbin/lvm pvcreate /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev/block/mmcblk0p3
# /lvm/sbin/lvm vgcreate lvpool /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev/block/mmcblk0p3
# /lvm/sbin/lvm lvcreate -L 1G -n system lvpool
# /lvm/sbin/lvm lvcreate -L 13G -n userdata lvpool
## reboot recovery

and on the phone i get...

E : Unable to mount '/data'
E : Unable to recreate /data/media folder.
Updating partition details...
E : Unable to mount '/system'
E : Unable to mount '/data'
...done

Also in mount i only have: System, Data, Cache and EFS. and data cannot be mounted.

!?
[Nexus S General] KreAch3R:
Check the guide, try to format the partitions to ext4 from the wipe menu.
[Nexus S General] RappyBMX:
After factory reset it worked... flashed rom & gapps... also installed the Materialised theme.

Awesome, Thank You :D
[Nexus S General] KreAch3R:
Great! I also use this theme. I will try to update the TWRP recovery to 2.8.50 when I can.
[Nexus S General] zoraks:
hey, just bought this device on ebay about a month ago as backup while my main phone is on repair service.

First thing i did was follow your tutorial and, well, I believe that you just make my life easier cause it would have been really annoying to use this phone with so small system...

Maybe it's not anymoe the flagship it was in his days but with some tweaking it's still really usable for daily basis and i'm happy with it.

So, thanks for your eforts and your time, really :)
[Nexus S General] KreAch3R:
It is indeed fine for basic secondary use! Amazing little phone! Thanks for sharing your story, this is what keeps me updating this thread. Have fun with your new phone. :)
[Nexus S General] nyancat:
Thanks a lot dude youre this is what i'm looking for and making it more easier than ever, i just copy paste all of these line into cmd lol. Well my nexus s is now running ART.
[Nexus S General] Xhizors015:
Bump!!

I hope someone will reply

I already finish everything except the part when you flash the modified rom

in TWRP

E: error executing updater binary in zip '/sdcard/cm-11-20141112-SNAPSHOT-M12-crespo.zip

Error flashing zip

Updating..

done...
[Nexus S General] KreAch3R:
Hello,

Is TWRP recognizing the modified volumes correctly? Can you reformat them again, just to be sure?

Is the download good? Try to re-download.
[Nexus S General] Xhizors015:
I think so, yes.... everytime i enable MTP, internal storage shows with 12.7 GB

Already done

Well, I already downloaded your files four times

I tried the official rom from CynogenMod and it was flashed successfully

just to make sure that i have working TWRP..
[Nexus S General] KreAch3R:
I don't think the official .zip could flash correctly if you have done the mod successfully. Check if you have created the correct volumes in TWRP (in format) and not on the PC. Also use the lvcreate etc commands to check the volumes (I am on mobile right now, can't link). Secondly, grab a TWRP log and link it to pastebin or here (google for it, it's easy).
[Nexus S General] Xhizors015:
i think i have a serious problem right now

log from creating logical volume

[SIZE="1"]C:\Users\SEMT\Downloads\Compressed\adt-bundle-windows-x86_64-20140702\sdk\platfo
rm-tools>adb shell
~ # ←[6n/lvm/sbin/lvm pvcreate /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev/bl
ock/mmcblk0p3
/lvm/sbin/lvm pvcreate /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev/block/
mmcblk0p3
File descriptor 8 (/dev/__properties__) leaked on lvm invocation. Parent PID 98:
/sbin/sh
File descriptor 10 (socket:[2099]) leaked on lvm invocation. Parent PID 98: /sbi
n/sh
Physical volume "/dev/block/mmcblk0p1" successfully created
Physical volume "/dev/block/mmcblk0p2" successfully created
Physical volume "/dev/block/mmcblk0p3" successfully created
~ # ←[6n/lvm/sbin/lvm vgcreate lvpool /dev/block/mmcblk0p1 /dev/block/mmcblk0p2
/dev/block/mmcblk0p3
/lvm/sbin/lvm vgcreate lvpool /dev/block/mmcblk0p1 /dev/block/mmcblk0p2 /dev
/block/mmcblk0p3
File descriptor 8 (/dev/__properties__) leaked on lvm invocation. Parent PID 98:
/sbin/sh
File descriptor 10 (socket:[2099]) leaked on lvm invocation. Parent PID 98: /sbi
n/sh
Volume group "lvpool" successfully created
~ # ←[6n/lvm/sbin/lvm lvcreate -L 1G -n system lvpool
/lvm/sbin/lvm lvcreate -L 1G -n system lvpool
File descriptor 8 (/dev/__properties__) leaked on lvm invocation. Parent PID 98:
/sbin/sh
File descriptor 10 (socket:[2099]) leaked on lvm invocation. Parent PID 98: /sbi
n/sh
Logical volume "system" created
~ # ←[6n/lvm/sbin/lvm lvcreate -L 13G -n userdata lvpool
/lvm/sbin/lvm lvcreate -L 13G -n userdata lvpool
File descriptor 8 (/dev/__properties__) leaked on lvm invocation. Parent PID 98:
/sbin/sh
File descriptor 10 (socket:[2099]) leaked on lvm invocation. Parent PID 98: /sbi
n/sh
Logical volume "userdata" created
[/SIZE]

question... what would be the size of framework-res.apk?
[Nexus S General] Xhizors015:
Thank you

OK I already figure it out KreAch3R

I just modified your modified rom lol hahaha :p what a waste of time

I have so many files and I think I switch it out with yours thats why I always get the error

BTW it will be great if you have screenshot to your instructions, my friends are little bit confused since english is not our main language.... but over all this is a great guide

Thank you for this now i can download more apps