yashsingh1/xdaforums huggingface dataset:
[Nexus S General] KreAch3R:
Hmm, that's odd. :eek: Did you mess with your usb drivers before doing this? Can you try on other ports/OSes? I don't have crespo with me (it's 200km away) but I remember that it works. Can anybody else confirm that?
[Nexus S General] mixtapes08:
Nope.. I can enable mtp by enabling it on the recovery. Thats the only way I can access my files.. But not on android. I've tried it on other pc's as well. Maybe I should redo the procedure?
[Nexus S General] KreAch3R:
I'd need to see a logcat first. I think that trying to redo the procedure will break more stuff that it will fix. Unfortunately, I don't have my crespo with me. Can you go to this screen in your phone (this is from a tablet, but you can get there from the 3 dot menu in Storage):
[Nexus S General] bluray93:
i've got the same problem of mixtapes08. i've followed your instruction, used rom zip and recovery. only difference is that i've added a small swap partition as first partition. for some reason nfc doesn't work too.

in my usb connection page i have 2 option:

ptp and multimedial devices, both uncheked, checking them doesn't give any help
[Nexus S General] KreAch3R:
I need logcats (especially when you toggle those options) from both of you. I will try to get in touch with my nexus s owner and make him do tests. What is the problem with the NFC? while sending files?

*UPDATE*: He confirmed the bug. But he also told me that 2 weeks ago he used MTP successfully (he has no idea what recovery is). Maybe a windows driver update messup? Did you try it on Windows?
[Nexus S General] bluray93:
i've started the process from zero without swap partition and NFC started working again, usb didn't yet. sent you logcats extracted using catlog via pm (sorry if not in english, realized after ), if you need something different let me know :o
[Nexus S General] KreAch3R:
Just a heads up, I will be able to mess with crespo in the next 2-3 weeks. I should be able to test your bugs and let you know what/if it can be fixed. :D
[Nexus S General] spider623:
And bb crespo, digitizer is dead
[Nexus S General] tapa_t:
[MENTION=3190122]KreAch3R[/MENTION]

Thank you for a very useful guide! I was able to make logical volumes and flash your lvm-modified cm11-m12 with /data being 13GB. Everything is good.

I then tried to incorporate the mod into an unofficial Omnirom (build 15) by lagloose.

http://xdaforums.com/nexus-s/development/rom-crespo-build-11-30-04-2014-t2567919

I compared the Omni and the unmodified cm11. The 4 files in the ramdisk, default.prop, fstab.herring, init.herring.rc, and init.herring.usb.rc and storage_list.xml in framework-res.apk were identical between the two roms, so I just copied your files into the omni. I replaced "/dev/block/platform/s3c-sdhci.0/by-name" with "/dev/lvpool" in the updater-script, and repacked.

It boots up nicely. The only problem is, the main storage (/storage/emulated/0) is invisible (not mounted?) to the system and anything that looks into the storage (camera, media server, etc.) crashes. Settings > storage shows the size of the storage as 12.7GB as it should, but only sees Apps and Cache in there, and doesn't see any other files in /sdcard, which can only be seen from a file manager with root access.

Other than that, everything seems to work.

I have read a quite bit about init.rc and storage configuration, and still have no idea why the system doesn't see /sdcard (or /storage/sdcard0, /storage/emulated/legacy, or any of its variants). Are there anything else you changed other than the 6 files mentioned above in your lvm-mod cm11, especially how the external storage is symlinked or mounted? I really don't know where else to look into.

Any suggestion is greatly appreciated.
[Nexus S General] KreAch3R:
I'm sorry. What happened?

Thank you for your kind words. :) I'm glad this could be helpful. Regarding your question, your problem seems rather odd. I have not tried porting this mod in another ROM, but I have had users telling me they managed to make it. Especially if the files are identical, there should be no problem, but knowning OmniROM, they could have changed something in low level that messes up these changes.

Given your description, I am thinking permissions and symlinks. Can you cd into the affected folders from a terminal emulator, or does this also require root? Can you check if you have included all the correct symlinks correctly? Also, a logcat could be helpful. Do you see anything in there?

To completely answer your question, no there is nothing more needed than what I have written in the guide. I made that completely sure because I knew that this guide would linger for a lot of time and I would forget all the details & specifics about it (I have moved on to 2 other devices since then). But as I said above, I will have time this month to test everything the last posts reported, so I might have time to test your problem, too.
[Nexus S General] tapa_t:
Thank you for your comment.

The only directories I can cd into in terminal without root are /data/media/0 with all files in sdcard, and storage/emulated with no contents.

data/media/0 (all files are there)

data/media/legacy -- no such file or directory

mnt/media_rw -- permission denied

mnt/sdcard -- no such file or directory

mnt/shell	-- permission denied

sdcard -- no such file or directory

storage/emulated (empty)

storage/emulated/legacy -- no such file or directory

storage/sdcard0 -- no such file or directory

I can see the contents of all directories above with root.

All symlinks included in your init.herring.rc are included, though some of them may not have been executed?

symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /storage/emulated/legacy /storage/sdcard
symlink /mnt/shell/emulated/0 /storage/emulated/legacy

All above lines are in init.herring.rc. However

ls -al /storage/emulated/legacy

did not show any link. All other directory have a link to /storage/emulated/legacy.

I filtered logcat by "storage". I see;

MountService: readStorageListLocked: using default storage list
MountService: got storage path: null description: null primary: false removable: true emulated: false mtpReserve: -1 allowMassStorage: true maxFileSize: 0
MountService: Missing storage path or description in readStorageList

Then after few other things, see a lot of

StorageManager: No primary storage defined

I suspected that, but don't know how that happened exactly.
[Nexus S General] alessandro_xda:
i've succeded in this procedure but i wanted to revert back to the original configuration and tried to do a factory reset but now i'm not able to reboot the phone nor to re-flash the cyanogen rom.

is there a way to restore the real factory reset of the phone? (i mean original partition and original rom too)

thanks
[Nexus S General] KreAch3R:
Yes, of course. If I remember correctly, try to flash the original trwp and format everything. If that doesn't work, try any steps that may be in stevens676's thread and let me know, i'll search more

To everyone else: I still remember that I have to deal with some problems here, but I haven't had crespo in my hands yet.
[Nexus S General] alessandro_xda:
i've installed the latest twrp (v2.8.7) and tried to perform a full wipe but the recovery is unable to mount the /system, /data and storage and it fails.

i've also tried to format system and data into ext4 but it fails too (current file system is LVM2_member)

the recovery doesn't seem to be able to interact with the lvm partitions.

then i followed the procedure in the stevens676's post and here is the result:

O:\adb>fastboot flash bootloader bootloader-crespo-i9020xxlc2.img
sending 'bootloader' (1536 KB)...
OKAY [ 0.245s]
writing 'bootloader'...
OKAY [ 0.332s]
finished. total time: 0.584s

O:\adb>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.007s]
finished. total time: 0.012s

O:\adb>fastboot flash radio radio-crespo-i9020xxki1.img
sending 'radio' (12288 KB)...
OKAY [ 1.915s]
writing 'radio'...
OKAY [ 1.666s]
finished. total time: 3.589s

O:\adb>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.007s]
finished. total time: 0.012s

O:\adb>fastboot -w update image-soju-jzo54k.zip
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
archive does not contain 'vendor.img'
Erase successful, but not automatically formatting.
Can't determine partition type.
FAILED (remote: Invalid Argument)
Erase successful, but not automatically formatting.
Can't determine partition type.
FAILED (remote: Invalid Argument)
--------------------------------------------
Bootloader Version...: I9020XXLC2
Baseband Version.....: I9020XXKI1
Serial Number........: xxxxx7xxxxxxxxxx
--------------------------------------------
checking product...
OKAY [ 0.005s]
checking version-bootloader...
OKAY [ 0.009s]
checking version-baseband...
OKAY [ 0.005s]
sending 'boot' (3964 KB)...
OKAY [ 0.578s]
writing 'boot'...
OKAY [ 0.498s]
sending 'recovery' (4308 KB)...
OKAY [ 0.631s]
writing 'recovery'...
OKAY [ 0.542s]
sending 'system' (337443 KB)...
OKAY [ 51.649s]
writing 'system'...
FAILED (remote: Write Fail)
finished. total time: 54.152s

unfortunately now it doesnt' boot into recovery...
[Nexus S General] KreAch3R:
[MENTION=419151]alessandro_xda[/MENTION]

What kind of procedure did you follow? This looks like you tried to flash a stock nexus image, with google's script.s Do you have a i9023 like I do or a i9020? Because you probably used the i9020 files (judging by the filenames)!

If you phone can boot, download the latest official twrp recovery for crespo, and follow these steps:

If that doesn't work, try to manually erase the lvm volumes. Unfortunately, it's been a long time, I don't remember all the commands. Try this:

And if that doesn't work either, find relevant commands (vgremove, lvremove) and try to delete the logical volume. After that, TWRP's factory reset should work, and if it doesn't, try to manually format each partition to ext4 (or whatever works).

I'm sorry that I don't remember the exact sequence and i'ts bad that I didn't document it, but be assured, when I was making this, a lot of times twrp couldn't find the partitions (either the disk ones or the logical ones). After a lot of fiddling with the same commands and workarounds like the ones I am talking about above, it always worked.

What's important for you now though, is if your phone boots to bootloader. If it does, flash the correct offficlal twrp recovery. If you boot into recovery and you still don't know what else to do, post some screenshots and the recovery log and I'll try to help.
[Nexus S General] alessandro_xda:
i've a 9023 too so i've fashed the stock image grabbed from here http://xdaforums.com/nexus-s/general/guide-factory-images-jb-ics-gb-t1572307 (there is a single image for both 9020t an 9023)

then i was able to reboot into bootloader, so i reflashed the twrp recovery.

now it doesn't boot and it doesn't even switch on! even if the phone is off and i connect the charger nothing happens!
[Nexus S General] KreAch3R:
You tried to flash a stock image because of that last line in steven's thread, right? I never had to do that.

To help you, I downloaded the latest official crespo/soju nexus image and I confirmed that there is only one set of files for both variants. The output you posted above shows that everything flashed correctly, except system (because of the partitions). But that shouldn't make your phone dead, as you describe it (at least, to my knowledge).

After the bootloader flash, did it ever manage to turn on? Or the last time it was open was when you flashed your bootloader? You seem to say that it managed to reboot:

So when did it stopped booting? After the twrp flash? Was that successful? Did you flash anything else with it?

I'm just writing my thoughts here, because these are uncharted waters for both of us. I never had to mess with stock images, and returning to stock was pretty straight-forward. I hope you can make it open somehow, then we can see how to fix the partitions.
[Nexus S General] alessandro_xda:
i've been trying during the last hour to:

-remove battery

-insert battery

-press vol up+power

ones out to 50 times the phone boots into bootloader (not recovery), when i try to reboot into recovery it turns off again...

i keep trying and when it will reboot again i'll try to reflash bootloader again...
[Nexus S General] KreAch3R:
Maybe it needs to be charged?

When you get it into bootloader, try to flash the correct official twrp, and reboot it into bootloader again. Basically, try to make something repeatable. What you are describing is very odd (and nothing to do with this mod :().
[Nexus S General] gadling:
Hi KreAch3R, thanks again for this guide and ROM. Everything went as you wrote and things work mostly great. A couple questions:

1. Looks like /cache is yaffs2 and cannot be changed to ext4. When I try to change it using the TWRP you provided, the operation completes and the cache stays as yaffs2. Is this a quirk of the Nexus S? (I ask because looks like you can't run fstrim on a yaffs2 partition. I was able to successfully trim /data and it helped in the phone performance for sure.)

2. I'm running into the same issue with MTP as some of the other posters. When booted into recovery, the phone mounts correctly as an MTP device ("Nexus S") on Windows 7x64. When booted into CyanogenMod, the phone doesn't mount as MTP. Selecting MTP from the "USB computer connection" menu does nothing and in fact if you select MTP (or PTP) and exit out of the menu and go back in, the box is unchecked again. I can confirm however that I was able to manually install the ADB driver in Windows and get the phone recognized in USB debugging mode.

3. There is a cm-11-20160111-NIGHTLY available. Any chance you will be able to update that with your changes? :)

Thanks again!
[Nexus S General] KreAch3R:
Thank you for your kinds words! I'm glad to see this one still be useful to people. :)

1. I have no idea about that, I didn't mess with partition filesystems at all. But, just an idea, did you try to change it in the fstab?

2. Thanks your confirming that, I have to look into it, when I get crespo in my hands at last (sigh). Life's been busy.

3. Yes, when look above :)
[Nexus S General] ekerazha:
The stock CyanogenMod firmware for Nexus S doesn't support MTP.

You need a boot image with this patch: https://github.com/ekerazha/android...mmit/d015a54ec443c8781a7b1f53e2e49df41bdffe82
[Nexus S General] KreAch3R:
Aaah, that's great! Thank you for this! I can even include this patch into this mod. :)
[Nexus S General] :
Hi everyone!

Does anyone still have the latest build (CM11-20150726-NIGHTLY ROM) of this ROM? Would you mind sharing the build with me? (yes, still "using" a Nexus S from time to time :cool:; currently running AOSP 4.4.4, but I'd like to get back to a ROM without storage issues)

Thanks in advance!
[Nexus S General] KreAch3R:
Gah, the links are down? I never thought I would lose access to a build of my own! If you can find me a cyanogenmod 11 build I can try to re-create it blindly (but you'll need to test it)
[Nexus S General] :
Didn't expect an answer that soon. :cool:

I've sent you the links to archive.org via PM, since I am not allowed to post links yet. ;)
[Nexus S General] KreAch3R:
Glad to know it's working on ART, too! Thanks for testing it!
[Nexus S General] ILCAMPIONE:
[MENTION=3190122]KreAch3R[/MENTION], do you think that i can use AOSP rom 4.4.2 (android) with this guide? Thanks
[Nexus S General] KreAch3R:
I can't find a reason that it shouldn't work. I didn't use any CM specific part of the kernel (I think). And the lvm guide that this is based on doesn't require a CM ROM specifically.

So I say that you should try it and ask me for help, if anything comes up. :)
[Nexus S General] ILCAMPIONE:
Ok now I have to convince my girlfriend (hard task).

i will start to study and to work on modification, after i will talk to my girlfriend ;)
[Nexus S General] KreAch3R:
Ha! Good luck! I had to "steal" the phone from my brother. :P (He loves it now though)

Consider finding her an alternative phone for a few days, to keep your head clear.

The good thing about this guide is that you can prepare the files without the phone. So you can leave the lvm commands and the actual flashing of recovery, ROM for when you get your hands on the phone.

Of course, every guide has its hiccups, so I wouldn't count on a super fast completion. It's big. :)
[Nexus S General] Jhyrachy:
With this modify, we should have 13 of space to install apps? *.*
[Nexus S General] KreAch3R:
13GB of space to install user apps, yes. :) Or do whatever you want with it. Take a look at the OP's screenshot.

INFO for anyone interested: I am taking exams right now, that's why the custom built twrp recovery and the FAQ have been stalled. I will update as soon as I find time.
[Nexus S General] draxxter:
Thanks!

[MENTION=3190122]KreAch3R[/MENTION] Thank you very much for this wonderful idea of "implementing" mako storage system through LVM.

I was using LVM to grow up the /data partition but never thought of the emulated one. Nice one!

I am now rocking an emulated F2FS userdata (12.32GB) and system partition running ART on CM11-M9 along with [MENTION=5165039]Setting.Out[/MENTION] script with really good performance.

My partition setup is:

/dev/lvpool/swap 256MB

/dev/lvpool/system 1GB

/dev/lvpool/userdata ~13.57GB

In case anyone is interested i can share my compiled recovery, boot and system images once i push my changes to my GitHub due to GPL for sharing content.

PS. I still need to run an AnTuTu Benchmark to check if i hit higher than before.

Thanks again.
[Nexus S General] KreAch3R:
[MENTION=5528674]draxxter[/MENTION], thanks for the wonderful feedback! Are you talking about a modified twrp that supports the modified partition scheme? I would like to give it a try.

Have you noticed any improvement using F2FS;
[Nexus S General] draxxter:
Yes modified TWRP 2.8.0.0 supporting mako partitioning.

As for F2FS some improvement but might be a placebo.
[Nexus S General] KreAch3R:
Please do share it! I am going to try it, and whoever else wants to, and if everything looks ok for other users too, I will update the guide to add your version!

I haven't built a recovery yet, but if I understand correctly, you have to use some specific build options in the Make Config, is that correct? Can you share those?
[Nexus S General] draxxter:
I will push tomorrow morning the device and kernel trees on GitHub and share the source code.

I will also upload the boot.img and recovery.img for anyone that wants to use the precompiled ones.

The flags you need to build the TWRP, assuming that you already using the android_bootable_recovery tree from Omnirom source are place in the BoardConfig.Mk.

I will quote those as well in the morning.

I am still working on some kernel modifications because i used as base CM11-M9 with some merges from [MENTION=3263349]ekerazha[/MENTION] 's Guru kernel but different configuration in the make file. The above gives good performance overall but fails 3D tests and some times there is stutter in the Google Camera app and on occasions the videos fail to load.

I might abandon this kernel and start from scratch with Bedalus Marmite v10.3 as source to bring it to where i will be happy.

In any case, more tomorrow.

See ya.
[Nexus S General] draxxter:
In order to build TWRP you need these modifications to device_samsung_crespo tree.

BoardConfig.mk

PRODUCT_COPY_FILES += device/samsung/crespo/twrp.fstab:recovery/root/etc/twrp.fstab
DEVICE_RESOLUTION := 480x800
RECOVERY_SDCARD_ON_DATA := true
RECOVERY_GRAPHICS_USE_LINELENGTH := true
BOARD_HAS_NO_REAL_SDCARD := true
TW_NO_USB_STORAGE := true

TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"

twrp.fstab

# mount point	fstype	device

/system	ext4	/dev/lvpool/system
/cache	yaffs2	cache
/data	ext4	/dev/lvpool/userdata
/misc	mtd	misc
/boot	mtd	boot
/recovery	mtd	recovery
/bootloader	mtd	bootloader
/radio	mtd	radio
/efs yaffs2 efs flags=display="EFS";backup=1;canbewiped

Please find attached recovery image based on the above.
[Nexus S General] KreAch3R:
Thank you [MENTION=5528674]draxxter[/MENTION]. I will try both of them when I get my hands on my brother's phone. Nice work! :)
[Nexus S General] ILCAMPIONE:
[MENTION=5528674]draxxter[/MENTION] I'm interested to your work, i will wait for link on GitHub
[Nexus S General] ILCAMPIONE:
hi KreAch3R

i am trying to "upgrade" my nexus S, but i have a problem with restoration of backup; i explain:

i formated usb storage in fat32, and i copied inside the backup -->

=mountpoint=/TWRP/BACKUPS/343268FC00DD00EC/2014-09-13--06-41-51 JZO54K is it correct? i have to change directory?

the problem is that in restore menu of TWRP i don't see anythings.

Can you Help me?
[Nexus S General] KreAch3R:
I think the directory is correct, and TWRP should show the backup. Please answer these questions too:

Did you have any problems creating the lvm partitions or the modified twrp recovery?

Did you deviate at all from the guide?

How much space did you make the /media/ partition (that is reserved for USB storage)?

Please post your recovery's twrp.fstab

Are you using Windows or Linux?

Go to TWRP's Advanced --> File Manager, and check if there is any file there. Also, check if you can copy any file from you PC and have it show there

Go to TWRP' Mount. Can you mount SDcard, or it keeps unticking?

(*I may have the naming wrong somewhere, as I don't have the device right now, and I recollect them from memory)
[Nexus S General] ILCAMPIONE:
No problem in lvm partitons, i used this comand in this order (for "partitions" )

/lvm/sbin/lvm lvcreate -L 550M -n system lvpool

/lvm/sbin/lvm lvcreate -L 13G -n userdata lvpool

/lvm/sbin/lvm lvcreate -L 1G -n media lvpool

for recovery: i downloaded your attached file (is it already modified, true?)

I didn't deviate

Like you can see from the command above 1GB (infact i see 1,1GB of usb media)

Where can i find it? and how i can post (if it is inside the phone)?

Ubuntu

Yes there are many files. how can i copy file from pc to here? (sorry for noobs question!)

i can't moutn sd card, i can only mount chace. And of course i can mount usb storage
[Nexus S General] KreAch3R:
Yes, my recovery.img should be working out of the box.

If you used my twrp.img, I don't need twrp.fstab, it wil be the same as mine

Which files do you see in there? Can you recognize if you are inside /system?

I am trying to think of what might have gone wrong, and I can't think of something. Was your backup copied successfully inside the /media/ partition? Was it small enough?

Try to find and paste the twrp log:

adb pull /tmp/recovery.log
[Nexus S General] ILCAMPIONE:
The file that i see are:

/and-sec

/boot

/cache

...

/sdcard

/supersu

/sys

/system

/tmp

and other file

my backup is about 400MB (i have a no root terminal so i rooted it and then backup, so it is a backup of a "vanilla 4.1.2 jelly bean")

i attached the file
[Nexus S General] KreAch3R:
These files are the recovery partition files. As you can see from the log, the recovery can't mount the partitions:

I:Can't probe device /dev/mapper/lvpool-media
I:Unable to mount '/sdcard'
I:Actual block device: '/dev/mapper/lvpool-media', current file system: 'vfat'

Use this command, while you have USB storage mounted, to check the file system type:

df -T

Is your USB storage shown as vfat?

I will have to go for now, I am sorry, but I will check your responses later this night. Try to:

a Wipe inside TWRP

Take the guide completely from the beginning, including the lvm commands. Maybe something was wrong there

Use the recovery daxxter posted
[Nexus S General] ILCAMPIONE:
LOL a simple wipe and ALL is ok, Great!!! Thanks too much!!!

for now i had to install your cynao-lvm rom, because i have some problem with apktool...

i decode the apk, modify the file, but i cant rebuilt (i think some library missing); so if you can explain me all step with more details i will grateful to you! (also in PM if you prefer)

THANKS AGAIN TOOOOOOOO MUCH