[j500nlte] Can you change PIT without data loss? - Samsung Galaxy J5 Questions & Answers

Can you re-partition J500FN without data loss and/or damaging eMMC? How to do it properly?
What I need to do:
- extend /data
- shrink /system and /hidden
What I tried:
- using REPIT (errors running from TWRP, nor /tmp)
- manually using parted tool (doesn't support ext4)
What I have:
- Odin
- PIT Magic
- official firmware J500FNXXS1BQG2
- PIT file extracted from firmware
- full eMMC backup as .img
Another idea - will it work?
- shrink backed up /system with resize2fs (this will work - tried on /hidden)
- modify PIT file with PIT Magic
- flash it all with ODIN
PIT Magic shows that PIT is in partition #29. This partition is not visible in parted, it's free space there. Any other way to modify it other than Odin?

Related

[Q] flash factoryfs.rfs as ext4

I was wondering if it is possible to format /system partition in ext4/ext2 and then make an image using dd, which could be flashed through odin.

[Q] Questions regarding the two NST rooted with the same process

I rooted two nooks, and made tar backups of their partitions (I also got the dd image just in case). Out of curiosity, and with the goal of keeping minimal backup and increasing the partition for side-loaded contents to maximum, I tried to compare the contents of each partition. Since I followed the same process for rooting (Touch-Formatter v2, 1.2.1 update, NookManager, NTGAppsAttack - but before booting the Nook I got the backup), I guessed quite a lot of them are the same, and found some interesting results.
1. Boot partition is nearly the same except uRamdisk. I inspected the contents of the two uRamdisk files using bootutil by Renate, and they are identical.
-> Why are they different, and can one replace the other?
2. As we all know, rom partitions are different, but it looks only a few of them can meaningfully affect the operation. Anyway, it's small and I decided to leave them untouched and keep two separate copies.
-> What is the BCB file by the way? It just has zeroes inside. Is it automatically created if not there?
-> Some files in the devconf directory seem to be modified during the normal process or firmware update, notably BootCnt (four zero bytes), Bq275020Dffs (12 in the rombackup.zip, 13 after 1.2.1 update). What are these? Any idea?
3. The factory partition, I want to bust it (empty it up and resize it to the minimum), and let me know if I'm on a dangerous path. The idea is that I don't need rombackup.zip because I can revive the rom partition with my own tar backup if something bad happens, and it's out of date anyway after 1.2.1 update (some files in the rom partition are modified). Also, with Touch-Formatter and CWM, I wouldn't need the factory.zip file.
-> What are the files in the "touch" directory? One of my nook has them, but the other doesn't. Looking at the data inside they must be related to the display or touch screen. Maybe byproduct of calibration?
-> Can I use 1.2.1 update file with CWM instead of using Touch-Formatter, bringing it to a new fresh 1.2.1 Nook? According to this post, it seems possible.
4. The system partitions are identical, as expected. but with CWM recovery, we wouldn't need a backup of it, right?
5. The cache partition is way too big. I know the firmware update uses this space (when I resized it to something like 64MB, 1.2.1 update didn't work. I needed to increase it to something like 128MB to make it work). However, for normal operation, we surely don't need it that big.
-> How small can it be? I know it depends on individual's usage patterns... but in my case, I mostly use Nook for reading side-loaded contents. I've gone down to 32MB, but I guess that's still big.
-> Do we really need the cache partition? Can we just symlink it to somewhere in the data partition?
Out of curiosity, I just deleted BCB and BootCnt in the rom partition, and rebooted. First it said "Install Failed", a screen I have never seen before on Nook. So I looked into the rom partition and found that BCB file is recreated, but not BootCnt. On the subsequent boot, it said "Installing Rom", and then quickly rebooted. Now it's back to work. So, I guess these two files are essential for normal operation. Again, this time I deleted all files in the factory partition and also deleted BootCnt. Now, it tries to do the "Installing Rom" thing, but fell back to "Install Failed" screen. I opened up the rom partition again and I saw only BCB and BootCnt files, and none else. Nook surely formatted the rom partition first before trying to recreate it.
So I wonderfully bricked my Nook, and thought this is a good time to test if the rom partition backup works. I mounted the rom partition, untarred the backup, and rebooted. There we go, the Bronte Sisters are back. So the conclusion is that
1. When the BCB file's missing, it's simply recreated after a failed boot.
2. When the BootCnt file's missing, Nook thinks the rom partition is corrupted and tries to recreate it using rombackup.zip in the factory partition. I think this may have some side effects because firmware updates only change the files in the rom partition, leaving rombackup.zip untouched. So you will go back to the old rom partition after the built-in rom recovery.
3. The best rom recovery, I think, is using your manual backup of the rom partition. And maybe updating the rombackup.zip with a new one too?
BootCnt is a 32 bit little-endian count of the number of failed boots.
Once it hits eight your Nook will boot into the recovery image uRecImg, uRecRam.
You could also echo about anything to that file to make it arithmetically greater than 8.
Code:
echo 000 > /rom/devconf/BootCnt
That is 0x0a303030 > 8
Normally this is a B&N thing that asks you about factory restore.
If you replaced those two files it could be Clockwork Mod Recovery.

Resizing /System

Hi, I just wanted do know if there's a way I can change the size of the /system becuase it uses almost half of the phone's storage.
Apparently, only the I9500 can resize its partitions, and that can only be done through use of a PIT file. However, in my opinion it's not worth doing, and on all the Qualcomm devices, impossible to do.
Hi,
Just the addition. It's impossible to resize partition. But, the only thing to know: Samsung reserves 1/8 of total storage (2 from 16 GB ) for cache partition. It's unnecessary for most people because cache partition in most devices are 200-500 MBs.
I9500 devices that shipped in all regions and in China are different. You can't use full Chinese firmware in International devices and vice versa without a PIT file (International/Chinese). Installing Chinese PIT might reserve more space for user data (11.8 GB compared to 8.9 GB in International one), but it has several disadvantages.
First, is you can't install any custom ROM that is a block-build based installer (by patching system partition). It instantly fails because mount points of International PIT and Chinese PIT are completely different.
Second, if you do a full Chinese firmware install with ODIN on International devices and you don't remove sboot.bin from the archive and re-pack it, you'll end yourself with Chinese bootloader that pretty hard to be 'vanished' in standard way of installing firmware.
Sent from my ASUS_Z00AD

Partition Mapping (SM-S550TL)

Has anyone been able to map the partitions for this variant? How to read Samsung PIT files?
I have included the variant's PIT down below. Preferably, which block is for the System partition?
HitByAZinger said:
Has anyone been able to map the partitions for this variant? How to read Samsung PIT files?
I have included the variant's PIT down below. Preferably, which block is for the System partition?
Click to expand...
Click to collapse
Have you looked at PIT magic?
https://forum.xda-developers.com/showthread.php?p=32297786#post32297786

J5 data recovery

Hi
I have a dead (not responding nor charging) J510FN. There was no encryption activated on the device
FOr the purpose of data recovery from the internal memory I got hold on a eMMC reader. I could recover something like 27 partitions from it, including the userdata partition (around 11,5GB)
Looking with a hex editor through the file I can see its basically full with data. But I didn't have any success yet in recovering any files. I tried to mount the .bin file and run a recovery program (ext4) through it, but couldnt get any files at all.
Someone can give me a hand on this?

Categories

Resources