yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Android Development] Lanchon:
boards with lost IMEIs? that would be great to test!!! no big loss in the worse case.

don't bother with the PIT files. just follow the main instructions. this is to test if it TRIM works without bricking in those chips. if you later want to set up a phone for real use, you can try resizing the partitions (i would for my phone).
[Galaxy S II Android Development] empulse92:
exactly the same chip! VYLOOM 0x19 :victory: (date differs , 06/2011 but i guess this wont make a big difference at least )

edit: bootin...:fingers-crossed:

edit 2: succesfully booted,
[Galaxy S II Android Development] Lanchon:
cool!! thanks!!! :)

and? did you use lagfix?

did u trim /sdcard?
[Galaxy S II Android Development] empulse92:
i did :) dont know if there are errors if trim isnt supported or not but for now... see yourself :P

note : play store says lagfix app is incompatible with this device i got the app from xda

View attachment 2891398
[Galaxy S II Android Development] Lanchon:
thanks! yes i'll update the app link then. those trims were successful, and yes it shows errors when you try to trim and the kernel doesn't support it.

i guess now you should use that phone and see if it bricks... :) for now its looking like the chances of bricking are going way down.

could you do two more tests?

try to trim /sdcard (steps in my first post)

then enable ART (debugging menu) and and see if it boot loops or not.

thanks!
[Galaxy S II Android Development] empulse92:
no error when trimming sdcard... should i wait some more before trying art?
[Galaxy S II Android Development] Lanchon:
great! did the trim sdcard command took some time, like a second or two? or did it end absolutely immediately, like a no operation would?

no, everything checked ok, you can try ART. i think it should work. if it doesnt, wipe data from recovery (i think you are using an empty phone anyway, right?)
[Galaxy S II Android Development] empulse92:
there was no delay after using the command.. just as you said, as if nothing happened. this is why i was wondering^^ but still not sure about this

yep the phone is empty, but i cant get into recovery or download mode .. :eek: time to set up adb

edit: device offline-.-'

edit 2: i am retarded and forgot to press the home button :')

edit 3: alrighty, now it boots but after wiping its still dalvik cache vm
[Galaxy S II Android Development] Lanchon:
hmmm... i've read somewhere the android shell sends stderr to limbo. i just tried to fstrim /sys on my nexus and not a word, exits immediately. on my linux PC it says "fstrim: /sys: FITRIM ioctl failed: Inappropriate ioctl for device".

i'll look into this further. meanwhile, are u testing ART?

EDIT: i dont know why no error is printed. but on android, if you fstrim with -v option you get text if successful:

root@hammerhead:/ # fstrim -v /system

/system: 0 bytes trimmed

root@hammerhead:/ # fstrim -v /data

/data: 2399477760 bytes trimmed

root@hammerhead:/ # fstrim -v /sys

1|root@hammerhead:/ #

so if you do fstrim -v /sdcard and you get no output, then the kernel is unable to trim FAT32. if this is the case, it would pay to find a alternate solution to this in the long run.
[Galaxy S II Android Development] empulse92:
enabling art forces bootloop, formatting data reverts back to dalvik :silly:

no chance to use art for now^^

edit: here's a logcat but i'm not sure if it shows a normal boot or the art bootloop

https://drive.google.com/file/d/0Bw86veXkn-fiZ2FnU3lqdkFuWVE/edit?usp=sharing

edit 2: another screenshot (dont be confused i didnt change the time zone yet)

View attachment 2891493
[Galaxy S II Android Development] Lanchon:
thanks!

assuming official M9 has working ART, there must be some trouble with my build setup. my OpenPDroid build has the same thing, it is not related to TRIM. oh well...

your screenshot clearly shows there is no TRIM support for FAT32 :(

i will think of what to do next. in any case, if you turn off ART and flash this on your working phone (with 20%+ free space in your internal partition) you should notice a big improvement in responsiveness and diminished lags. (a friend told me "feels like a different phone", but maybe he is exaggerating.) i still warn against doing it! i would exercise the internal storage on this phone for a while, installing big apps then deleting them, flashing the rom a couple more times, and using LagFix to trim all partitions.

or you can make a backup of your current phone and restore it here, then lagfix, and see if the increased speed justifies the risk. its your call... :)

for now i have nothing else to ask you to test. thank you very much!!! you've been amazing help!!!
[Galaxy S II Android Development] empulse92:
using this on my daily phone now :good:
[Galaxy S II Android Development] Lanchon:
oops! are you sure??? i hope nothing bad happens...

after LagFix trimming and rebooting, how do you feel the phone in the way of responsiveness?
[Galaxy S II Android Development] Giobio:
Excuse me you're right. I'm following this thread too because I'll try that kernel on my S2 but I have before to solve my problem. Maybe I could find here someone to help me....

Anyway I'll continue to follow you...
[Galaxy S II Android Development] empulse92:
you mean music stored on ExtSD not showing up?
[Galaxy S II Android Development] Lanchon:
no, audio playback after minutes or hours stops and you have to reboot your phone to have audio again. look it up in the official CM thread.
[Galaxy S II Android Development] empulse92:
never noticed this bug sry :p
[Galaxy S II Android Development] mparus:
I must to test this

---------- Post added at 09:22 PM ---------- Previous post was at 09:22 PM ----------

Ok ;)
[Galaxy S II Android Development] empulse92:
uid=0(root) gid=0(root) context=u:r:init:s0

getting this when typing id -u media_rw and id -g media_rw
[Galaxy S II Android Development] Lanchon:
try this:

su media_rw
id

in my device uid and gid are both 1023 for media_rw
[Galaxy S II Android Development] empulse92:
same output
[Galaxy S II Android Development] nerubian:
I installed 8/27 build on Slimsaber 4.4, lagfix works but still no wifi. I cant turn wifi on.
[Galaxy S II Android Development] Lanchon:
hey thanks for the write up, i'm sure it'll help many! glad to know the kernel helped! and absolutely off the record... no, it wont brick your phone! lol

there is an app called DiskInfo that lets you view details of your partitions. android is now bigger and ART uses more cache. (my 32gb nexus 5 came with 1GB system and 688mb cache; maybe you should look into how a 16gb nexus 5, moto X or G comes from factory.) it may make sense to repartition bigger system and cache partitions in addition to data. of course you can nandroid and restore from where you are now.

some people have good results reformatting the internal sdcard to ext4 (and some format the external too). besides being a infinitely better FS, its also trimmable. but i can only recommend this if you use linux in your PCs, like i do.
[Galaxy S II Android Development] Lanchon:
id like to link your post from the OP.

could you maybe clarify two points?

one is to recommend people do an EFS partition backup OUTSIDE the phone before running odin. if anything goes seriously wrong, without the efs backup the phone is toast.

the other: the odin flash you make only contains the kernel and recovery of CM. did you boot into recovery and flashes CM from the external sdcard?
[Galaxy S II Android Development] Lanchon:
this is for CM11 users
[Galaxy S II Android Development] Lanchon:
same as?
[Galaxy S II Android Development] empulse92:
same as "uid=0(root) gid=0(root) context=u:r:init:s0"
[Galaxy S II Android Development] Roxxors:
Unfortunately I've got no clue how to make a PIT file with bigger cache and system partitions, so I'll have to stick with what others have posted, but I might try to find out how it all works when I've got some free time again.

---------- Post added at 06:32 PM ---------- Previous post was at 06:28 PM ----------

You are right about the EFS back-up, I forgot about that.

Now that you mention it I might have re-installed CM11 after flashing with Odin, which probably makes the first flash redundant. I just tried flashing CM11 first (before ODIN flash) in case the smaller preload partition would break my stock-derived ROM somehow, but it probably isn't necessary and you can re-partition first and then flash CM11 for the first time. I'll edit the post with new steps.
[Galaxy S II Android Development] empulse92:
hm,

/mnt # chown -R root /mnt

is giving me no output

/mnt # chmod -R 777 /mnt

nothing as well

have i done it wrong? :eek:
[Galaxy S II Android Development] Lanchon:
take a look at this:

http://xdaforums.com/showthread.php?p=55162307
[Galaxy S II Android Development] Lanchon:
yes, you are.

i assume you are on the PC. i doubt that mnt is the mount point of the internal sdcard. the mountpoint is the sdcards root dir when mounted.

you need to chown to the right user AND group, not root. something like:

chown -R 1023:1023 /the/mountpoint

the chmod, you probably have to do 700, but im not sure. using 777 might bypass the fuse filter.

put a fat external sdcard and with CM file manager, check the permissions and user/group of any file inside it.
[Galaxy S II Android Development] Roxxors:
Yeah I saw my cache partition was only 100mb and barely being used (like 10MB) and figured it must not be very important. I just flashed the 1GB system partition PIT that I found in the thread because the smaller 500mb partition was way too small. Now I'm set for life (well if I cared enough I could edit the PIT file to make the preload partition smaller on that file but I'm too lazy, I already know how to make PIT files though so if anyone needs anything just ask)!
[Galaxy S II Android Development] empulse92:
when i try

without recursive no output at all

i start to feel really dumb
[Galaxy S II Android Development] mparus:
Are you sure that you have mounted the partition internal and external menory?

Chown and chmod command you should run after mount.

Please show output mount command from android.
[Galaxy S II Android Development] empulse92:
root@GT-I9100:/ # mount

rootfs / rootfs ro,relatime 0 0

tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0

devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0

proc /proc proc rw,relatime 0 0

sysfs /sys sysfs rw,seclabel,relatime 0 0

selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0

none /acct cgroup rw,relatime,cpuacct 0 0

none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0

tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0

tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0

tmpfs /mnt/fuse tmpfs rw,seclabel,relatime,mode=775,gid=1000 0 0

none /dev/cpuctl cgroup rw,relatime,cpu 0 0

/dev/block/mmcblk0p9 /system ext4 ro,seclabel,noatime,user_xattr,barrier=1,data=ordered 0 0

/dev/block/mmcblk0p7 /cache ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=ordered 0 0

/dev/block/mmcblk0p1 /efs ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=writeback 0 0

/dev/block/mmcblk0p10 /data ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=writeback,noauto_da_alloc,discard 0 0

/dev/block/mmcblk0p12 /preload ext4 rw,seclabel,nosuid,nodev,noatime,user_xattr,barrier=1,journal_async_commit,data=writeback 0 0

/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0

/dev/block/vold/179:9 /mnt/media_rw/sdcard1 fuseblk rw,dirsync,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0

/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

/dev/block/vold/259:3 /mnt/media_rw/sdcard0 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0

/dev/block/vold/259:3 /mnt/secure/asec ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0

/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

root@GT-I9100:/ #

does it differ if used from android directly as from pc?
[Galaxy S II Android Development] mparus:
Looks ok

Please show ls -la /mnt/media_rw output

From android
[Galaxy S II Android Development] empulse92:
terminal :

root@GT-I9100:/ # ls -la /mnt/media_rw

drwxr-xr-x root root 2014-08-31 09:32 sdcard0

drwxrwx--- media_rw media_rw 1970-01-01 01:00 sdcard1

drwx------ media_rw media_rw 2014-08-31 19:08 usbdisk0

root@GT-I9100:/ #

130|root@GT-I9100:/ #

this one from android:

su

u0_a54@GT-I9100:/ $ su

root@GT-I9100:/ # ls -la /mnt/media_rw

drwxr-xr-x root root 2014-08-31 09:32 sdcard0

drwxrwx--- media_rw media_rw 1970-01-01 01:00 sdcard1

drwx------ media_rw media_rw 2014-08-31 19:08 usbdisk0

root@GT-I9100:/ #
[Galaxy S II Android Development] mparus:
From android run

chown media_rw:media_rw /mnt/media_rw/sdcard0

And after again

ls -la /mnt/media_rw

Show output
[Galaxy S II Android Development] empulse92:
root@GT-I9100:/ # chown media_rw /mnt/media_rw/sdcard0

root@GT-I9100:/ # ls -la /mnt/media_rw

drwxr-xr-x media_rw root 2014-08-31 09:32 sdcard0

drwxrwx--- media_rw media_rw 1970-01-01 01:00 sdcard1

drwx------ media_rw media_rw 2014-08-31 19:08 usbdisk0

root@GT-I9100:/ #

oh i forgot the second user
[Galaxy S II Android Development] Lanchon:
but i told u to do that from a linux PC! from the phone it wont work because the file system is not mounted!! plus you need to read the help of your chown/chmod commands and make them work, issue them as superuser with sudo, etc.

wont give u step by step instructions: i dont have a phone and i dont even which of the hundreds of linux you are using! i told u what to do (and it's just a hunch btw), now you have to figure out how to do it yourself. if you dont want to, you cab simply go back to fat32, it wont cause any problems.
[Galaxy S II Android Development] mparus:
Try use camera app
[Galaxy S II Android Development] empulse92:
su

u0_a54@GT-I9100:/ $ su

root@GT-I9100:/ # ls -la /mnt/media_rw

drwxr-xr-x root root 2014-08-31 09:32 sdcard0

drwxrwx--- media_rw media_rw 1970-01-01 01:00 sdcard1

drwx------ media_rw media_rw 2014-08-31 19:08 usbdisk0

root@GT-I9100:/ # chown media_rw /mnt/media_rw/sdcard0

root@GT-I9100:/ # ls -la /mnt/media_rw

drwxr-xr-x media_rw root 2014-08-31 09:32 sdcard0

drwxrwx--- media_rw media_rw 1970-01-01 01:00 sdcard1

drwx------ media_rw media_rw 2014-08-31 19:08 usbdisk0

root@GT-I9100:/ # chown media_rw:media_rw /mnt/media_rw/sdcard0

root@GT-I9100:/ # ls -la /mnt/media_rw

drwxr-xr-x media_rw media_rw 2014-08-31 22:58 sdcard0

drwxrwx--- media_rw media_rw 1970-01-01 01:00 sdcard1

drwx------ media_rw media_rw 2014-08-31 19:08 usbdisk0

root@GT-I9100:/ #

---------- Post added at 09:03 PM ---------- Previous post was at 09:01 PM ----------

it works <3 i guess its fixed now, ty very much for your patience and ofc for your great help :victory:
[Galaxy S II Android Development] mparus:
Looks ok

Try shoot any photo from you phone camera.

Also you can change permissions sdcard1

chmod 755 /mnt/media_rw/sdcard1
[Galaxy S II Android Development] empulse92:
formatting external sd now.. :)

yes taking pics works :highfive:
[Galaxy S II Android Development] mparus:
3. very smooth and fast :) thanks Lanchon
[Galaxy S II Android Development] Lanchon:
755 will possibly disable android security for the files. 770 would make more sense. and it would need to be applied to all files, not just the root dir of the sd.
[Galaxy S II Android Development] mparus:
After format my memory is without any files.

If everyting is ok with 755 permissions ;)
[Galaxy S II Android Development] Lanchon:
apps may be able to read files in it even without the correct android permission. something might break if, belonging to the media_rw group, it wants to write to the card bypassing fuse.
[Galaxy S II Android Development] empulse92:
alright :) /system /date /cache /sdcard 0 and 1 are trimmed :)

going to try f2fs in the next time :good:

again thanks to everybody who helped me :victory:
[Galaxy S II Android Development] Lanchon:
could someone please test this i9100 kernel and see if the phone boots?

if it doesnt, you'd need to flash my previous kernel via Odin (Odin tar included below).

this kernel includes samsung's wear leveling bugfix.

its all here... thank you!!!
[Galaxy S II Android Development] empulse92:
Works fine here
[Galaxy S II Android Development] Lanchon:
thank you!!! :)
[Galaxy S II Android Development] empulse92:
hm wifi stopped working after reboot
[Galaxy S II Android Development] Lanchon:
yes never mind about that, go back to my standard patched M9 kernel. i just needed to know if the phone booted or not at this time. you are not affected by the WL bug, so no reason to keep this test version. thanks!!
[Galaxy S II Android Development] Giobio:
Even using GParted live CD on Windows8? If yes,

OOOOOOhhhhhhhhhhhhhhhh finally I understood why my never betrayed S2 wasn' t able to change the fw in ext4....
[Galaxy S II Android Development] Lanchon:
if you are using any linux, live or not, you are not using windows. (unless you are running linux in a virtual machine of course!)
[Galaxy S II Android Development] mparus:
Maybe try

http://www.paragon-drivers.com/extfs-windows/ or http://www.ext2fsd.com
[Galaxy S II Android Development] empulse92:
guys, this post is "old" :p

it mounts the card in mtp mode so everything is working :)
[Galaxy S II Android Development] mparus:
Yes, but with usb mass storage mount maybe working ok.
[Galaxy S II Android Development] Lanchon:
if you use windows. use fat. theres no reason for any of this pain. the phone works fine with fat.
[Galaxy S II Android Development] mparus:
You can use Windows and ext4 partition on random devices. My wdlive mount ext4 devices, my Linux laptop and my workstation with Windows. Why I can must use vfat32/ntfts, not ext4?
[Galaxy S II Android Development] Lanchon:
you can. theres just no reason for the headache.
[Galaxy S II Android Development] mparus:
12GB mkv files ;)
[Galaxy S II Android Development] empulse92:
for me ext4 is working in mtp mode

mass storage mode is triggering "the device needs to be formatted" windows unter windows

in linux both does work :good: (using linuxmint btw as you suggested ;) )
[Galaxy S II Android Development] empulse92:
this kernel is made for cm11, slim has its own base AFAIk so no, but you can try and tell us
[Galaxy S II Android Development] nerubian:
Ext2Fsd app supports mounting, reading and writing ext4 on windows, using it for a long time for my linux partitions.
[Galaxy S II Android Development] Giobio:
So, who is right?

I've follow a guide in another xda forum's thread and did not able to finish the procedure. I formatted in ext4 with gparted 2013 but then to fix the job at terminal (with a procedure i think not correct) i wasn' t able to finish it.

So before using your guide Lanchon(I want to do that), I'd like to ask you or mparus if is true the possibility to formatted in ext4 and over all if you know the right procedure (here too, I saw lots of them but I don't know if there are one correct).
[Galaxy S II Android Development] Lanchon:
hi! could you please handle the partitioning in a partitioning thread?? those in this thread are here because we are interested in discussing something else. if not, we would be in a partitioning thread :) thank you!!!
[Galaxy S II Android Development] mparus:
after 72h in my logcat trim not showing :(

---------- Post added at 08:33 AM ---------- Previous post was at 08:27 AM ----------

for internal and external memory

work for me - http://xdaforums.com/showpost.php?p=55120256&postcount=143

EOT in this thread
[Galaxy S II Android Development] Lanchon:
lol

time to reboot?
[Galaxy S II Android Development] mparus:
I performed reboot many times.

At night, phone is connected to the charger.

vold in CM11 M9 is patched for trim?

https://android.googlesource.com/platform/system/vold/+/b87937cdea689594a293979b30b13054e7455dee

May partitions require special mount options? Probably not, quote from:

http://www.anandtech.com/comments/7185/android-43-update-brings-trim-to-all-nexus-devices

"If you look at a pre-4.3 nexus device (perhaps 4.1.2 through 4.2.2), you'll notice that the writeable filesystems (i.e. /data and /cache) are mounted with the "discard" option. This means that the storage is trimmed after EVERY file delete operation. This prevents performance degradation over the long term, but the trade-off is that trimming on-the-fly can effect responsiveness.

4.3 no longer mounts filesystems with "discard" and instead runs TRIM on a schedule when the device is not being used. This has the benefit of preventing performance degradation over the long term, as well as not impacting responsiveness when the device is in use."
[Galaxy S II Android Development] Giobio:
Very very thanks for your help.

I do not use linux and I don't know if yours, is appliable with GParted live CD(I only get that). And more I'm a linux noob so isn't all clear for me. But thanks again.

---------- Post added at 09:11 AM ---------- Previous post was at 08:58 AM ----------

The internal sdcard partition

the majority of the phone's flash is devoted to the internal sdcard partition which is most probably FAT32. unfortunately the linux kernel file system driver for FAT32 is unable to trim.

Whit that, do u mean is strictly necesery to get an ext4 filesystem formatted internal sdcard?
[Galaxy S II Android Development] Lanchon:
no, only that partition wont be trimmed. others will. please read the thread to decide if that's important to you or not.
[Galaxy S II Android Development] Lanchon:
CM11 is kitkat and anything 4.3+ should auto-trim.

FYI, this will manually invoke auto trimming:

adb shell

su

vdc fstrim dotrim

logcat
[Galaxy S II Android Development] mparus:
ok, I must manually run this command :(

logcat

I/fstrim ( 1852): Starting fstrim work...

I/fstrim_start( 1852): 526303

I/fstrim ( 1852): Invoking FITRIM ioctl on /cache

I/fstrim ( 1852): Trimmed 98529280 bytes on /cache

I/fstrim ( 1852): Invoking FITRIM ioctl on /efs

I/fstrim ( 1852): Trimmed 5591040 bytes on /efs

I/fstrim ( 1852): Invoking FITRIM ioctl on /data

I/fstrim ( 1852): Trimmed 1853939712 bytes on /data

I/fstrim ( 1852): Invoking FITRIM ioctl on /preload

I/fstrim ( 1852): Trimmed 166346752 bytes on /preload

I/fstrim ( 1852): Finished fstrim work.

I/fstrim_finish( 1852): 563439

sdcard not autotrim, why?

fstrim -v /mnt/media_rw/sdcard0 working

mount option for data

/dev/block/mmcblk0p10 /data ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=ordered,noauto_da_alloc,discard 0 0

and sdcard*

/dev/block/vold/259:3 /mnt/media_rw/sdcard0 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0

/dev/block/vold/179:9 /mnt/media_rw/sdcard1 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0

from cat /fstab.smdk4210

/dev/block/mmcblk0p10 /data ext4 noatime,nosuid,nodev,discard,noauto_da_alloc,journal_async_commit,errors=panic wait,check_spo,encryptable=/efs/metadata

/devices/platform/dw_mmc/mmc_host/mmc0/mmc0 auto auto defaults voldmanaged=sdcard0:11,nonremovable,noemulatedsd

/devices/platform/s3c-sdhci.2/mmc_host/mmc1 auto auto defaults voldmanaged=sdcard1:auto