[MOD] Get more usable space with smaller custom roms - Galaxy S III Android Development

Hello
scroll to the bottom of this post for an update
So, i've been searching now for a while for a guide on how to get more internal space and reduce the /system partition of my sgs3,
since many custom roms are much smaller in size compared to stock.
Since i haven't found any, i've figured i'll try doing it myself.
This requires some linux/unix shell knowledge, so unless you used linux shell and/or adb before, i don't recommend trying this.
Also, i have done this on GT-I9300, the international version. If yours is not the same, the partition layout will probably differ
Requirements:
* parted ( can't post links yet.. )
* adb ( android sdk, platform tools )
* CWM recovery installed
* Custom ROM zip on your PC to upload after the operation.
Alright, so here goes. ( since i already mentioned this is an advanced operation, i'll keep it pretty basic )
1. Reboot into CWM recovery
2. Unmount everything possible (either in CWM or 'adb shell', i used the latter - more reliable i would guess)
3. adb push X:\xx\xx\parted /
4. adb shell
5. chmod +x parted
Now the real fun begins.
6. /parted /dev/block/mmcblk0
This will launch parted. type 'p' and press 'enter', you'll see something like this:
Code:
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 41.9MB 8389kB PARAM
5 41.9MB 50.3MB 8389kB BOOT
6 50.3MB 58.7MB 8389kB RECOVERY
7 58.7MB 92.3MB 33.6MB RADIO
8 92.3MB 1166MB 1074MB ext4 CACHE
9 1166MB 2777MB 1611MB ext4 SYSTEM
10 2777MB 3364MB 587MB ext4 HIDDEN
11 3364MB 3372MB 8389kB OTA
12 3372MB 15.8GB 12.4GB ext4 USERDATA
Now you need to calculate the partition sizes you actually need. Ignoring first partitions up to CACHE not to mess things up.
As far as i know, the CACHE partition is used for OTA, hence it's size - to fit ~ size of the rom. Personally i have no intention of using OTA, so i made the partition 100mb. I'm definitelly no expert in hacking android yet, but personally i haven't noticed myself using /cache more than that.
HIDDEN contains some preloaded apps - not valid in case of custom roms. I made it 1mb.
Not sure what OTA partition is used for, but again, i don't use OTA so i don't really care. 1mb.
As for SYSTEM, this depends how big is your custom rom. I currently use SlimBean which is ~100mb together with gapps, but just in case i've set the size to 300mb.
and the rest goes for USERDATA. I think you can already forsee a few more GBs for internal storage
So, just remove all the partitions that need to be resized and recreate them:
Code:
(in parted)
rm 8
rm 9
rm 10
rm 11
rm 12
then issue 'mkpart' 5 times to recreate the partitions.
When asked for a name, just press enter (we'll set the names later, since mkpart didn't change the names for me anyway)
When asked for type, you can either enter ext4 or simply press enter. We'll format partitions afterwards anyway.
When asked for start, enter the value from last partition's 'End'. For CACHE that would be the end of RADIO, so 92.3MB
For End enter the size you want. 10KB, 20MB, 1GB - annotations accepted.
After you create a partition, issue 'p' to check it's End for the next partition's start.
For USERDATA End just enter what you saw in the beggining, 15.8GB in my case.
exit parted, 'q'
7. format new partitions (except OTA)
Code:
mke2fs -T ext4 /dev/block/mmcblk0p8
mke2fs -T ext4 /dev/block/mmcblk0p9
mke2fs -T ext4 /dev/block/mmcblk0p10
mke2fs -T ext4 /dev/block/mmcblk0p12
For USERDATA i also used an option '-m 0.2' to get those extra 300mb from ext4 reserve.
8. mount /data/ ; mkdir /data/media
9. exit adb ; adb push X:\xx\customRom.zip /data/media
10. Flash new rom in CWM and reboot.
That's pretty much it. At least it was for me.
I may have missed something, but i'm now assured that this is possible.
For reference:
Code:
Before:
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 41.9MB 8389kB PARAM
5 41.9MB 50.3MB 8389kB BOOT
6 50.3MB 58.7MB 8389kB RECOVERY
7 58.7MB 92.3MB 33.6MB RADIO
8 92.3MB 1166MB 1074MB ext4 CACHE
9 1166MB 2777MB 1611MB ext4 SYSTEM
10 2777MB 3364MB 587MB ext4 HIDDEN
11 3364MB 3372MB 8389kB OTA
12 3372MB 15.8GB 12.4GB ext4 USERDATA
After:
Code:
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 41.9MB 8389kB PARAM
5 41.9MB 50.3MB 8389kB BOOT
6 50.3MB 58.7MB 8389kB RECOVERY
7 58.7MB 92.3MB 33.6MB RADIO
8 92.3MB 192MB 99.7MB ext4 CACHE
9 192MB 500MB 308MB ext4 SYSTEM
10 500MB 501MB 1000kB ext2 HIDDEN
11 501MB 502MB 1000kB OTA
12 502MB 15.8GB 15.3GB ext4 USERDATA
So now i have 13.8Gb of usable space on my sgs3 and i'm pretty happy about it.. No need to convert user apps to system apps in titanium any more..
Since i'm not sure about the effects of this for the long term, please provide me feedback if it went ok for you or not.
And if you have any points to make why this is not good i would also appreciate that.
UPDATE:
First of all, parted seems to be included in CMW, at least the cwm-touch-6.0.1.2 version has it ( noticed only after a while )
So no need to look for parted binaries if you're using that.
Second - as mentioned by sorg, this does mess up the partition table and anything that needs odin will not work. Tried myself, messed up the whole thing, but recovery was still half operational.
Anyway, using .pit ( GT-I9300_mx_20120329.pit ) the partition table was restored on my I9300 while flashing official stock, LH8.
So that's all fine. In case you don't want to try .pit method, you could simply restore the partition table using parted. Basically resize the partitions using same method to the original sizes. haven't tried this myself, but i imagine it should work
One last note, since i was too eager to do this all, i didn't notice the 'unit' command in parted. basically you can use 'unit kib', 'unit mib' to get the 'computer' values for sizes, which actually make more sense looking at parted output. the OTA partition is for example exactly 8mb (mib).
To get the 1000s units, use 'unit kb', 'unit 'mb' or 'unit compact' which selects the unit automatically based on partition size.

Alright,you've got some balls dude.I got to give you that!Bravo,really nice work.I don't need it atm (32gb version rocks hard),but I may do it for the fun of it.

Love it!... but there will be someone posting here, crying their eyes out before long (no sympathy from me however).
So much for the 'xda-downloaders.com' mentality and moar powah to the developer!
I salute you.

Very useful man. Thanks!
Sent from my GT-I9300 using xda app-developers app

Nice mod man!
You've got balls of steel trying to do that,i really admire you...
Anyway,excuse me if i'm wrong but i think applications you get form market get downloaded in cache first?
If you shrink that partition won't you have issues with apps?

1024Kb is one MB not 1000. it is 2^10 for a full MB. Great guide though, and VERY nice detailed instructions. Thank you, and you might wanna put a "I am NOT responsible" banner at the top!!!

nfsmw_gr said:
Nice mod man!
You've got balls of steel trying to do that,i really admire you...
Anyway,excuse me if i'm wrong but i think applications you get form market get downloaded in cache first?
If you shrink that partition won't you have issues with apps?
Click to expand...
Click to collapse
You might have issues if you try to download apps that the apk is bigger than the cache partition. Otherwise i don't think there's an issue. And since i don't download anything above 100mb, that's why i made it so. and even then, you can just symlink some folder in /data to /cache and you'll have all the space in the world for you cache..
b-eock said:
1024Kb is one MB not 1000. it is 2^10 for a full MB. Great guide though, and VERY nice detailed instructions. Thank you, and you might wanna put a "I am NOT responsible" banner at the top!!!
Click to expand...
Click to collapse
That's how parted displays it.

Ok, so 1000KB in parted equals 1024KBs or 1MB? Just trying to get this right...
Sent from my GT-I9300 using xda premium

b-eock said:
Ok, so 1000KB in parted equals 1024KBs or 1MB? Just trying to get this right...
Sent from my GT-I9300 using xda premium
Click to expand...
Click to collapse
1MB. In the guide above i have put 501MB for start and 502MB for end for OTA partition for example. That's 1MB in size, but gets displayed as 1000Kb. And 1000MB would be 1GB there.
I guess parted calculates in 10s and actually all of the hard drives are calculated like that on label. So in reality there's 16000000000 of bytes in my SGS3. divide that by 1024 a couple of times and you get lower 'actual' size. then file system format reduces usable space even more, but that's another subject...

Does this not qualify as Original Development .
OP i would PM a mod to ask for inclusion in Original i have .
jje

Well yes i guess. Just didn't have permissions to post there
If a mod reads this, feel free to move the thread. Otherwise i'll pm someone when i get home
Sent from my GT-I9300 using xda app

Hardware uses the industry-standard 10^3=1000 (according to sni: KiB) while software tends to use 2^10=1024 (according to sni: KB)
Sent from my GT-I9300 using xda premium

i made similar changes to my I9000 before, no problems at all
edit forgot to mention that the only thing you have to take care of is how to install newer roms with the new layouts in the future, but i bet with your knowledge in linux it wont be a problem to you at all

Will these changes in parted be saved into PIT structure?
Otherwise ODIN may repartition this if u will flash anything through it. Probably it won't touch data outside flashed part, so in this case it's still possible to flash for example recovery partition (in case if it get corrupted). If ODIN write some marks in all partitions every time then you may corrupt data on later partitions.
Btw, to make this thread useful, here is parted i've found on http://forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage/ :
http://www.sendspace.com/file/w6hi6x

sorg said:
Will these changes in parted be saved into PIT structure?
Otherwise ODIN may repartition this if u will flash anything through it. Probably it won't touch data outside flashed part, so in this case it's still possible to flash for example recovery partition (in case if it get corrupted). If ODIN write some marks in all partitions every time then you may corrupt data on later partitions.
Btw, to make this thread useful, here is parted i've found on http://forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage/ :
http://www.sendspace.com/file/w6hi6x
Click to expand...
Click to collapse
As far as I know Odin only repartitions the device if you include the correct pit for the device and check repartition.
L

9Lukas5 said:
As far as I know Odin only repartitions the device if you include the correct pit for the device and check repartition.
Click to expand...
Click to collapse
ODIN always read PIT file from device if you don't provide such. You can check ODIN logs. I believe, ODIN does following things:
1) if PIT file not provided, then read it from device
2) check file names assigned to every partition and pick them from supplied TAR file
3) write files directly (after un-sparse img files if required) to flash addresses taken from PIT.
so, if PIT structure in I9300 is not the same as GPT partition table, then you may mess data if you will accidentally flash parts beyond CACHE partition through ODIN.

A little update:
First of all, parted seems to be included in CMW, at least the cwm-touch-6.0.1.2 version has it ( noticed only after a while )
So no need to look for parted binaries if you're using that.
Second - as mentioned by sorg, this does mess up the partition table and anything that needs odin will not work. Tried myself, messed up the whole thing, but recovery was still half operational.
Anyway, using .pit ( GT-I9300_mx_20120329.pit ) the partition table was restored on my I9300 while flashing official stock, LH8.
So that's all fine. In case you don't want to try .pit method, you could simply restore the partition table using parted. Basically resize the partitions using same method to the original sizes. haven't tried this myself, but i imagine it should work
One last note, since i was too eager to do this all, i didn't notice the 'unit' command in parted. basically you can use 'unit kib', 'unit mib' to get the 'computer' values for sizes, which actually make more sense looking at parted output. the OTA partition is for example exactly 8mb (mib).
To get the 1000s units, use 'unit kb', 'unit 'mb' or 'unit compact' which selects the unit automatically based on partition size.

where can i get this "GT-I9300_mx_20120329.pit" if something went wrong ?

fuflo said:
[...] Second - as mentioned by sorg, this does mess up the partition table and anything that needs odin will not work. Tried myself, messed up the whole thing, but recovery was still half operational.
Anyway, using .pit ( GT-I9300_mx_20120329.pit ) the partition table was restored on my I9300 while flashing official stock, LH8. [...]
Click to expand...
Click to collapse
Do you mean that after repartitioning that way, you weren't able to flash e.g. a modem with Odin? Because I tried it just now, and for me it's working fine.
From my understanding about the .pit file, the pit gives informtion about the start and end point for the partitions. After we have repartitioned the device partially, for the changed partitoins the information in the pit file doesn't match anymore, but as kernel, modem, recovery, etc. are stored on the partitons 1-7 and we haven't changed them, Odin pulls the pit from our device and flash to modem e.g. to the place the information in the pit file says. So all flashing actions which only go to the partitions 1-7 shouldn't be problematic, only if you want to flash a whole samsung firmware with Odin you have to tick repartitioning and select the correct pit file in Odin.
And then I have a question regarding doing the same on the S4. The S4 has a protected bootloader as you maybe has heard of. Do you think this method is also usable on the S4 without the danger of a hard-brick? From the recovery all the partitions I want to change ( cache, system, data, ...) are also flashable, only those before are protected, so could/should it work? Invisiblek has written it would brick my phone :
invisiblek said:
DO NOT DO THIS
that link is for an exynos sgs3
our pit is signed. This will brick your device.
Click to expand...
Click to collapse
L

You are most likely correct with the first part of your post. I haven't tried flashing separate parts of a rom at that time, but it would most likely work.
Regarding S4, to be honest i have no knowledge of it. Even more so about signed stuff. From general knowledge, if the signature isn't connected the things you want to modify, it would probably work, but don't take my word for it. You'd better off discussing this in the S4 forums
Regarding GT-I9300_mx_20120329.pit, i later read that it's for 64gb version of i9300. Although it worked fine for me. As for where to get it, just google it.. there are zips all around the net with various versions, including this one.

Related

Sneaky Samsung hidden partition: /dev/block/mmcblk0p3 (/mnt/apk)

Due to a previous Odin ROM install, each time my Tab was restarting there was 3 apps automatically installed to /data/app (DioDict, PanzerPanic, InfeCCt).
There is a sneaky small hidden partition at /dev/block/mmcblk0p3, which gets mounted at startup by the Samsung recovery at /mnt/apk, and immediately disappears after it does its sneaky job ! Note that this has nothing to do with the stock init.rc on my euro Tab, as I use a self-made initramfs ramdisc where I can control most aspects of the boot process...it seems to be a recovery-only procedure (see the post below about the /preinstall mount).
I went to recovery, mounted mmcblk0p3 manually, and deleted the contents of /mnt/apk, problem sorted The "parted" command easily shows the partitions on the internal SD card, including this not-so-mysterious-anymore space.
As I build my own kernel and craft my own initramfs ramdisc, I added an fstab that gets activated in recovery mode only, so I have easy mount options for mmcblk0p{1,2,3} and all the other important partitions. I use /res/etc/fstab, based on the ClockWorkMod recovery folder structure (/system/etc gets sym-linked). Anyway, I digress.
I assume that hidden.rfs (when flashed with Odin) is destined to this hidden internal SD card partition, so I guess that Heimdall could be updated to support this particular use-case...or maybe not
Cheers, Dan
That's your pre install partition.
Code:
mkdir /preinstall
mount rfs /dev/block/mmcblk0p3 /preinstall nosuid nodev check=no
chown system system /preinstall
chmod 0771 /preinstall
is how it's mounted by init.rc. So, you can just remove it from that to prevent it from mounting too.
Ah, thank you for the clarification !
EDIT: I have never seen the preinstall directory on my Euro Tab, but I also admit that I didn't pay attention to the stock init.rc (which has now been overridden by my self-made initramfs). By the way, it's not RFS on my Tab, but vFAT.
Nothing to do with hidden.rfs then ?
How come the APK files never get deleted from this partition ? It should really be just a one-off install, right ? Otherwise, as it stands it is designed to interfere with my nicely cleaned-up system at each device reboot ! (and it is not controlled by the init.rc, but by the recovery process)
I noticed that partition too on my Verizon Tab. I don't want to mess with it though, I think it contains some files that Samsung uses to unbrick dead tabs at their repair center.
You can always just back it up with heimdall before you mess with it so you have a good restore.
/dev/block/mmcblk0p3 means???
So guys,
whats the meaning of /dev/block/mmcblk0p3 not found anyway
I got that message after flushing back and forth between froyo-GB to my Samsung I9003 device. I did rooting also at that moment.
According to your post earlier i assume that there is a way to fix this problem.
*sorry for the 'very' newbie question*
Any suggestion where i can start trying ??? (i've ask here but hopeless)

[i9000] System UIDs Inconsistent + sdcard corrupt

First of all sorry about my english
I have SGS GT I9000 i got the error "System UIDs Inconsistent" so i started to read on internet and try to fixit by my own but i cant solved it, the problem is i have internal sdcard with 6GB fat32 and 2GB rfs (fat32 + journal) and this 2GB have a corrupts blocks, the internal sdcard it's ok i dont recive I/O errors or something like that, so i try to fixit following this steps:
i redirect the internal sdcard to the usb port so on my mac i use the disk utility to fix this blocks, i repair the disk and make new partitions and everythings looks right but when i restart the phone all be like i dont do anythings :S
i give privileges 777 to /dev/block/mmcblok0
echo /dev/block/mmcblk0 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
repair the disk and make partitions on "macosx disk utility"
I installed diferents roms like JVK JVO or CM7 with CM7 the phone works fine because this rom dont use rfs so dont read the 2GB with problems, but the problem became when i restart with this room the /data partition is mount over mmcblk0p1 => 6GB and when i restart the phone all the data will overwrite with my old data so CM7 launch again the start assistent and lost my wifi confg, etc...
I trie to use diferrents .pit files 512 513 812 but this doesnot work.
Maybe i can redirect /data to /system/data over CM7 but how can i made this change permanet?
What's the problem? maybe is the sdcard on readonly mode? i dont have priveliges? i cant work over rfs file system without their special tools?
Thanks to everyone...
I Found this user and he have the same problem maybe he english is better than mine and you can understand him better:
I have a similiar problem with my internal SD on my I9000. Somehow I am unable to change anything on my sd...be it copying new files to it, deleting existing files or formating it.
It actually tells me that it did those actions and I can use programs that I copy on to my sd, but after every reboot my sd is like I never touched it(which obviously is a bad thing).
I'm using Clockwork for Recovery.
Using the print command from parted I get:
Model: MMC M8G4DD (sd/mmc)
Disk /dev/block/mmcblk0: 8221MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.8kB 6208MB 6208MB primary fat32 lba
2 6208MB 8221MB 2013MB primary lba
It seems my 2nd partition is broken.
I then tried to repair the partition with mkfs on partition 1 and 2 using ext2.
In both cases I get:
Error: Invalid superblock. Are you sure this is an ext2 file system?
{random useless information from parted concerning potential bugs}
Error: SEGV_MAPERR (Address not mapped to object)
[1] Aborted parted /dev/block/mmcblk0
I read somewhere that I should try using e2fsck to repair the partition and I tried that too.
And I got this:
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/mmcblk0p2
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
Deleting Partitions via parted doesn't do anything. No errors but the partitions remain.
I can still flash any firmware on my I9000 and I can even install updates via recovery.
But no matter what I do no changes to my data partition stay after I reboot my mobile.
Anyone got an idea what else I could try?
Click to expand...
Click to collapse
I have the same problem. did you look inside /dev/block/ ?
A normal phone has mmcblk0, mmcblk0p1 and mmcblk0p2.
Mine has only mmcblk0 and partition table looks broken.
Probably the internal storage is broken, this covers /data and /sdcard.
On froyo i was able to tweak /system/etc/vold.fstab to mount /sdcard from external sd, but no luck with mounting /data from external sd.
im sure you already found the solution to the problem, or perhaps you reinstalled fresh, but I just ran into the problem myself and was able to fix it by going into cwm and restoring permissions under the advanced tab. hope this helps anyone who has this same issue, it took me a while to find a solution
Hey there...!
lordscipio said:
im sure you already found the solution to the problem, or perhaps you reinstalled fresh, but I just ran into the problem myself and was able to fix it by going into cwm and restoring permissions under the advanced tab. hope this helps anyone who has this same issue, it took me a while to find a solution
Click to expand...
Click to collapse
Fixing permissions by CWM does´nt solve the problem in my case...! Ext-SD ist stil r/o and not r/w as it should be. Flashing different Fw´s, CWM´s etc. all about useless to get the UID´s persistant again. Any idea what i can try to do next...?
Regards Ede

Workaround for "read-only mode" - install to SD card

Here's a rough guide to how I got the official T-Mobile Froyo release running from the external SD card. Booting is done via fastboot tethered to a PC, but after that you can disconnect and keep running off the SD (provided you don't reboot.) If there's interest I can provide more info/files.
My tablet is stuck with stock recovery, and Android bootloops when I try to boot normally. I can "fastboot boot" CWM 3.0.2.0 (no success with anything else really -- still not sure why), so I've got root adb.
Get the official T-Mobile Froyo release, decrypt it with the matching recovery (also fastbooted), unzip it. Recompile both the recovery kernel and the Froyo OS kernel, hacking the SD devices to be swapped (external SD card becomes mmcblk3 and internal MMC memory is mmcblk2.) This is so you won't have to fiddle with references to device IDs in config files, installation scripts, etc.
Partition and format the SD card roughly according to the MMC partition layout for the partitions that show up in Linux, using GPT. Here're the commands I used from the recovery (shell, parted commands, shell):
Code:
umount /cache
umount /system
umount /data
umount /sdcard
parted /dev/block/mmcblk3
mklabel gpt
unit s
mkpart logical 34 35
mkpart logical 36 37
mkpart logical ext3 38 688166
mkpart logical ext3 688167 917543
mkpart logical ext3 917544 950312
mkpart logical ext2 950313 954409
mkpart logical ext3 954410 3051562
mkpart logical 3051563 3084331
mkpart logical 3084332 3117100
mkpart logical 3117101 3149869
mkpart logical 3149870 3182638
mkpart logical 3182639 3215407
mkpart logical ext3 3215408 3248176
mkpart logical fat32 3248177 7798552
mkpart logical 7798553 7831321
mkpart logical 7831322 7864090
name 1 SOS
name 2 LNX
name 3 APP
name 4 CAC
name 5 MSC
name 6 FDR
name 7 UDA
name 8 OLG
name 9 LGF
name 10 RES
name 11 RGN
name 12 VAR
name 13 USP
name 14 SDC
name 15 WP1
name 16 WP2
mke2fs /dev/block/mmcblk3p3; tune2fs -j /dev/block/mmcblk3p3
mke2fs /dev/block/mmcblk3p4; tune2fs -j /dev/block/mmcblk3p4
mke2fs /dev/block/mmcblk3p5; tune2fs -j /dev/block/mmcblk3p5
mke2fs /dev/block/mmcblk3p6
mke2fs /dev/block/mmcblk3p7; tune2fs -j /dev/block/mmcblk3p7
mke2fs /dev/block/mmcblk3p13; tune2fs -j /dev/block/mmcblk3p13
dd if=/dev/block/mmcblk2p15 of=/dev/block/mmcblk3p15 bs=1M
dd if=/dev/block/mmcblk2p16 of=/dev/block/mmcblk3p16 bs=1M
Note the dd for p15 and p16 -- these contain data like your device IDs and MAC addresses. I'm not sure if they are actually needed in Android (the bootloader can read the "real" read-only ones and passes them on the kernel command line), but to be safe we'll copy them.
The partition table then looks like this:
Code:
Model: SD SD04G (sd/mmc)
Disk /dev/block/mmcblk3: 4027MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 18.4kB 1024B SOS
2 18.4kB 19.5kB 1024B LNX
3 19.5kB 352MB 352MB ext4 APP
4 352MB 470MB 117MB ext3 CAC
5 470MB 487MB 16.8MB ext3 MSC
6 487MB 489MB 2098kB ext2 FDR
7 489MB 1562MB 1074MB ext3 UDA
8 1562MB 1579MB 16.8MB OLG
9 1579MB 1596MB 16.8MB LGF
10 1596MB 1613MB 16.8MB RES
11 1613MB 1630MB 16.8MB RGN
12 1630MB 1646MB 16.8MB VAR
13 1646MB 1663MB 16.8MB ext3 USP
14 1663MB 3993MB 2330MB fat32 SDC msftres
15 3993MB 4010MB 16.8MB WP1
16 4010MB 4026MB 16.8MB WP2
I shrunk data partitions down to fit my small SD card, and some are tiny because they aren't needed for anything but preserving the numbering.
Remove references to blob and boot.img from the update.pkg scripts (since they won't need to be flashed), rezip it, adb push it to the device, and install it using the CWM menu item.
Replace the kernel in boot.img (for SD device ID swap I mentioned above), and "fastboot boot" it. Mine looks like it's hung during the T-Mobile boot animation, but eventually gets through. Android should come up as normal, and you can disconnect from the PC and use it until you reboot. Mine's a little laggy on this first boot -- not sure if it's a slow SD card to blame, or if it's just how the first boot goes on this tablet. My 4G modem is not working right now, but everything else seems to work.
Superuser.zip can be installed with the same hacked CWM recovery.
I'm working on Honeycomb, but seem to be having early boot problems, and I'm wondering if "fastboot boot" is different enough from a regular flash boot that some kernels can't handle it.
P.S. If you're happy with what you're stuck with on /system etc, you could potentially use that from the built-in memory, and put only your read/write stuff on SD. You'd probably have to patch more initscripts etc to do that though.
There is no gingerbread reelase.
giveen said:
There is no gingerbread reelase.
Click to expand...
Click to collapse
Oops, meant froyo. My point was that the vold service in pre-HC releases might be easier to work with. I've booted my GB-based phone off of an SD card via fastboot before.
joeyhewitt said:
Oops, meant froyo. My point was that the vold service in pre-HC releases might be easier to work with. I've booted my GB-based phone off of an SD card via fastboot before.
Click to expand...
Click to collapse
have you seen the method used in general involving the holding of all buttons for 2min then performing a wipe of dalvik cache?
Nocturnal_50 said:
have you seen the method used in general involving the holding of all buttons for 2min then performing a wipe of dalvik cache?
Click to expand...
Click to collapse
Tried (minus removing capacitive cover -- maybe if I get more desperate I'll try) and it didn't work for me. Although I tried wiping the cache first, since that's what you said here. I guess I'll try the other order. I've already verified that formatting /cache has no effect (contents are still there), so unless it has unexplained side-effects I'm not very optimistic.
P.S. Wait, 2 minutes?! You said 15 seconds before. Edit: saw your new instructions, I'll try that.
joeyhewitt said:
Tried (minus removing capacitive cover -- maybe if I get more desperate I'll try) and it didn't work for me. Although I tried wiping the cache first, since that's what you said here. I guess I'll try the other order. I've already verified that formatting /cache has no effect (contents are still there), so unless it has unexplained side-effects I'm not very optimistic.
P.S. Wait, 2 minutes?! You said 15 seconds before. Edit: saw your new instructions, I'll try that.
Click to expand...
Click to collapse
to be honest I was drinking the night I got it resolved on mine so 2min would have seemed extremely short, so stick with the 2min for now... if it some how happens to fix it then I will be looking into alternative measures to get this thing back to RW (it will probably involve acquiring a RO streak)
I think my problems booting the kernels in newer ROMs and recoveries are because I'm stuck using the old bootloader. Can anyone confirm that there are in fact incompatibilities? Since I can't just flash the new one, anyone know how to boot an nvflash-pushed bootloader image into fastboot mode, so I can then hopefully push a kernel image and boot that? Or perhaps can I patch the new kernel to work with the old bootloader?
Thanks.
joeyhewitt said:
I think my problems booting the kernels in newer ROMs and recoveries are because I'm stuck using the old bootloader. Can anyone confirm that there are in fact incompatibilities? Since I can't just flash the new one, anyone know how to boot an nvflash-pushed bootloader image into fastboot mode, so I can then hopefully push a kernel image and boot that? Or perhaps can I patch the new kernel to work with the old bootloader?
Thanks.
Click to expand...
Click to collapse
any change to the bootloader is included in the kernel, unless you mean recovery then you are just running in circles making everyone wonder what you are going on about
Nocturnal_50 said:
any change to the bootloader is included in the kernel, unless you mean recovery then you are just running in circles making everyone wonder what you are going on about
Click to expand...
Click to collapse
Sorry, I'm talking about the Tegra low-level bootloader, "bootloader.bin", which is flashed to the EBT partition (and it or possibly a variant is used for nvflash; I'm not sure if they are interchangeable.) I see the official Froyo release has one with a date March 2011 (shown on-screen when in fastboot mode), and looking at the one from the HC release in a hex editor (buried in the "blob" file from the update pkg), it says December 2011. This doesn't necessarily prove there are changes, but given the usual requirements to flash the official HC release before the third-party ROMs or recoveries, I think this is what's going on -- the HC release flashes in the new boot loader that the ROM/recovery needs.
Edit: The NVC partition may also be involved, don't know much about this yet. On all of this, anyone feel free to correct me if you know more; I'm just explaining it as far as I've been able to cobble together from scraps of information and hex dumps.

[Q] Internal Memory FUBAR? ADB help

Hi all,
Tearing my hair out here (and I have SFA left anyway)
My Father-in-law's SGS i9000 seems to have real issues. Initially problem I was having was that there was an app I could not uninstall- it would reappear on reboot. I initially suspected malware or such, but it appears to be a real problem with the internal memory. I had MIUI installed on it, but wanted to change to a more stock ROM.
First time I really started to worry was when I found that every time I put a new rom onto the internal sdcard, it disappeared at reboot (and thus wasn't there to install when rebooted into CWM)
Since then, haven't had a functioning phone.
adb push to sdcard still not persistent on reboot.
Cannot flash new ROM with ODIN either, although KERNEL changes, filesystem no longer mounts.
I think the version of MIUI I was using used an ext4 lagfix, as inside an adb shell, I can see the partitions:
parted /dev/block/mmcblk0
a "print" lists two partitions:
Number Start End Size Type File system Flags
1 32.8kB 14.4GB 14.4GB primary fat32 lba
2 14.4GB 16.4GB 2013MB primary ext4 lba
rm 1, rm 2
to try to delete the partitions and start again- doesn't work. Nothing happens
If I load partition 2 into parted:
parted /dev/block/mmcblk0p2
print
Model: Unknown (unknown)
Disk /dev/block/mmcblk0p2: 2013MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 2013MB 2013MB ext4
Can;t check any partitions as ext4 isn't supported by parted.
I cannot remove any partitions, reformat them or anything.
e2fsck errors as it cant read superblock flags on any of the partitions.
Any other ideas? Anyone?
I don't want to toss the phone out
http://forum.xda-developers.com/showthread.php?t=845708
i dont know if this will help u but u can try this guy instruction. See link above
compacity said:
http://forum.xda-developers.com/showthread.php?t=845708
i don't know if this will help u but u can try this guy instruction. See link above
Click to expand...
Click to collapse
If that worked, it would have been just what I was looking for
I googled the hell out of this problem, and that one never came up, but others I'd seen led me to try that same plan.
Where it fails on my device, is that deleting the partitions in "parted" fails- rm1 followed by rm 2 to delete the partitions. "Print" reveals they're still there.
Any other partition tools worth trying?
I got it back to square one:
Flashed kernel thru Odin with a version of CWM that worked.
reboot into recovery.
Flash update from SDcard- card contents still the same, so could re-flash MIUI.
reboot, bootloop. Re-enter CWM recovery and reflash.
Back to Square One - MIUI 1.12.16 (JVK)
Cannot install anything - nothing is persistent after reboot, even WIFI settings disappear
If it is any help to anyone who knows what they're talking about:
Now that MIUI boots I can look at the filesystem better.
Can anyone point me in the direction of what I should be looking for/trying to do to figure out what is wrong here?
try finding solution here, its PIT stop for i9000 problem
http://forum.xda-developers.com/showpost.php?p=30415128&postcount=1
Mine seems to be a bit tougher than these solutions can deal with.
Tried assorted ROMs over past day. No install works.
Cannot install anything from internal memory, as nothing dropped into that card will remain after a reboot.
Installing anything from an external card just throws up bootloops etc- as the only thing that seems to be able to retained between boots is the kernel/CWM.
If I install a new ROM, first flash says partition table is incompatible and /data will be overwritten (no problems, nothing on it). I accept the inevitable and re-select the ROM.
Reboot bootloops, as expected, reboot into CWM (now a new version with the Kernel), try reflashing the ROM image- Error 0 or 7. Try from External Memory- same. Try sideloading image. Same. All I can do is re-flash the MIUI image on internal SDcard (which works)
It looks like the internal memory refreshes itself from a recovery image at each boot? (I think).
Anyway- can't get anything to stick, except MIUI
edit:
http://forum.xda-developers.com/showthread.php?t=761537&page=3
http://forum.xda-developers.com/showthread.php?t=1230059&page=3
hav u try this 2 link as this is da only thread matches ur MBR problem
compacity said:
did u try any jb kernel out there? as its also ext4 n push it using adb. juz a suggestion though.
Click to expand...
Click to collapse
Good suggestion Logical
I'd thought that also- The JB kernels should support ext4.
No joy though
The version of CWM recovery that is stable with the MIUI install is 5.0.2.7, and it doesn't have any voodoo/lagfix options
When I flash a kernel with a CWM with lagfix, and try to use the CWM lagfix toggles, nothing changes.
Doesn't matter what I select inside CWM, it reads the status from memory as "Lagfix on, Debug off"
The reason I asked about ext4 tools in ADB is that running filesystem commands in a shell just throws up errors I can't seem to fix.
e2fsck just throws up superblock errors (on both /dev/block/mmcblk0 and the partition /dev/block/mmc0p2.
Defining one of the backup superblocks doesn't help- they're all bad.
"parted" doesn't work anymore (i note it isn't in /sbin, so I am picking this kernel doesn't install it), but even when I did have it, "parted" doesn't support ext4. Using "rm" to remove a partition did exactly nothing.
Starting to think the only way forward would possibly be flashing a custom .pit file to define partitions that move the data off an obviously bad block? Above my skill level however LOL
refresh browser see my post above again

[GUIDE][REPARTITION] Get extra 1.5 GB (2.4 GB for AOSP users) on user data!

Hello XDA community
I'm using my GT-I9300 via reparititoned table for 4 months and it's working very well and very useful for Custom ROM users like us.
Here's stock 16 GB GT-I9300 has a partition table;
Code:
Model: MMC VTU00M (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 41.9MB 8389kB PARAM
5 41.9MB 50.3MB 8389kB BOOT
6 50.3MB 58.7MB 8389kB RECOVERY
7 58.7MB 92.3MB 33.6MB RADIO
8 92.3MB 1166MB 1074MB ext4 CACHE
9 1166MB 2777MB 1611MB ext4 SYSTEM
10 2777MB 3364MB 587MB ext4 HIDDEN
11 3364MB 3372MB 8389kB OTA
12 3372MB 15.8GB 12.4GB ext4 USERDATA
As you can see, Samsung give 1GB to /cache partition and ~587MB to /preload partition. If your phone is out of OTA update service (if your phone is rooted, it's already out of OTA) they're the most useless things in your device.
Why /cache partition is soooooo big?
The system downloads Android OTA updates to /cache. If you want update your
phone 4.1.2 to 4.3 via OTA, the device needs to have enough space for store the update. That's why /cache partition is so big. But, if your device is rooted (or you're using a custom ROM), that doesn't matter because the device is out of OTA update service already.
What is the HIDDEN (/preload) partition?
It's just only for Samsung's craps. It only has a ringtone, and a video called Nature of .... (I don't remember the video name).
So, what should I do?
If you are a Custom ROM user or using device with root, you don't need those sooo big partitions. You should resize them.
What will this guide do to my device?
You will shrink those useless partitions and give more space to /data ( User data) partition.
Is there any risk?
Of course. Re-partition an Android device is one of the most dangerous thinks.
Is there any disadvantages?
Yes. If you done this guide and resize your partitions, you can't install any Official ROM via Odin.
Which types of packages that I cannot install via Odin after Re-partition?
You can't install Official ROMs (downloaded from sammobile.com, samsung-updates.com, etc). But you can install kernels, modems, bootloaders, recoveries via Odin without any problem.
What is gonna happen if I install an Official ROM via Odin after Re-partition?
Your device will be semi-bricked. Recovery cannot mount&format some partitions. But you can restore/unbrick your device with PIT file.
Which device that I can do repartition?
16 GB of GT-I9300 only. Please don't try it to other devices.
Can I install anything on CWM?
Of course. You can do anything like before on your device with Custom Recovery. You can install anything like always.
Is there any guide to revert it back?
Yes, in second post.
Is there anything you want to say before start operation?
Your device will be freshed after repartition, so you should make Nandroid Backup and backup your internal sdcard.
Screenshots​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Guide​
* You have to use latest Philz Recovery on this operation. You can go back your favorite recovery again after repartition. And I am not responsible for any problems that on your device!
1 - Download "repart_16GB_GT-I9300_CWM.zip" or if you use AOSP and you hate sammy ROMs, download "repart_16GB_GT-I9300_CWM_AOSPv2.zip" from attachments and copy it to external sdcard.
2 - Make sure that you backup everything on your device
3 - Boot to recovery ( Latest Philz Touch)
4 - Install the zip file you've downloaded . After installation, device will reboot to recovery automatically.
5 - You can see some mount errors while booting recovery. Don't panic.
6 - Wipe Data/Factory Reset --> Clean to Install a New ROM (You may see some error, don't worry)
7 - Mounts and Storage --> format /data and /data/media (/sdcard)
8 - Bingo! Restore your system, or install a ROM.
That's it! After doing repartition (not AOSP one), your partition table will be;
Code:
Model: MMC VTU00M (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 41.9MB 8389kB PARAM
5 41.9MB 50.3MB 8389kB BOOT
6 50.3MB 58.7MB 8389kB RECOVERY
7 58.7MB 92.3MB 33.6MB RADIO
8 92.3MB 193MB 101MB ext4 CACHE
9 193MB 1805MB 1612MB ext4 SYSTEM
10 1805MB 1820MB 15.0MB ext4 HIDDEN
11 1820MB 1828MB 8000kB OTA
12 1828MB 15.8GB 13.9GB ext4 USERDATA
As you see, we have +1.5GB on USERDATA partition.
Reverting To Stock Partition Table​
1 - Download "Odin3_v3.07_with_PIT_16GB_GT-I9300.zip" and extract it somewhere
2 - Download any stock ROM from sammobile.com or samsung-updates.com and uzip it.
2 - Open Odin, click "PIT" button and select "GT-I9300_16GB.pit"
3 - Click "PDA" and select official ROM that you've downloaded
4 - Click "Start"
5 - After installation, phone will be stuck at bootanimation, don't panic.
6 - Pull out battery, boot to recovery (you can see some mount errors, don't worry)
7 - Select "wipe data/factory reset" in recovery menu
8 - Select "reboot system now"
great shot.....
I appreciate...
Hi,
I have a question here please,
What if my device is formatted as f2fs not ext4, can i still use this guide ?
Cuz as i can understand if it worked it will format all the partitions to ext4 then if reformatted using recovery to f2fs is it gonna work?
Thanks.
Edit :
I used it & that;s really GREAT and HELPFUL , Thanks .
btw, @forumber2
It will be great if could put a swap partition in their , can i make it by my self ?
i saw the manual in the other post, but how i can make the software use it and recognize it??
Great work, thanks!
Lähetetty minun GT-I9300 laitteesta Tapatalkilla
This seems really cool. I would just suggest you put some warnings up there in CAPS in RED, else people will start spanning your thread with how they screwed up their devices.
It's possibile to make it also on s4?
if u need a tester consider me!
I have seen the code and seems to be simple but...send me a pm...for s4 will be brlliant with my intsd2extsd mod! :good:
good job dude!!!!!!!!!!!!!!!!!!!!
Works like a charm
The operation was a success! very easy to follow.
Thanks a lot!
I think this is the easiest method i ever seen
Thank you so much
Great job @forumber2, works just fine.
Andro Boy said:
Hi,
I have a question here please,
What if my device is formatted as f2fs not ext4, can i still use this guide ?
Cuz as i can understand if it worked it will format all the partitions to ext4 then if reformatted using recovery to f2fs is it gonna work?
Thanks.
Click to expand...
Click to collapse
Of course you can use this guide, and yes f2fs gonna work like before
mattiadj said:
It's possibile to make it also on s4?
if u need a tester consider me!
I have seen the code and seems to be simple but...send me a pm...for s4 will be brlliant with my intsd2extsd mod! :good:
Click to expand...
Click to collapse
PM has been sent
Only thinking... Would it be possible to increase system in this way? For the 4.4.2 Stock for example?
Great work!
Marvis21 said:
Only thinking... Would it be possible to increase system in this way? For the 4.4.2 Stock for example?
Great work!
Click to expand...
Click to collapse
yes it would be posible..
Marvis21 said:
Only thinking... Would it be possible to increase system in this way? For the 4.4.2 Stock for example?
Great work!
Click to expand...
Click to collapse
Yes, it's possible but it's unnecessary. We can shrink ROM to 1.5 GB easily
Works On 32GB I9300 as follows
BACKUP-BACKUP-BACKUP -TO PC OR MicroSD
THIS WILL WIPE YOUR PHONE OF ALL CONTENTS-STUFF-DOCS-PICS-NANDROID EVERYTHING WILL BE GONE
YOU NEED A SD CARD TO REFLASH YOUR PHONE AFTER THIS
ALL CONTENTS-STUFF-DOCS-PICS-NANDROID EVERYTHING WILL BE GONE​
hi guys i did this on my 32GB S3 and it worked flawlessly using @forumber2 zip by editing some values according to my phone storage and requirement.
 @forumber2 can add on OP for those that want to do it for whatever partition on your phone
Mandatory Warning - Warning
your phone may die or not work ok forever if you act a fool and set too small partitions
it may just die to spite you or just for fun so be careful if you do this
do a backup because it will delete all your stuff, even cute puppy photos won't be spared
Warning - Warning
text to be typed is in green colour
you'll need these on your PC/Phone
PC
Text editor (Notepad++)
ADB (Android Commangdr or CMD works fine)
Archiver (7Zip)
Phone
insecure adb ( its here on XDA by Chainfire) http://forum.xda-developers.com/showthread.php?t=1687590
Rooted phone (its here on XDA by Chainfire)
parted (i attached it below)
Root Explorer (X-plore,Root Explorer, ES etc etc )
Steps
On Your Phone
1. Parted - using Root Explorer, this file should be put in "system\bin\" then change permission to rwxr-rx-r and REBOOT
2. Insecure adb - install as usual apk file
ON your PC:
3. Connect your phone to PC
4. Open CMD and check your phone is seen/available/online
4.1 type "adb devices" ( you should see a list with a number and device - your good to go else check if debugging is enabled on your phone)
5. Get partition sizes
5.1 type " adb shell "
5.2 type " parted /dev/block/mmcblk0 print "
this will give you a printout of your device partitions with names
Save this screenshot if you want to rollback to default values later on
a PIT file will also do the same thing via ODIN
6. extract the repart_16GB_GT-I9300_CWM.zip
7. open the extracted folder \META-INF\com\google\android\
8. open "update-binary" with Notepad++
9. change the following 5 lines to sizes you want
Very important
the last line(31.3GB) is from your print above on point 5.2
don't put numbers you from thin air - think about it
ui_print "Creating new partitions..."
parted /dev/block/mmcblk0 mkpart primary 92.3MB 193MB
parted /dev/block/mmcblk0 mkpart primary 193MB 1805MB
parted /dev/block/mmcblk0 mkpart primary 1805MB 1820MB
parted /dev/block/mmcblk0 mkpart primary 1820MB 1828MB
parted /dev/block/mmcblk0 mkpart primary 1828MB 31.3GB
10. after editing then save the file
drag it into the zip
then copy the zip to your phone and flash via CWM...done
now the pain starts of putting everything you've backed up back to your phone and install your apps for a small gain of 1.5GB... EISH NEH
First one is Cache =100MB
Second is System =1612MB
Third is Hidden/preload =
Fourth is OTA = 8MB
Fifth is UserData = 29.4GB
simple maths 193-92.3 = 100MB is patition size
the other way is to ask yourself how much space you want and add together with the last number with the size you want
"i want System to be 2GB=2000MB then 193+2000=2193MB"
don't be greedy and unreasonable and want space you don't have like 64GB on a 32GB S3... not going to happen, you'll kill your phone
rolling back is also the same way - remember the screenshot on point 5.2 YEAH that one you were suppose to save is needed here
---------- Post added at 04:48 PM ---------- Previous post was at 04:19 PM ----------
I'm going to shrink my system to 512MB and install CM or SlimKat , currently with preload and cache shrunk
Sent from my GT-I9300 using Tapatalk
Excellent man
I was struggling to install recent KK TW port due to less system file size. You solved my problem. I have created more than 2GB size of system now and all looks good.
Thanks a lot.
Marvis21 said:
Only thinking... Would it be possible to increase system in this way? For the 4.4.2 Stock for example?
Great work!
Click to expand...
Click to collapse
Use attaches zip for creating system file system more than 2GB, which is needed for TW KK recent port by Archi.
This is full proof and running in my mobile without any issue. After installation of ROM around 400MB is free.
Do it on your own risk.
Best of luck.
Follow rest process of OP.
this is newsworthy!
Hey @forumber2, I'm interested in porting this mod to Note 2 N7100, can I port this mod and distribute? I have modified your update-binary to suit with N7100 partition table, going to try flashing the zip soon.

Categories

Resources