Problem after "fastboot format userdata" - OnePlus 3T Questions & Answers

I got some problem with the pattern to unlock the recovery so i used fastboot erase userdata
The problem is now its show only 30 GB of memory from the 128 gb
This is the log for the "fastboot format userdata"
Creating filesystem with parameters:
Size: 121568194560
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 29679735
Block groups: 906
Reserved block group size: 1024
Size: 121568194560
(this is the original size i should have)
Blocks: 29679735
(this is the memory now)
There is any way to restore back to the original size?

macdj98 said:
I got some problem with the pattern to unlock the recovery so i used fastboot erase userdata
The problem is now its show only 30 GB of memory from the 128 gb
There is any way to restore back to the original size?
Click to expand...
Click to collapse
You're going to have to flash the stock recovery img onto the phone and then sideload the stock OS (download via oneplus site) via adb. That should fix the partition issues. At least that's what worked for me. It's the only solution I know of at the moment. After a reboot you should be able to flash TWRP and then flash whatever you want on there.

Yes this works, im using restore backup original system it works too.
What can i to do to recovery newer shown this thing again " enter pass in recoverery" and i dont musst reset all data od phone when im installing some not good ****rom ?
Im new user op3t before Samsung .... What happend when i give pass to smartlock and instal new rom throught this pass in recoverery and restart still stay here or it will by wants pass who nobody knows again and fastboot.. reset userdata again... And again and again, guys this is not good

Very Quick Solution
Just flash the stock recovery. Boot into recovery mode, wipe all data. That should the trick.

If you plan on using TWRP anyway, just go ahead and flash TWRP if you don't have it already, then go to wipe - format data. You will have to type yes to continue. That will recover all your available space.
I would have this issue almost every time I would flash OOS, because even though I would flash Magisk also, my phone would still attempt to encrypt my data. Only way to resolve that was to fastboot format userdata like you did. Each time encryption was unsuccessful and I'd use that command, my 128GB 3T would end up with ~29GB total space.

Related

[MOD] Get more usable space with smaller custom roms

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.

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.

[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.

unable to encrypt phone

Phone: xt1060, verizon, Moto X Dev edition (2013)
ROM: Cm 12.1 (however, I was unable to encrypt with my last ROM as well)
My data directory is formatted with f2fs. When I attempt to encrypt the phone, it reboots without error and without any encryption action. I've used logcat to capture these messages:
I/Cryptfs ( 242): Check if PFE is activated on Boot
E/Cryptfs ( 242): Bad magic for real block device /dev/block/platform/msm_sdcc.1/by-name/userdata
E/Cryptfs ( 242): Error getting crypt footer and key
E/Cryptfs ( 242): Bad magic for real block device /dev/block/platform/msm_sdcc.1/by-name/userdata
E/Cryptfs ( 242): Not a valid ext4 superblock
E/Cryptfs ( 242): Orig filesystem overlaps crypto footer region. Cannot encrypt in place.
Click to expand...
Click to collapse
Because of the "Not a valid ext4 superblock" error, I tried changing the file system to ext4. When I boot after changing the data partition to ext4, the phone enters a boot loop. It boots up to an error that says "encryption unsuccessful" and the only choice is to reset the phone. I reset the phone and it boots back to the same error. I've formatted cache, system, data and sdcard, reinstalled both ROM and recovery and still I boot back up into this error message even though I am not presently trying to encrypt.
I read about a problem which requires the data partition to be reduced in size by at least 16KB, so I reduced it by about 4MB. The data partition was 27606912 blocks, and I reduced the partition to 27606000 blocks. However, this had no affect.
I have changed the partition back to f2fs because at least the phone boots using this file system without entering the "encryption unsuccessful" loop.
I have tried multiple recoveries in case that was the problem. I've tried CWM, the recovery for CM 12.1, and the most recent TWRP. I get the same problem in each of these.
I am most baffled about the boot loop after formatting the partitions in ext4 then installing a fresh ROM. Apparently my attempt to encrypt is remembered somewhere other than system, data, cache, or sdcard?
I considered flashing back to factory, however, I do not have the files, the links I've found on xda are broken, and I am waiting on Motorola to provide me access to the stock firmware - I requested it tonight though.
I appreciate any assistance that can be offered. Thank you.
I found the factory firmware and I attempted following the directions for a factory restore:
$ fastboot flash partition gpt.bin
$ fastboot flash motoboot motoboot.img
$ fastboot reboot-bootloader
$ fastboot flash logo logo.bin
$ fastboot flash boot boot.img
$ fastboot flash recovery recovery.img
$ fastboot flash system system.img
$ fastboot flash modem NON-HLOS.bin
$ fastboot erase modemst1
$ fastboot erase modemst2
$ fastboot flash fsg fsg.mbn
$ fastboot erase userdata
$ fastboot erase cache
$ fastboot reboot
Click to expand...
Click to collapse
However, the system.img failed. So, I reflashed recovery to TWRP and found that I did not have a system, data, cache or sdcard partition. I reflashed recovery to CWM because it has a custom format option and I formatted data, cache, system and sdcard using ext4, then I reflashed recovery to TWRP and because I am able to transfer files using TWRP. I transferred the CM 12.1 and gapps images, flashed them both, then rebooted.
After all of that, I still booted up into an "encryption failed" screen!
I then went back into TWRP, changed the data partition to f2fs, then I was able to boot into the new CM 12.1. So, the exact same problem exists: using f2fs, I am unable to encrypt the phone. Using ext4, I am stuck in an "encryption failed" loop.
I'm giving this thread a bump in hopes someone can share a solution with me as I am still having the same problem.
I'm on Verizon Developer Edition, but I had a similar problem after the Lolipop update. I just got it working. I had to flash the moto recovery back and format data and cache through there. Then I could encrypt. I'm gonna try to restore a backup from TWRP onto my encrypted data partition now.
I used the recovery from 47-vzw_xt1060_444-kxa2112-l126_cfc_1ff (google the file I can't post links). I'm not sure if its totally perfect with lolipop, but it formatted my data to work with encryption (ext4).
Same issue here on Moto X (ghost) with cm-12.1-20151007-SNAPSHOT-YOG4PAO332 and cm-12.1-20151105-NIGHTLY.
I could get rid of the message
E/Cryptfs ( 242): Orig filesystem overlaps crypto footer region. Cannot encrypt in place
Click to expand...
Click to collapse
by applying the update from this thread, but the other error messages still remain and I cannot encrypt my device..

Nook HD+ "magically" went from CM11 to stock?

I just had the strangest thing happen. I'm absolutely mystified as to how this could have happened.
My son turns on his Nook HD+ today after the battery had died yesterday or the day before. This tablet was converted initially to CM12.1 then later to CM11 to get better performance. It has been running fine for several months since going to CM11. So anyway, he turned it on and mentioned that it was loading the Nook software, not Cyanogenmod. I take a look and sure enough - no more Cyanoboot or anything like that, it just boots into a fresh factory image Nook image. I have connected it to a PC and the internal memory has been wiped; there is nothing there but the stock Nook software; no trace of all the games and such that were installed. Even the recovery image is stock again. Meanwhile, the 32gb SDHC card is just fine.
We've got three other Nooks (two HDs, two HD+s) in the house, all of them running CM11, so I am reasonably familiar with their usual behavior, but this really makes no sense. They all have CM installed in the internal memory, not the SD card. (I would suspect that especially because I am fighting the usual battle of trying to get the damn thing to boot off the SD card to install TWRP.) I just can't imagine where this came from - shouldn't all the stock software been destroyed when CM went in? How did it get back? It is really weird, and really annoying as now I have to go through the triple annoyance of reinstalling the recovery and CM, reinstalling all the apps (there is a Titanium Backup but it's pretty old now), and worst of all, telling my son that his game progress is gone! Woe is me.
The factory image of the original Nook software, used for restoring the Nook, is still there in the factory partition. At least it is on my Nook HD+ w/ CM11.
If the device attempted boots that failed due to the low battery, and if the "eight failed boots" logic in the original B&N boot sequence is still there, that would explain it perfectly. On my CM'ed Nook, the screen flashes the Nook logo briefly on every boot, and then switches to CM11.
DeanGibson said:
The factory image of the original Nook software, used for restoring the Nook, is still there in the factory partition. At least it is on my Nook HD+ w/ CM11.
If the device attempted boots that failed due to the low battery, and if the "eight failed boots" logic in the original B&N boot sequence is still there, that would explain it perfectly. On my CM'ed Nook, the screen flashes the Nook logo briefly on every boot, and then switches to CM11.
Click to expand...
Click to collapse
The "8 failed boots" sequence will trigger the Nook to boot into a recovery program, and if the recovery program is still the stock recovery (not been replaced by a custom recovery -- either CWM or TWRP), then the recovery program will in turn kick in the factory restore/reset (using the backup copy of the stock ROM and device-specific data stored in the /factory partition).
To avoid this type of accidental reverting to stock ROM, just replace the stock recovery by flashing a EMMC-based CWM (or TWRP) recovery zip file -- e.g., verygreen's "ovation recovery image (CWM)" referenced in his post http://forum.xda-developers.com/showpost.php?p=49192422&postcount=1.
Conversely, to return to stock ROM from a CM ROM, just replace the custom recovery by re-flashing the stock recovery and then manually simulate the "8 failed boots" sequence.
digixmax said:
... Conversely, to return to stock ROM from a CM ROM, just replace the custom recovery by re-flashing the stock recovery and then manually simulate the "8 failed boots" sequence.
Click to expand...
Click to collapse
Here's my HD+ partition table before installing CM11:
Code:
Found valid GPT with protective MBR; using GPT
Disk /dev/block/mmcblk0: 30535680 sectors, 2622M
Logical sector size: 512
Disk identifier (GUID): a15726b1-3718-4d84-b698-c79f2d8a56e9
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30535646
Number Start (sector) End (sector) Size Code Name
1 256 511 128K 0700 xloader
2 512 1023 256K 0700 bootloader
3 1024 31743 15.0M 0700 recovery
4 32768 65535 16.0M 0700 boot
5 65536 163839 48.0M 0700 rom
6 163840 262143 48.0M 0700 bootdata
7 262144 1179647 448M 0700 factory
8 1179648 2555903 672M 0700 system
9 2555904 3506175 464M 0700 cache
10 3506176 30507007 12.8G 0700 userdata
Before installing CM11, I did a "dd" backup of the partition table and each partition. Unless installing a custom recovery was part of the CM11 install (I don't recall, but I don't think so), then I take it that all I have to do to revert to stock B&N load (say, to sell the device to someone else), is to just do the 8-failed-boots sequence, is that correct? Further, if I had replaced the recovery partition, all I should have to do is to just restore that, and then proceed as above, correct? I attempted to mount the recovery partition as either vfat or ext2-4 in order to examine the recovery partition's contents, but those mount types didn't work.
I've been thinking about how I'd restore it, if I decided to sell it. Although it's more likely that a buyer might want CM11 on it. It's even more likely that I'll keep it until it dies; it's my only rooted Android platform, and thus useful for experimentation.
DeanGibson said:
Here's my HD+ partition table before installing CM11:
...
Before installing CM11, I did a "dd" backup of the partition table and each partition. Unless installing a custom recovery was part of the CM11 install (I don't recall, but I don't think so), then I take it that all I have to do to revert to stock B&N load (say, to sell the device to someone else), is to just do the 8-failed-boots sequence, is that correct?
Click to expand...
Click to collapse
Yes, that's correct.
Further, if I had replaced the recovery partition, all I should have to do is to just restore that, and then proceed as above, correct?
Click to expand...
Click to collapse
Yes.
I attempted to mount the recovery partition as either vfat or ext2-4 in order to examine the recovery partition's contents, but those mount types didn't work.
I've been thinking about how I'd restore it, if I decided to sell it. Although it's more likely that a buyer might want CM11 on it. It's even more likely that I'll keep it until it dies; it's my only rooted Android platform, and thus useful for experimentation.
Click to expand...
Click to collapse
I think your partition-level backup via dd is most useful if/when your EMMC partition structure ever gets messed up.
The easier (and somewhat less risky) way to revert to factory-fresh stock from full CM is to re-flash the stock recovery and stock ROM zip files provided by leapinlar at http://forum.xda-developers.com/showthread.php?t=2062613 (item #6).
In my case, I had also made a SD backup of the factory-fresh stock ROM /system & /data (using CWM recovery), which I can use (and have used several times) to go back to stock, but I'd still have to re-flash stock recovery for completeness in stock-restore.
Well, it's weird since if I would normally expect to go back to completely stock would be the hardest thing, and boom, there it was!
The Nook most definitely had TWRP on it. At least, I'm 99% sure it did. I can't imagine that it didn't, since I was futzing around with different ROMs trying to get better performance (as I said, 11 definitely seemed to run a lot better than 12.1) - so I'm well used to booting into recovery mode.
I hadn't heard of the 8-failed-boots thing before - that seems odd but I suppose it's not impossible that it failed to boot several times due to low battery or whatnot.

Categories

Resources