yashsingh1/xdaforums huggingface dataset:
[T-Mobile Samsung Galaxy S II SGH-T989] raptor170:
Worked like a dream for me, Odin 1.85 and chet keners modified twrp with f2fs support. Loving 8gb for apps!!@
[T-Mobile Samsung Galaxy S II SGH-T989] Lorien_Silmaril:
Sounds like it was probably a bad USB cable; might have messed the partitions up that first time. :)

Regarding the "Preload" partition mounting issue, one thing you could try is changing the file system to a different one (F2FS, or a different EXT format if your recovery doesn't support F2FS), then change it back to EXT4. This should force a reformat if it didn't work before for whatever reason. On the Google group someone mentioned he had a similar issue with Preload and had to do this extra step, see if it works for you.

And yes, you can flash the original .pit file to re-partition the phone back to factory memory structure. But if you can get the Preload partition working, you can use a stock ROM with the modified partitions, too.
[T-Mobile Samsung Galaxy S II SGH-T989] Lorien_Silmaril:
Unless you REALLY mess with the memory structure (i.e. changing the partition sizes for modem, etc., or deleting partitions), this shouldn't cause a brick. Over on the Google community, the vast majority of re-partitions were reported successful and went without issues. Heck, I even messed up the partitions once on my wife's phone (changed the partition sizes for /System and /Cache, then was unable to go into Recovery), but easily recovered by flashing back the .pit and recovery through ODIN.

Originally I was gonna go the virtual re-partition route as well, but that simply comes with too many limitations: As far as I know, only Sultan's CM build supports it, and that ROM has been discontinued.
[T-Mobile Samsung Galaxy S II SGH-T989] wvuravens-fan:
Working great for me. Thanks
[T-Mobile Samsung Galaxy S II SGH-T989] vakkah:
is it possible for the OP to create a PIT file that contain the following:

1GB /system + 8GB /data partition?

this will help with users flashing a lollipop rom with pa stock gApps package (no more gApps flashing failures due to insufficient /system memory).

let me know, i'm willing to test..
[T-Mobile Samsung Galaxy S II SGH-T989] raptor170:
And a side note on this, over on the g+ community, anyone that has had failures have been able to be resolved quickly and painlessly. Usually something very minor, example 3.09 Odin note working for one of the individuals but was successful with 3.07.
[T-Mobile Samsung Galaxy S II SGH-T989] OldeCrow:
Great minds and all... I am just now testing a 1.2gb system 8gb data Pit file, successuflly odined (3.07) reformatted partitions including data which should be fat by the way the others ext4...

flashed a 4.12 touchwiz rom successfully restoring from the market now...

see attached zip...
[T-Mobile Samsung Galaxy S II SGH-T989] ilovelamp33:
The new partitions are working great. I can confirm that heimdall works just fine for this. The only issue is that you can not flash the pit file by itself. I had to get a jelly bean image for odin. I unzipped it and flashed the cache.img.ext4 file to my phone. Thank you for your work. :good:
[T-Mobile Samsung Galaxy S II SGH-T989] bigmike6200:
I understand the steps involved in this process and would like to try it as I would like to try PAC-ROM with some room. Do you have to be on a stock ROM? I am on SlimKat 4.4.4. Also the "OC" you up loaded, what size is that?
[T-Mobile Samsung Galaxy S II SGH-T989] Lorien_Silmaril:
I originally did that - but decided against including it in the guide because of reasons stated in the post above.

Changing only the size of the /data partition does not affect the /recovery partition, but for some reason changing the size of the /system and /cache partitions affects it (I am guessing it has to do with how the internal memory is mapped - so the /recovery partition might be located after the /system partition, so increasing its size wipes out the /recovery). This means the user would need to flash recovery through ODIN and things can go wrong there as well.

In the end I just felt for most people's purposes it's much easier (and safer) not to mess with any partition other than /data. I do understand the issue with not being able to flash a larger GAPPS package (that was originally why I tried increasing the /system partition size), but since almost everything in the GAPPS package can be downloaded through the Play Store, it technically makes no differences (your phone still has 16GB of memory total; increasing the /system partition size simply means decreasing the /sdcard partition further; you could allocate that extra space to the /data partition instead).

I would actually argue that a larger /data is more useful than a larger /system, because /data is flexible. To my understanding, if you don't use up the space in /system, the spare room just sits there unused (and I am a neat freak when it comes to memory management, to the point that I loaded as many GAPPS during ROM installation as to leave less than 40MB on /system, lol)

This mod is not ROM-specific. You should be able to install any ROM with this re-partition method. If you keep the /preload partition, you can install stock ROMs. Get rid of it will gain you about 120MB of space (not much really) but most custom ROM's don't use it, to my knowledge.

I am running the Validus ROM (which isn't posted here on XDA, you can look over on the G+ community for more details: https://plus.google.com/communities/107891541077154929804 ); it's a Lollipop-based ROM and works great with the modified memory structure.
[T-Mobile Samsung Galaxy S II SGH-T989] OldeCrow:
1.2g system

8 g data
[T-Mobile Samsung Galaxy S II SGH-T989] Lorien_Silmaril:
Can you do a quick step-by-step guide for increasing the /system partition? :) I'll be happy to include that and your .pit in the OP (probably under a separate section for people who are interested)
[T-Mobile Samsung Galaxy S II SGH-T989] vakkah:
i understand, it's just that i also have the galaxy s2 gt-i9100 and i have managed to use a pit file with 1GB /system+6GB /data and currently running Lysergic Acid CM12 Rom..

I was planning to have a similar setup with regards to 1GB /system partition for my galaxy s2 hercules..

thanks for the explanation and reply..
[T-Mobile Samsung Galaxy S II SGH-T989] bigmike6200:
bugs

I got the partition to work, however, my camera/gallery doesn't work. I have TBO updater app and it will not allow me to download any apks. I am on Slim Kat 4.4.4. I also have none of the normal files that show on the internal storage drive. Just tried using ART runtime and got bootloop. Is there anyway for me to repatition back to original? I may have to flash ROM again to get back to Dalvik runtime. Any assistance would be greatly appreciated. Worst comes to worse, I will just have to buy another Hercules.

Phone is rebooting in ART. I will post resutls of what happens next. Thanks for the guide. Unable to use TWRP Manager. Unable to download from Google drive. Gonna wait until I get home and try the unmodified version and see if all comes back. Question....once I flash via ODIN, do I have to perform the wipe funtions?
[T-Mobile Samsung Galaxy S II SGH-T989] OldeCrow:
It is exactly the same procedure as the system partition, pitmagic displays the label for each partition so #23 is system I just doubled the size and saved the pit file again with the changes.

You will just have more partitions to reformat in recovery when you reboot...

I tried doubling the cache partition too and increasing system to 12g so sultans lollipop would install without any funnybusiness but when i tried it I couldn't reformat the partitions so I suspect that pit was bigger than the space on the phone... it makes sense though that a slightly bigger cache partition would be helpful so I might try the bigger cache and leave system at 8g.....

If anyone is wondering I had no trouble flashing 4.4.4. aosp/gapps on the 1.2gig data 8g system pit file although I was flashing one of the pa-modular ones. I was unable to get sultans lollipop to install on the 1.2g data 8g system pit but when I tried it I had the user space partitioned as ext4 instead of fat and the installation failed not sure if the two are related but I will try the lollipop install again just to be sure...

---------- Post added at 01:05 PM ---------- Previous post was at 12:53 PM ----------

With TWRP you have to reformat the partitions before repair or wipe will work, you will know when you have done it right because the wipe will work once all the partitions have been properly reformatted. TWRP also shows the partitions that are in error in RED so you can see which ones need reformatted. You may need to reformat the internal sd card (user space) too, it should be formatted in fat if you format it in ext4 it will have problems but the stock TW rom offered to format it for me when it booted the first time, it did give lots of errors trying to boot though.

Your titanium backup data and twrp backup data along with all your user data are on the internal sd card so you should back it up to your external sd or your PC before flashing any pit files, if you have to reformat everything it will be gone!
[T-Mobile Samsung Galaxy S II SGH-T989] bigmike6200:
Yep. Lost the entire internal SD. Thanks will give it a try. OK changed the internal to Fat and ALL is great. Camera, downloading, saving to internal. Once again thanks bro for all. [emoji481] [emoji481] [emoji481] [emoji481]
[T-Mobile Samsung Galaxy S II SGH-T989] OldeCrow:
I couldn't get the PA lollipop rom to install either with my 1.2g/8g pit so thats two lollipop roms that don't install... no errors they just say they have installed successfully in a fraction of the time and there is obviously not a rom installed when done... I am guessing it has something to do with the new installer the lollipop roms use...

I'm happy to just have the phone on TouchWiz with a little extra room can't beat TW for performance either so it's a win...

Update:

Just installed Validus on my 1.2g/8g pit file with success so it's not a lollipop issue probably just sketchy installer issues on the other two roms...
[T-Mobile Samsung Galaxy S II SGH-T989] bigmike6200:
So I tried to flash using TWRP Manager App. When the phone booted into recovery it did nothing. I hit the install and selected the file and when I scrolled up, I got this:

E: TWFunc: Copy_Log -- Can't open destination log file: "/cache/fecover/log"

: DataManager: Output_Version -- uncable to make "cache/recover"

Any ideas anyone. The app I flashed took and all others took. Just wondered about this because it was in RED.
[T-Mobile Samsung Galaxy S II SGH-T989] OldeCrow:
sounds like you missed reformatting the cache partition when you flashed the new pit, try formatting the cache partiton ext4 then retry and see how it goes...
[T-Mobile Samsung Galaxy S II SGH-T989] bigmike6200:
Mahlo Braddah. That did the trick. I downloaded inverted maps by [MENTION=561313]gunterm[/MENTION]ic and as soon as I tapped it, TWRP manager picked it up and was ready to flash it. Everything, including the music which was a bear to get working. The music app and Play Music kept FCing. Sometimes it would start playing and FC in the middle of the song and the song would sitll play. Now I just got to get my pictures from duplicating and blank one showing up. Using Slim Kat 4.4.4 9.0 official and WildKernel. This partiton is gonna be great for me to flash PACROM. Thanks for the help bro.
[T-Mobile Samsung Galaxy S II SGH-T989] OldeCrow:
He me iki ia. There is a little trial and error with this re-partitioning, I think it took a couple of reboots to get everything reformatted in twrp...:good:
[T-Mobile Samsung Galaxy S II SGH-T989] thedark1337:
im having major issues at the moment and need help. I odin'ed the original PIT back due to having issues and then reformatted all the partitions. /data and /cache showed 0MB unmountable, then I went ahead and tried to virtually repartition as per sultan's 5.0 ROM and now its stuck on the teamwin screen and i cant get into download mode via volume up + volume down, it just goes to the teamwin screen. It doesnt get past this screen, it just hangs on the loading screen for teamwin and i cant do anything. How do I fix this?
[T-Mobile Samsung Galaxy S II SGH-T989] bigmike6200:
Make sure the USB is plugged in to get to Download mode.
[T-Mobile Samsung Galaxy S II SGH-T989] thedark1337:
Thank you! it finally went into download mode after that. All the guides i saw were just holding volume up and down and turning it on. Now to fix my phone.
[T-Mobile Samsung Galaxy S II SGH-T989] vargasesteban:
Is there any way to fusion internal and se card like muy s3 ?
[T-Mobile Samsung Galaxy S II SGH-T989] vakkah:
thanks a million bro!!!

your pit file works great.. totally awesome!!!

i now i have good "old hercules" formatted with /system @1.2GB, /data@8GB, internal sdcard@4.7GB.

great!!!!

now i'm currently running "validus rom", a lollipop 5.0.2 based rom that i found on the Google+ community..

"nuff" respect and thanks again to all the xda folks!!!
[T-Mobile Samsung Galaxy S II SGH-T989] Aahz Pervect:
At the end of the day, our device basically requires this proper re-partitioning process in order to be viable going forward. (I wasn't even bumping up against the limit but it simply needed to happen)

Everything went totally smoothly for me with the only scary part being all of the errors in TWRP when you're re-formatting. :p
[T-Mobile Samsung Galaxy S II SGH-T989] xdause:
sdcard exfat note

I am using stable, unofficial CyanogenMod 11 ROM 4.4.4 and noticed the fstab lists internal sdcard as vfat. When you format ext4 you might experience write issues so you may need to format it to fat instead to use the 5gb space (modified pit). You may need to check the log for the particular rom you are using to be sure ext4 is working.
[T-Mobile Samsung Galaxy S II SGH-T989] RealPariah:
Sweet, thanks for guide. I just used provided PIT and it just works.

Now, can we add 1G to system partition to accommodate the gapps that are exploding in size? If we can do that you can then truly say you've breathed new life into this phone moving forward :) . As you've stated most have micro sdcards (I have 32G ) so leaving only 4G in internal storage would be plenty for emergency backup either nandroid (compressed) or ROM/gapps for system recovery should all else fail.

As it is you have to use 2nd smallest Pico flash pack or there's not enough room in /system (that is if using Android 5.1 which I just was able to flash thanks to you thank you thank you thank you). Which is fine for now, but if it gets any larger we may not be able to flash gapps soon, and that would kill it for most users. Just as much as too little space in /data would.
[T-Mobile Samsung Galaxy S II SGH-T989] vakkah:
please see post #19 in this thread and use the attached PIT file provided by OldeCrow..

you'll now have 1.2GB/system + 8GB/data + 4.7GB/sdcard0

no problems when you later flash lollipop 5.1 or pa_gApps_stock/full..

no more limitations for sure..
[T-Mobile Samsung Galaxy S II SGH-T989] RealPariah:
Thanks for info, would be awesome to see as a 2nd option for download in OP.

I can confirm if using Chet's TWRP and Validus I have f2fs for all partitions except /system must stay ext4 (OP for that ROM states this didn't push my luck personally). I haven't confirmed this using the pit file in post 19, but there's no reason a space allotment change should cause the preceding to change.

Just make sure the ROM you flash supports f2fs before using it if you don't use Validus or convert your partitions to accommodate that ROM. I have used all ext4 parts up until validus and f2fs.
[T-Mobile Samsung Galaxy S II SGH-T989] RealPariah:
Just replying to say another happy customer who successfully used the pit provided by Vakkah :)

Thanks again

P.S. I am running Validus [5.1] and have /cache /data /preload all formatted with F2FS and /system with EXT4 and everything is running very nicely. I still have the wait for mobile data/network connect unless I fully connect to a WiFi network issue, but I can live with that. Everything else is rock solid (including mobile network once connected (oh aside from DC network connection, but that's seemingly a lollipop issue and H+ is fast enough even when streaming media with my Plex Media Server which does a good amount of transfer (20mbps) at times)).

So awesome to have truly resized data and system I can use with any ROM as opposed to the virtual method which is only usable if ROM specifically is setup for it.
[T-Mobile Samsung Galaxy S II SGH-T989] aloknand:
should i have to wipe all the partitions before doing the re-partition?

i tried with the modified pit file given by Lorien_Silmaril and nothing happened. my device just rebooted into android after the ODIN said passed. there were no changes to the partition.

i'm on twrp 2.8.6.0. i have 2BG data and 11 GB sdcard0 with 580MB system..

---------- Post added at 09:00 AM ---------- Previous post was at 08:26 AM ----------

should i have to add the PDA stock recovery file along with the PIT file and then start the ODIN?
[T-Mobile Samsung Galaxy S II SGH-T989] ElectricBubble:
Bye bye Samsung Galaxy S II, this resulted in total brick for me on odin 3.07 using the u1_02_20110310_emmc_EXT4.pit on a strong cord i pre tested. and all the proper things checked. Probable shouldn't of risked what i couldn't afford to lose, it is what it is. I recommend only doing this if you can afford the loss. As it will brick your phone to reasons unknow.
[T-Mobile Samsung Galaxy S II SGH-T989] LimeliME:
If you can still boot into download mode, then it can still be saved.....

Since as mentioned in the 1st post, Re-Partition your phone's memory shouldn't totally brick your phone in anyway....

If you can boot into download mode, here is the original SGH-T989 .tar
[T-Mobile Samsung Galaxy S II SGH-T989] ElectricBubble:
As i said Total brick i am unable to get into download mode, i have been trying to think of anything that may have caused this so we have an idea, but i'm still unaware .
[T-Mobile Samsung Galaxy S II SGH-T989] scmfxt:
Not sure where you have gotten this u1_02_20110310_emmc_EXT4.pit file from but it's not the file posted in OP.. that could be your issue.. Installing other pit file of a different phone or wrongly modified pit file would have caused the brick.
[T-Mobile Samsung Galaxy S II SGH-T989] aloknand:
hey buddy hope this helps..

1. connect the usb cable to your phone.

2. hold down the volume down button.

3. connect the other end of usb to the computer while holding down the volume down button.

wait for some time and hope the phone enters the download mode..

As far as i know all bricked devices enter the download mode.
[T-Mobile Samsung Galaxy S II SGH-T989] Krebs830:
Following your instructions, I modified my .pit file to double the size of the /system and /data partitions (1.2 & 4 GB, with a resulting 8.7 GB internal SD) and flashed it along with the stock JB ROM, then TWRP. I ultimately installed [MENTION=4800121]Sultanxda[/MENTION]'s version of CM11 and the phone is working fine, and a lot snappier now. Thank you!
[T-Mobile Samsung Galaxy S II SGH-T989] franzpimp87:
So, the partition formats must be:

Data - FAT

System - EXT4

Cache - EXT4

Internal SDCard - FAT

Preload - EXT4

Is it correct? Or which are the optimal formats?
[T-Mobile Samsung Galaxy S II SGH-T989] chris4824:
Data - EXT4

System - EXT4

Cache - EXT4

Internal SDCard - FAT

External SD - FAT

Unless the rom supports f2fs and you want to try f2fs..
[T-Mobile Samsung Galaxy S II SGH-T989] franzpimp87:
Just after I posted the question, I formated all with EXT4 and then flashed Validus LP, it seems to work normally, but, my question is: why is it recommended to use FAT for Internal and External SD?
[T-Mobile Samsung Galaxy S II SGH-T989] franzpimp87:
I'm having this red message when I wipe Internal SD, it didn't happen when the partition format was EXT4, but that issue happens only when I formated it with FAT.
[T-Mobile Samsung Galaxy S II SGH-T989] celldweller97:
dint change the sd card to fat and works fine :good:
[T-Mobile Samsung Galaxy S II SGH-T989] raptorddd:
Is there any difference in size from sultans virtual partition?

I dont think i need that much system..
[T-Mobile Samsung Galaxy S II SGH-T989] franzpimp87:
Why did you use fat for Data?
[T-Mobile Samsung Galaxy S II SGH-T989] celldweller97:
If you use ext4 you'll get alot of write errors.
[T-Mobile Samsung Galaxy S II SGH-T989] navid.ans1988:
I want to change 35mb of useless cache size to data, how do i do without affecting system size.
[T-Mobile Samsung Galaxy S II SGH-T989] franzpimp87:
I did use fat for Data, clean flashed validus lp and gapps, but when ROM boots, it said something about encryption failed and didn't let me continue; it prompted for a factory reset but after phone rebooted it went to recovery but got stucked at teamwin screen with some glitches; even when I pulled out battery in order to power on the phone again and tried to enter recovery, it did the same until I odined TWRP again and formated data to EXT4, then flashed validus and gapps again.
[T-Mobile Samsung Galaxy S II SGH-T989] Steveromingagain:
New thread

Are you able to start a new thread for i727 users in there development section. I've been using it now for a week on my i727 and wife's t989. Very good file and a lot of people asking about it. I post about it to whoever ask but would be easier with a new thread.

Thanks for your work.

---------- Post added at 12:57 AM ---------- Previous post was at 12:54 AM ----------

[MENTION=4824919]Lorien_Silmaril[/MENTION]
[T-Mobile Samsung Galaxy S II SGH-T989] measle:
Do these pit files work for the i727?
[T-Mobile Samsung Galaxy S II SGH-T989] Steveromingagain:
Yes,perfectly on both i727 and t989. I used premade file at beginning of post.
[T-Mobile Samsung Galaxy S II SGH-T989] measle:
Confirmed work on Samsung Galaxy S2 Skyrocket i727

Thanks. I used file: SGH-T989-PIT(OC).pit

Flashed with ODIN 3.07

to my i272 worked perfectly:

I now have 1.23 GB System ROM

8.46 GB Internal Data

5 GB Internal SD

(+ 64 GB ext SD Card)
[T-Mobile Samsung Galaxy S II SGH-T989] primod808:
How do did you get 1.23 GB of system rom? Thanks.
[T-Mobile Samsung Galaxy S II SGH-T989] measle:
I used the pit file kindly shared by OldeCrow in this thread
[T-Mobile Samsung Galaxy S II SGH-T989] sagirfahmid3:
Is there any reason why the parted commandline app is not used? I used that to edit my Nook Color and Tablet's partition sizes. Genuinely curious.
[T-Mobile Samsung Galaxy S II SGH-T989] primod808:
Thanks measle I must have read too fast in the thread to overlook that information!
[T-Mobile Samsung Galaxy S II SGH-T989] primod808:
Hey measle I flashed oldecrows pit file but my system rom still shows 617 mb. Can you tell your procedure and which partitions you changed? Thanks again.
[T-Mobile Samsung Galaxy S II SGH-T989] measle:
I simply followed original directions in this thread to the letter. Did you format partitions in recovery afterwards?
[T-Mobile Samsung Galaxy S II SGH-T989] primod808:
I got the extra space for my internal memory which is fine its just my system ROM didn't change. I reformatted my partitions to ext4 and my internal and external SD to FAT. Did I miss something? Thanks again.
[T-Mobile Samsung Galaxy S II SGH-T989] measle:
Mmm, are you sure you flashed SGH-T989-PIT(OC).pit . Sounds like you flawed a different pit file
[T-Mobile Samsung Galaxy S II SGH-T989] primod808:
Thanks measle I know what I did wrong.. I had 5.1 PA ROM which does change the internal storage but not the system rom. I switch roms and now on validus 5.1 v8. which now shows system rom at 1.23 GB!!
[T-Mobile Samsung Galaxy S II SGH-T989] sd2000:
Amazing

Thank You Lorien_Silmaril

Thank You OldeCrow

I Have been trying to figure out how to do this with the Note I717. I just received a Skyrocket I727 and I ran across this topic and I tried your pit file and it worked like a charm it has been almost 24 hours and about 4 ROM's and Slimm GAPPS, AROMA-LP-GAPPS, Old PA GAPPS, and Banks GAPPS. ALL worked perfectly the Skyrocket runs smooth no force closes no huge lag. Awesome!

I am thinking I will try amd edit the PIT for the Note I717 the same way and see what happens.