[Q] To enlarge the data partition - Galaxy S II Q&A, Help & Troubleshooting

It's a bit long since I had done some research and tries on it ...
Background:
I found that the /data partition (thus /dev/block/mmcblk0p10) is set to 2GB originally, but I want it enlarged to 5GB for some personal reason.
Tries:
First, I did some research on PIT file supplied when flashing ROMs via Odin, the "u1_02_20110310_emmc_EXT4.pit" contains the following entries:
DATAFS 02 0B 01 154000 400000 data.img
UMS 02 0C 02 554000 1704000
where the start sector position and partition length in sectors of corresponding partition are recorded, so I made a custom PIT with the following entries:
DATAFS 02 0B 01 154000 A00000 data.img
UMS 02 0C 02 B54000 1104000
there is only difference on the size of /data partition and the start position of the /sdcard partition, thus, a trade between those two partitions, it won't affect other partitions.
I can use the custom PIT file flashing ROMs via Odin without errors, but the /data partition remains 2GB after I check it in an adb terminal, so, I think the PIT file is just a mapping info file for Odin and other flashing to retrieve the correct position where kernel or modem or boot should be flash to, Odin did not really partition the internal mmc storage according to the PIT file.
So further, I tried to use "parted" to modify the internal mmc's partition table (it's of GPT format, so "fdisk" would not work), I'm managed to delete the old DATAFS and UMS partition and create new ones in the recovery mode, then I use /system/bin/make_ext4fs to create ext4 filesystem on new DATAFS, it is really 5GB now, and I think I succeed!
When I reboot into normal mode, no error reported, and I'm glad to see the /data partition is indeed enlarged to 5GB. So, I decided to flash a new ROM via Odin.
I use the custom PIT file with exactly the correct mapping according to the modified partition table in Odin when I flashed a new ROM, the flash progress is successful, but after the device rebooted, it issues an error message on "could not mount /data partition" and refused to complete the ROM install progress.
Then I enter the recovery mode again and do wipe to the /data partition, after that, I found the /data partition goes back to 2GB ...
Now, can anyone help me on this? or is there a more stable method to enlarge the /data partition on i9100?
Thanks,
ecore

ecore said:
It's a bit long since I had done some research and tries on it ...
Background:
I found that the /data partition (thus /dev/block/mmcblk0p10) is set to 2GB originally, but I want it enlarged to 5GB for some personal reason.
Tries:
First, I did some research on PIT file supplied when flashing ROMs via Odin, the "u1_02_20110310_emmc_EXT4.pit" contains the following entries:
DATAFS 02 0B 01 154000 400000 data.img
UMS 02 0C 02 554000 1704000
where the start sector position and partition length in sectors of corresponding partition are recorded, so I made a custom PIT with the following entries:
DATAFS 02 0B 01 154000 A00000 data.img
UMS 02 0C 02 B54000 1104000
there is only difference on the size of /data partition and the start position of the /sdcard partition, thus, a trade between those two partitions, it won't affect other partitions.
I can use the custom PIT file flashing ROMs via Odin without errors, but the /data partition remains 2GB after I check it in an adb terminal, so, I think the PIT file is just a mapping info file for Odin and other flashing to retrieve the correct position where kernel or modem or boot should be flash to, Odin did not really partition the internal mmc storage according to the PIT file.
So further, I tried to use "parted" to modify the internal mmc's partition table (it's of GPT format, so "fdisk" would not work), I'm managed to delete the old DATAFS and UMS partition and create new ones in the recovery mode, then I use /system/bin/make_ext4fs to create ext4 filesystem on new DATAFS, it is really 5GB now, and I think I succeed!
When I reboot into normal mode, no error reported, and I'm glad to see the /data partition is indeed enlarged to 5GB. So, I decided to flash a new ROM via Odin.
I use the custom PIT file with exactly the correct mapping according to the modified partition table in Odin when I flashed a new ROM, the flash progress is successful, but after the device rebooted, it issues an error message on "could not mount /data partition" and refused to complete the ROM install progress.
Then I enter the recovery mode again and do wipe to the /data partition, after that, I found the /data partition goes back to 2GB ...
Now, can anyone help me on this? or is there a more stable method to enlarge the /data partition on i9100?
Thanks,
ecore
Click to expand...
Click to collapse
Are you sure Odin uses the pit file during flash? It seems to be able to flash without pit files, so I'm not sure it really uses it...
Did you try to flash a custom or a stock ROM? Maybe some ROMs are built in order to only accept 2GB /data partition (or there are some inherent size limit due to the filesystem?).
Have you tried flashing via Heimdall (after creating the /data you want and using your custom pit file)? Heimdall can also download the pit file from your device so maybe you can get a "proper" custom pit file after your various re-partitioning...
Link to Heimdall:
http://forum.xda-developers.com/showthread.php?t=755265
Note that we know for a fact that Heimdall indeed uses the pit file (even when not repartioning). So if your custom pit file does not correspond to the partition of the your device after your modification of /data, I think you'll have some kind of message, hopefully with some detailed information.

Related

Partitions messed up [SOLVED]

this is my current state:
Model: MMC MAG8DE (sd/mmc)
Disk /dev/block/mmcblk0: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 512B 15.7GB 15.7GB primary fat32 lba
2 15.8GB 16.0GB 247MB primary fat32 lba
As you can see I am left with only 247MB for apps, where only 60MB of them I can actually use.
It won't resize partition 1 because i am unable to unmount /sdcard in recovery (not sure this what causes the problem) I am able to unmount everything else. "adb remount" won't unmount it..
Can't remember how I got to this. Guess It's a result of a not so successful unbrick. I am trying to fix it for 2 days and starting to give up.
Help would be greatly appreciated!!
Anyone? should I throw it to garbage?
Your ext sd card I am assuming. Try taking it out and do a complete reformat on the computer then reinstall and then reformat in phone see if that resolves
It's the phone storage, unfortunately
Have you used odin, to stock jfd, with partition checked in odin?
I did, but it didn't repartition it. I think it has something to do with odin unable to fully access the phone. Because after flashing to jfd, my apps from 2.2 where still there.
I noticed that after flashing to jfd, after the vibrant logo it says "error wiping data"
btw - i tried flashing froyo with a voodoo kernel but it won't convert to ext4, in the voodoo cotrol app it says "lagfix RFS only"
edit: SOLVED! hooray!

[Q] Can't mount :O

Hi Forum!,
My player is really doomed i think.
Hope some one know a fix for this.
I tried different (stock)roms and bootloaders.
With no luck, it only boots up into recovery mode. (CWM-Based Recovery v5.0.2.7)
With these errors:
Code:
E: Can't mount /cache/recovery/command
E: Can't mount /cache/recovery/log
E: Can't open /cache/recovery/log
E: Can't mount /cache/recovery/last_log
E: Can't open /cache/recovery/last_log
When i try to view the partition table its saying that there is no table.
Code:
~ # fdisk /dev/block/mmcblk0 -l
fdisk /dev/block/mmcblk0 -l
Disk /dev/block/mmcblk0: 7944 MB, 7944011776 bytes
4 heads, 16 sectors/track, 242432 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
And when i try to open it, its creating a standard dos table.
Code:
fdisk /dev/block/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT di
sklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.
The number of cylinders for this disk is set to 242432.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
But when i try to create a partition i can only make 4 Partitions.
So i can't create enough partitions to Flash the device properly.
Code:
Command (m for help): n
n
Command action
e extended
p primary partition (1-4)
p
p
Partition number (1-4):
Does someone know how to fix this? or perhaps help me the right way.
Thanks
Interesting, I had the exact same problem with the errors on recovery menu about the cache. I read wiping data and cache sometimes fixes it, but nothing worked. I flashed a backup rom, but nothing changed. I ended up sending it into Samsung for repair; well worth the 3 bucks for shipping!
sjefket said:
...
p primary partition (1-4)
Click to expand...
Click to collapse
I haven't had this problem before but it seems, from the output that you posted, that you may be limited to 4 primary partitions. You may be able to have several more extended partitions. It's been awhile since I've done any linux partitioning but it seems like that how I always did it. You have a primary partition that is chopped up by extended partitions...
Thanks for the quick response guys!
I bought the SGP here in a store and they say that this is no warranty becouse its a update mistake .
Also contacted Samsung, and there telling me that the device is from outside Europe and they wont replace it.
I'm a little bit further now.. Because i chose extended partition in the options.. Then it is possible to make more than 4 partitions! (thanks! Meticulus for the good answer/tip)
So i manually created a good partition table and flashed the device.. (without re-partition offcourse)
Still no luck
I look at Fdisk.. and unfortunately the table is screwed up.
Hmm...
You know you haven't exactly told us which player you have? You know the 4.0 and 5.0 are very different in their partitioning...
You are right! sorry!
I have the Galaxy Wifi 5.0 8 GB YP-G70CB/XEH
Thanks for asking.
Well, you've got an international 5.0 and I know that you've seen this already but I would suggest that you have a look at rumirand's post(3 one down) here: http://forum.xda-developers.com/showthread.php?t=1468213
Remember that "w" writes changes (I think).
I had the same problem, I think it was caused by flashing something while having repartition checked, even if it was the same pit file I just flashed. I had to reflash everything. You might want to look in your .tar.md5 if those files are included:
SBL
BOOT
CACHE
DBDATAFS
PARAM
zimage
factoryfs
Yes that's right, I used that post as an example for my partition table.
And i write it to my player with W.
As a test.. i turn it off and on to see it will save after a Reboot and it did
So the eMMC is not fried?
Ben456, thanks for replying!
I have a rom with everything in it, but when i use that rom.. it only show's the samsung logo and it would not start Recovery.
Do you, or some one could post me a link with a Custom or Stock rom that has everything in it? I would really appreciate it
I have search the forum off course. And tried differend roms. But didn't found a right one (with more than zimage factoryfs) that is for the International.
I want to try to copy the files manually to each partition.
But i dont know which file belongs to which partition.
So odin don't mess up things
Maybe anyone knows this? or have a other suggestion?
Thanks!
Me too
Ben456 said:
I had the same problem, I think it was caused by flashing something while having repartition checked, even if it was the same pit file I just flashed. I had to reflash everything. You might want to look in your .tar.md5 if those files are included:
SBL
BOOT
CACHE
DBDATAFS
PARAM
zimage
factoryfs
Click to expand...
Click to collapse
I think I might be having the problem too. Do you think a factxor image will work? Or I need to take specialized steps.

Format EFS to ext4

I have a galaxy s2 gt-i9100. My original efs partition was ext4 filesystem, but due to corruption, I reformatted it using SII_Repair. Unfortunately, the tool formatted it to ext2 instead of the original ext4. I have tried to use parted to reformat it, but it only support up to ext2. Are there other ways? How does clockworkmod reformat the other partition to ext4? what is the name of the tool? I can use terminal to reformat efs if only I know the utility name that clockworkmod uses to reformat other system partitions.
Try to flash older 3/4 file firmware with proper PIT file. It will fix partitions and wipe phone. After that format your internal memory card, otherwise it could be still broken
mar10o said:
Try to flash older 3/4 file firmware with proper PIT file. It will fix partitions and wipe phone. After that format your internal memory card, otherwise it could be still broken
Click to expand...
Click to collapse
I have tried flashing PIT which usually reformat everything, but it didn't work for efs partition for some reasons. However, I got it reformatted to ext4 by flashing an efs.img I got from somewhere.

[Q] Format UMS partition back to FAT32

I started playing with my Galaxy S2 I9100 recently after upgrading to a Galaxy S4 I9505 and trying custom ROMs. As the system partition wasn't big enough to install a ROM and a full Gapps package, I thought I'd try to change the partition table and increase the size of the FACTORYFS and DATAFS partitions at the same time reducing the size of the UMS partition.
My first attempt was to use parted through an ADB bridge with the phone in CWM recovery and doing so managed to get the phone working with the exception of the camera which immediately threw up the error 'Unfortunately camera has stopped working.' The Gallery app also doesn't work saying there is no storage present. When using the print function of parted, there was a msftres flag indicated for the FAT32 formatted UMS partition.
I have since used PITmagic to set FACTORYFS to 1GB and DATAFS to 4GB but interestingly when using the print function in parted, DATAFS and UMS had nothing listed under filesystem. I was able to get the DATAFS partition to ext4 using the wipe data function in CWM recovery but am unable to get the UMS partition formatted to FAT32. I have tried flashing busybox to use the mkdosfs or mkfs.vfat commands but these are unable to format a partition of the size that my UMS currently is set at.
Does anyone know of a way to reformat the internal UMS partition back to FAT32?
I eventually got this sorted but it seemed like a fairly complicated process. Firstly I used PITmagic to prepare a PIT file which I flashed using Odin. All the necessary files and instructions por PIT Magic can be found in the links below:
http://forum.xda-developers.com/gal...es/mod-partition-internal-memory-app-t2538947
http://forum.xda-developers.com/showthread.php?t=1916936
By booting into recovery (either CWM or TWRP will work for this) I was able to format some of the partitions but not all. I then used parted which is included in both CWM or TWRP to print out the partition table. Where a partition was not what it should be I removed it then recreated it using the guide I found for a kindle fire in the link below:
http://forum.xda-developers.com/showthread.php?t=1388996
Note that ext4 partitions cant be created in parted so I created them as ext2 partitions and upgraded them as in the guide. The big problem with the FAT32 partition for UMS is that it gets the msftres flag set owing to a bug in parted. However by flashing the same PIT file as before through odin this can be removed.
Now my camera works as the UMS partition mounts properly.

/system partition unmountable after flashing rom?

I have a ZTE Axon 7 (A2017U) and I'm trying to install a stock rom (A2017UV1.1.0B35). I currently have TWRP installed and an unlocked bootloader. I can access the device via fastboot and TWRP recovery mode, but otherwise it will not boot.
I'm stuck in a loop:
If I install my rom via TWRP, when I reboot the phone the /system partition is never mounted. I can see "Failed to mount '/system' (Invalid argument)" written in the log
If I view the /system partition details on TWRP's "Wipe->Advanced wipe->Repair or change file system" screen, the partition is listed as "Present: Yes, Removable: No, Size: 0MB, Used: 0MB, Free: 0MB, Backup size: 0MB
If I format the /system partition using "Wipe" function, the "Formatting system using make_ext4fs" operation succeeds and partition seems to be correctly formatted using ext4, and is listed as "Present: Yes, Removable: No, Size: 5455MB, Used: 10MB, Free: 5444MB, Backup size: 10MB
I'm able to access the partition via the terminal, and if I write a text file to it and reboot the device, I'm able to read it back... It seems the partition is working correctly.
I attempt to install the rom again using TWRP's "Install->Install zip" option, and after ~10 minutes it states that installation was completed successfully.
I reboot the device and the OS does not load. If I access TWRP, I see the /system partition is not mounted and the cycle continues
I've also tried installing other roms (e.g. Lineage OS), but they all fail assert checks, even thought I'm 100% positive they're for the correct device.
I'm tearing my hair out here. I'm a programmer by day and I'm fairly experienced with Unix, but admittedly I don't have much experience working with Android. There's a good chance I'm missing something.
Any idea what's going on, or what to try next? Is there any other information I can provide that might help me troubleshoot the problem?
I don't know of this will help, but I had a similar issue with a Samsung phone once. What had happened is when I flashed the new ROM the .dat or .img file was smaller than the original partition and it shrunk the system partition. I was lucky and I had previously dumped a copy of my system partition with terminal and was able to put it back.
When the partition was shrunk it wouldn't install any other ROM's either. If you could get another user with your same device to dump their system into an .img file we might be able to fix it with dd commands.
Sent from my LG-Q710AL using Tapatalk

Categories

Resources