Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPIT on i9100 with non-standard CACHE partition #11

Closed
svbarbosa opened this issue Feb 29, 2016 · 24 comments
Closed

REPIT on i9100 with non-standard CACHE partition #11

svbarbosa opened this issue Feb 29, 2016 · 24 comments
Labels

Comments

@svbarbosa
Copy link

svbarbosa commented Feb 29, 2016

Hi Lanchon!

This is a follow up on the issue you were helping me on XDA.

I finally got my hands on my son´s i9100 and ran repit with the "heapStart=532480" mod.

Flashed custom-repit-20160225-system=1-data=4-sdcard=max-preload=min+wipe-i9100.

The script ended with error, complaining "Partition /dev/block/mmcblk0p9 is being used", but was able to resize the data partition, keeping all existing files.

The system (FACTORYFS) partition remained the same size (832MB) but free space was left in the partition table (192MB). I guess this is 1GB that I requested in repit filename (832+192=1024).

Here is a parted print:

Number Start End Size File system Name Flags
7 106496s 499711s 393216s ext4 CACHE
8 499712s 532479s 32768s MODEM
9 532480s 2236415s 1703936s ext4 FACTORYFS
2236416s 2629631s 393216s Free Space

10 2629632s 11018239s 8388608s ext4 DATAFS
11 11018240s 30752767s 19734528s fat32 UMS msftres
12 30752768s 30769151s 16384s ext4 HIDDEN
30769152s 30777310s 8159s Free Space

I tried to use parted to manually include the free space in system partition but it kept complaining "Error: Partition /dev/block/mmcblk0p9 is being used.".

I checked with "mount" in adb and with twrp mount menu option. In both system was not mounted. Tried to reboot twrp and restard adb but no success.

This is not a big issue. I can live with the phone the way it is. My main goal, to increase data to 4GB was acomplished, thanks to you.

Anyway I am enclosing the repit recovery log and a full parted print.

parted-print-2016-0228.txt

recovery-repit-error-2016-0228.txt

@Lanchon
Copy link
Owner

Lanchon commented Feb 29, 2016

thanks for following up.

your problem is strange. only one other person reported it, take a look at #3.

can you describe your setup? kernel, recovery, cat /proc/mounts, encryption, etc? thanks!

@svbarbosa
Copy link
Author

My setup:

ROM: Ressurrection Remix LP 5.5.9 (latest build 2015-1120 Android 5.1.1_r26 LMY48Y)

Kernel: kernel-Lanchon-TRIM-IsoRec-20160206-cm-12.1-i9100

Recovery: recovery-Lanchon-IsoRec-TWRP-2.8.7.0-20160113-i9100-(by-arnab)

No encription.

Mounts:

rootfs on / type rootfs (rw)

tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)

devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)

proc on /proc type proc (rw,relatime)

sysfs on /sys type sysfs (rw,seclabel,relatime)

selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)

tmpfs on /tmp type tmpfs (rw,seclabel,relatime)

/dev/block/mmcblk0p7 on /cache type ext4 (rw,seclabel,relatime,user_xattr,barrier=1,data=ordered)

/dev/block/mmcblk0p11 on /emmc type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

/dev/block/mmcblk0p11 on /and-sec type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

/dev/block/mmcblk1p1 on /sdcard type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

@Lanchon
Copy link
Owner

Lanchon commented Feb 29, 2016

thanks!

the only difference with my setup is that i dont have an external sdcard. i really don't know what's happening there and i can't reproduce.

@svbarbosa
Copy link
Author

My OCD will not allow me to give up. :)

My current partition table is:

Number Start End Size File system Name Flags
................
9 532480s 2236415s 1703936s ext4 FACTORYFS
2236416s 2629631s 393216s Free Space
10 2629632s 11018239s 8388608s ext4 DATAFS
................

To add the free space to /system with parted I could use:

adb shell
parted /dev/block/mmcblk0
unit s
rm 9
mkpart primary ext4 532480s 2629631s
name 9 FACTORYFS

Since it will not work with my current TWRP due to the mysterious "/system in use" error, my plan is to try other recoveries. Maybe start with ISOREC CWM.

Do you agree with this approach?

TIA

@Lanchon
Copy link
Owner

Lanchon commented Mar 1, 2016

absolutely! only i think cwm might not have parted.

watch out: twrp uses dynamic linking so if you want to export parted you need all the libraries too. and the library path defined (look at the environment vars that are predefined in the twrp shell).

alternatives for you r googling why this happens or bringing Dees_Troy into this discussion.

@Lanchon
Copy link
Owner

Lanchon commented Mar 1, 2016

btw, after the operation, run my script to actually resize the file system.

@svbarbosa
Copy link
Author

Another idea is to rerun repit omitting system so it will default to same+keep+ext4.

This way /system would not be touched and the free space would go to /sdcard.

I am happy with my /system size. This looks like an easy fix.

@Lanchon
Copy link
Owner

Lanchon commented Mar 1, 2016

no! this will move all of data for what? 100mb?

plus its ugly. leave it the way it is, and sooner or later we'll fix the problem. who cares if the partition is not the full 1gb now? right now you dont need more so you can wait.

@svbarbosa
Copy link
Author

Agreed. Maybe TWRP 3.0.x will make the phantom /system mount go away.

In the meantime I will take some pills to keep my OCD under control.

@Lanchon
Copy link
Owner

Lanchon commented Mar 1, 2016

freeee space.. wasted... freeeeeeee spaaaaaace......

@Lanchon
Copy link
Owner

Lanchon commented Mar 2, 2016

hi @Dees-Troy,

i made a frontend to various tools to repartition phones without loosing data. it runs under TWRP. to get a feel for what it does, you can take a look at the log attached earlier in this issue (linked here for your convenience.)

there is very a strange occurrence. it works for 99% of the people, but on 2 reported cases it fails as follows:

  • the script unmounts all partitions backed by the emmc. (this is a requirement to be able to reread the partition table of the emmc: the emmc must be not be locked, so no partition should be locked either.)
  • then the script rereads the partition table. (i use blockdev –rereadpt given that partprobe doesn't work on our TWRP build.) the emmc is unlocked and so the reread succeeds.
  • later a partition delete of /system via parted rm is attempted. in 99% of cases it succeeds, but on 2 phones it fails every time. parted says that the system partition is locked.

/proc/mounts shows nothing from the emmc is mounted. for all i know, encryption doesn't touch system, and the phone owners say their devices are not encrypted. i don't know what could be locking /system, how to find out what is holding the lock, nor how to release it. reboots don't help. and the kernel/recovery combo used by one owner is the same that i have here in my setup, and i can't reproduce.

this is the report from one owner. (the other report is linked from this one.)
do you have any insight that might help?

thanks so much!

PS.
i don't know if you are aware of IsoRec for the galaxy S2.
stand-alone recoveries are now possible; the TWRP page here is no longer up to date.

@Lanchon
Copy link
Owner

Lanchon commented Mar 13, 2016

hi! somebody reported that having the external sdcard mounted made the kernel unable to unmount /system somehow.

could you please try:

  • rebooting to twrp 2.8.7.0, then not mounting anything via USB to the PC.
  • run script once (will copy itself to /tmp).
  • manually unmount everything using twrp's menu, including external SD card. (you could also boot twrp without the card in place.)
  • run script again from /tmp.

thanks!

@HenkDePoema
Copy link

@Lanchon,

Nice, that did the job for me. Great way to repit!

@Lanchon
Copy link
Owner

Lanchon commented Mar 14, 2016

can i ask what was it that you did differently? what made it work?

@HenkDePoema
Copy link

After getting the above mentioned "Error: Partition /dev/block/mmcblk0p9 is being used.", I tried unmounting everything, including the external sdcard and ran the script from /tmp. That worked!

To be completely accurate: I flashed lanchon-repit-20160225-system=1.0-data=6+wipe-sdcard=max-preload=min+wipe-i9100.zip

I thought my phone had all standard partitions (came from CM 12.1 20160212 nightly, never changed partition size before), but still ran into this error.

@Lanchon
Copy link
Owner

Lanchon commented Mar 14, 2016

but had you run the script from /tmp before without unmounting the external sd?

@HenkDePoema
Copy link

No, didn't try that before.

@Lanchon
Copy link
Owner

Lanchon commented Mar 14, 2016

thanks

@davidcie
Copy link

Came across the same problem. Only running from /tmp did not help, but running from /tmp and unmounting the external SD card did. Happy camper!

@Lanchon
Copy link
Owner

Lanchon commented Mar 17, 2016

thanks for the report! the script now unmounts the sdcard by itself: fa82f45
hopefully this will fix this issue, closing, thanks!

@Jero098
Copy link

Jero098 commented Apr 14, 2016

####################################
Lanchon REPIT
A Data-Sparing Repartitioning Tool
Version: 2016-04-06
Device: i9100
Copyright 2016, Lanchon (GPLv3)
####################################

===== PRELIMINARY CHECKS =====
info: valid package names: [-(system|data|sdcard|preload)=]...
info: valid partition values: [|same|min|max][+[keep|wipe][+[ext4|vfat|raw]]]

----- DEFAULTS -----
system = size:same + content:keep + fs:ext4
data = size:same + content:keep + fs:ext4
sdcard = size:same + content:keep + fs:vfat
preload = size:same + content:keep + fs:ext4

info: parsing package name

----- CONFIGURATION -----
system = size:1 + content:keep + fs:ext4
data = size:6 + content:keep + fs:ext4
sdcard = size:max + content:keep + fs:vfat
preload = size:min + content:wipe + fs:ext4

info: disabling swap
BusyBox v1.22.1 bionic (2015-07-30 11:11 +0530) multi-call binary.

Usage: dirname FILENAME

Strip non-directory suffix from FILENAME

info: copying package to '/tmp'
info: unmounting all partitions
umount: can't umount /sdcard: Device or resource busy

FATAL: unable to unmount all partitions (this package copied itself to '/tmp'; please run it again from there)

[ERROR 1]

How to fix these?newbie here

@Lanchon
Copy link
Owner

Lanchon commented Apr 14, 2016

please do not spam github issues that have nothing to do with your problem.
please do not create an issue unless you have read the docs, which obviously you haven't.
you haven't even read the error message, ffs! geezuz!!!

@Lanchon
Copy link
Owner

Lanchon commented Apr 14, 2016

btw, welcome to github. there is a new REPIT XDA thread in which you can post if you absolutely don't want to read; somebody might help there. i trust you can find the link by yourself.

@Jero098
Copy link

Jero098 commented Apr 16, 2016

Dont worry Lanchon... i"ve got already how to repit
tnx to your guide...

sorry for disturbing...i just dont get it at 1st, until i read it many times
now its successful because of that..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants