yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] [Ramad]:
I doubt that the guys at samfirmware do know much about when to use a pit file. They write that if the firmware is a 3 file firmware then 512.pit is to be used, but if the firmware is a 1 file firmware then 803.pit is to be used without checking re-partition...that is not correct at all.

A pit file should only be used when re-partitioning is needed, the device already have a copy of the previously used pit file stored at the second sector at the ROM(please see ROM partitions at post #1), when re-partition is not checked then Odin retrieves the information from that sector and flashes the device according to it, even if you did choose a different pit file than the one stored at the ROM.

All the testing was performed on stock firmware with RFS, and the idea is to provide information on pit files and the device behaver with no changes. If I would be using a different file-system then that will be investigating a moded firmware, although I can confirm that using a lagfix does retrieve the missing space, and that is related to how a lagfix works, by copying the files on /system to the internal SD-card, formatting /system and then copying the files back, when a lagfix formats /system, then it will be formatted as a partition not as a space, this is why whole system partition will be usable after that.

I did not mention DXJPE because it's an exception, it will only except 513.pit and it will make the whole partition usable with more than 39MB of free space, all of that is on stock RFS. When doing the math then only around 258MB of /system is used by data copied to it during installation...so saying that DXJPE is a big firmware compared to other firmwares is not the case here. You could be pretty much right about the usable size of /system partition is recorded in the ROM.

This is what we don't know...I hope so, releasing and using 803.pit or 513.pit can have a meaning then.

You will never need to use a pit file while flashing using Odin unless you want to re-partition...the pit file is already there for Odin to read from the ROM.
[Galaxy S I9000 Android Development] g00ndu:
Thanks, [Ramad] for the explanation. Glad that we know a lot more now. :)

Sent from my GT-I9000
[Galaxy S I9000 Android Development] pawitp:
The thing is, when you're flashing a ROM, you're flashing a file system. And when it comes to size, there are 2 sizes — partition size and file system size. The file system size cannot be larger than the partition size but can be (but not usually) smaller than the file system size. The file system size is determined to be equal to the partition size where that file system was created. What's happening here is that the file system of most ROMs are created against 512.pit and thus is smaller than the partition size when flashed on 513.pit. The file system does not realize that it is on a partition larger than when it was created and thus the additional space cannot be used.

What's happening when a lagfix is applied is that the files of /system are copied over to the SD card and a new file system is created which naturally matches the size of the partition, thus the increased usable space. The files of /system are then copied back to the new partition.

I still believe that the DX-series is larger than most other ROMs. When you said that "only around 258MB of /system is used by data copied to it during installation", did you include the size of the CSC which is copied to /system during first boot in recovery after a firmware flash?
[Galaxy S I9000 Android Development] [Ramad]:
Sorry about what I wrote earlier, that was misleading as I could pretty much have been using a deodexed firmware, 258MB cannot be right when the the stock factoryfs.rfs alone is 254MB in size, they say that a picture do say a thousand words...

In theory 803.pit with 287MB should be enough but DXJPE can't be installed using 803.pit file, /system in RFS format and the CSC files are installed.
[Galaxy S I9000 Android Development] pawitp:
You can't flash DXJPE with 803.pit because when the file system size is larger than the partition size, ****s happen.
[Galaxy S I9000 Android Development] [Ramad]:
What do you mean?

803.pit file system partition size is 287.5MB, DXJPE system data size including CSC files is 276.2MB, how is 276.2 bigger than 287.5MB? I guess that the pit thing is a bit confusing.. :)
[Galaxy S I9000 Android Development] pawitp:
When you flash /system, you're flashing factoryfs.rfs which contains a file system. In the header of that file, the amount of usable space is recorded (which I call file system size). If the recorded amount of usable space is less that the partition size, you will see unusable space. However, if the recorded amount of usable space is more than the partition size, the system will either error out or, more dangerously, invade the data of the next partition when a space beyond the partition size (but within the file system size) is requested.
[Galaxy S I9000 Android Development] :
your phone has been partionned out of the box. you donot need to do it again except if you want to completly format your phone. and here you can pick a pit file do tell how you will format your phone.
[Galaxy S I9000 Android Development] DamianGto:
Funny tread.

OP still don't understand how pit files work and how the files is he is flashing.

The test he did just show the lack of knowledge.

We did make a tread about pit file and how they work. That's old news now.

OP don't seem to understand how the file system works and people in has pointed it out for him.

So some real facts.

Pit file is a file that tell how the partitions shall be. Pit=Partition Information Table.

On that you put a file system.

When you flash a firmware you basically flash premade file system image. These image has fixed file space.

When you for change the filesystem you use the whole size of the partition and put the files back. That's why you get more space after you change the file system. Also different file system do take different space for the information that's file system use. That's can free up more space or lower the space left on the partition.

**DamianGTO ultimate kernel v1.1 * 600Hz * 350MB RAM * OC/UV * 1200MHZ**
[Galaxy S I9000 Android Development] [Ramad]:
Your last post did not picture this but was talking about actual size and usable size. However, I find what you write now about factoryfs.rfs file headers more interesting.

This is what I think too after having changed all the files in DXJPE except factoryfs.rfs to see if any other file/image had an influence in making the whole /system partition space available, well that was not the case, as it appeared to me that factoryfs.rfs in the case of DXJPE was the only responsible factor for that.

We still can't say that what makes the changes is in factoryfs.rfs header is a fact until we find the area or the code-lines in factoryfs.rfs that proves it. Not that I disagree with you, because I do agree with you as I wrote earlier, but it is still only a theory until we have the proof. :)
[Galaxy S I9000 Android Development] cicciocant:
It isn't true. For me.

If you check re-partition then odin write the pit file in /dev/block/bml2 partition and use it for write size of partition in to device.

If you don't check re-partition then odin use pit file for write size of partition but it don't write the pit file in /dev/block/bml2 partition.

Sorry for my bad english.
[Galaxy S I9000 Android Development] [Ramad]:
What is not true?

Please flash a firmware without pit and without re-partition and tell me your results please, then tell me how Odin could do that when you did not choose any pit file...beside that tell me about this line and what it does mean when no pit has been chosen:

I have marked the lines for you...

Now flash a firmware with 512.pit while re-partitioning, go to Applications > Task Manager > Summary and check the size of Personal data which is /dbdata, it should be 127MB, then flash a firmware with 803.pit without re-partitioning and check Personal data....now tell me why is it still 127MB and according to what you did write then it should be 117MB?

I will be waiting for your results, please post them when you are done :)
[Galaxy S I9000 Android Development] tonymy01:
I have never used a pit file in my dozen or so flashes I have done with odin.

I can imagine the difference in partition size vs filesystem size is because the filesystems are pre-packed into rfs images that are simply "dd" to the partition when the firmware is upgraded/written to the phone. So the filesystem size is approx the rfs size. In the linux world, there are tools to add this "unused" partition space back to the filesystem (easy if it is at the end of the filesystem on the hdd), I wouldn't imagine it would be all that difficult to write a tool to add the unused space to an rfs partition..

I suppose there is larger system partition than needed so a phone can be upgraded to a more feature rich system (e.g 2.1 to 2.2) to allow for a bit more, while not having to rewrite the whole partition table and therefore trashing all the user data etc in the other partitions.
[Galaxy S I9000 Android Development] dakost:
Thanks for the explanation. Interesting.

So how does one find out what pit is his galaxy s on? Just checking the size of /dbdata?

I've never needed to repartition and use a pit file.
[Galaxy S I9000 Android Development] AllGamer:
this GUIDE is awesome, it should be in DEV section
[Galaxy S I9000 Android Development] shawn_pro:
Hey excellent post and findings pal. Finally the MYTH broken about PIT. Really appreciate your efforts
[Galaxy S I9000 Android Development] [Ramad]:
Thanks, this is not the first thread that tries to find out what pit files are or does, the credit in the first place goes to Richthofen, sztupy, RyanZA and some other members that contributed constructively in that thread, although I do take credit for the pictures :)

This has been mentioned earlier in this thread by our dear member franksames.

Not all the informations or partitions size are correct in the mentioned thread, but it's the first valuable effort by our dear members.

Looking at Personal data in Applications > Task Manager > Summary should be enough to find out the pit file the device is using. You might never need to use a pit file at all, unless the firmware requires that, so far only one firmware(DXJPE) did require that as fa as I know. :)
[Galaxy S I9000 Android Development] maciekwar:
this is the kind of stuff I like :) simple and clear answer, good post.

and interesting observation I made, I've never repartitioned my phone, only guys from tech support could do this, they debranded my phone... now I have darky 9.3

here is my partition info:

/ # busybox df -h

busybox df -h

Filesystem Size Used Available Use% Mounted on

tmpfs 169.6M 0 169.6M 0% /dev

df: /mnt/.lfs: Function not implemented

tmpfs 169.6M 0 169.6M 0% /mnt/asec

/dev/block/stl9 275.8M 258.8M 17.1M 94% /system

/dev/block/mmcblk0p2 1.9G 524.7M 1.4G 27% /data

/dev/block/stl10 127.2M 7.9M 119.3M 6% /dbdata

/dev/block/stl11 30.1M 8.0K 30.1M 0% /cache

/dev/block/stl3 5.9M 5.0M 936.0K 85% /efs

/dev/block/vold/179:1

5.8G 4.6G 1.2G 80% /mnt/sdcard

/dev/block/vold/179:9

5.7G 5.2G 525.3M 91% /mnt/sdcard/external_sd

/dev/block/vold/179:9

5.7G 5.2G 525.3M 91% /mnt/secure/asec

/ #

according to this, in my phone I have 4th pit file... because /system and /dbdata have different sizes then sizes set by three pits we all know?
[Galaxy S I9000 Android Development] unfnknblvbl:
Thank's a bunch for the informative post.

...is it possible to create our own .PIT files? I imagine that would be great for ROM developers, especially if it were possible to somehow write the plain old .IMG files to the phone in Odin.
[Galaxy S I9000 Android Development] dawabz94:
Thanks a lot for the explanation !

Was really helpful

I was wondering if /cache partition could be increased (new apps on the market can go to 50Mo)

I had dig a little and understood that /cache was always 30Mo whatever .pit is used

I feel it can not be resized; hope SGS2 will have that

Thanks again :)
[Galaxy S I9000 Android Development] DamianGto:
This is solved on a newest kernel.

I will also include this in my kernel.

It will just change were the market is saving the the files.

**DamianGTO ultimate kernel v1.2 * 600Hz * 345MB RAM * OC/UV * 1200MHZ**
[Galaxy S I9000 Android Development] intronauta:
Seems that samsungs solves this limitation in last froyo kernel using /data/cache ;)
[Galaxy S I9000 Android Development] phalanger:
Interesting post!

Thanks for taking the trouble to figure this out and sharing the knowledge
[Galaxy S I9000 Android Development] Landorin:
Thanks, as a flash noob I was wondering about pit files and the info in the sticky guide left some questions unanswered sadly.

However, there's something I still wonder: "why and in which case does one have to use a pit file when flashing?".

Maybe someone can answer that too. :D
[Galaxy S I9000 Android Development] ytt3r:
Very useful post, would you mind possibly posting this information in the other SGS subforums?
[Galaxy S I9000 Android Development] x86-Dark:
Thanks a lot [Ramad] ! :D

Now all my questions about .pit files have been answered!

Well Done!
[Galaxy S I9000 Android Development] Darkyy:
Hi Ramad,

A big thanks from me - was very informative! :)

Pressed thanks and rated thread 5 stars ;)
[Galaxy S I9000 Android Development] ph33lix:
Well written and very informative. Many thanks!
[Galaxy S I9000 Android Development] [Ramad]:
@maciekwar, unfnknblvbl, dawabz94, phalanger, ytt3r, x86-Dark, Darkyy, ph33lix

Thank you all guys...I hope that I did not forget anyone :)

Your device is using 512.pit, system partition can vary in size, I get the same usable system space as you with some firmwares(275.8MB), I had the one with 276.3MB installed so I went with it, had no desire to flash three more times. :) dbdata size on your device is 127MB, this is 512.pit. :)

You may very well post these informations in any sub-forum where the devices are using the same pit files as Galaxy S. These informations belongs to all XDA members, you may modify it also if that is needed for it to fit other pit files used on other devices.
[Galaxy S I9000 Android Development] intronauta:
HI [Ramad]

I think that to include http://xdaforums.com/showthread.php?t=816449 in the first post would be very interesting for tecnical purposes or to extend information ;)
[Galaxy S I9000 Android Development] somberi:
Thanks. Very informative... now I know the pit file mystery..
[Galaxy S I9000 Android Development] FadeFx:
Hi,

at first thanx Ramad for this well done info, keep up your good work...

and now to the point (sorry if already mentioned, did not want to read the whole thread...)

if the usable space always stays the same, i´d guess the pit file does only the allocation of space before flashing, and the final partition is just copyed over from the rom, so the size of the system image (factoryfs.rfs i think) does actually make the partition size. in that case the rommaker could change the usable size of the system partition if he delivers a rom for odin. right?
[Galaxy S I9000 Android Development] aoprea:
it's posible to edit pit file to increase partition size ?

to make /system , /data and /dbdata bigger ?
[Galaxy S I9000 Android Development] :
here is the source for creating custom pits, I created a log time ago last year

https://github.com/cmsgs/utilities/tree/master/pit-stuff
[Galaxy S I9000 Android Development] alcaholjunkie:
'nough said ^_^
[Galaxy S I9000 Android Development] laikram:
thanks,at last i undestand the pit,only need untestand all the rest of android sistem for know my galaxy.

Sorry for my bad english.

Esto tiene que sonar a indio casi seguro,ja ja ja.
[Galaxy S I9000 Android Development] aoprea:
coolya it's posible to create for us a pit 512 file with /system, /dbdata and /cache double as space ?

{ 0, 0, 0x16, 0x02, 0, 256, 2292, "", "FACTORYFS", "factoryfs.rfs"},

{ 0, 0, 0x17, 0x02, 0, 256, 1072, "", "DBDATAFS", "dbdata.rfs"},

{ 0, 0, 0x18, 0x02, 0, 256, 280, "", "CACHE", "cache.rfs"},
[Galaxy S I9000 Android Development] kasper_h:
System, cache and dbdata are on the ONENAND which is limited in size. So you can't increase the size of all three, only divide between them (like is shown by the OP for the different standards Samsung PIT files: they increase the size of /system, at the expense of /dbdata.

Sent from my galaxy using the xda app
[Galaxy S I9000 Android Development] :
simple answer No you have only 512MiB of OneNand.

In detail: the number is the number of units (unit 256KiB flash page) so you have 512MiB / 256KiB = 2048 Units the last 48 Pages are reserved for bad block mapping = 2000 usable units. Trading space from bootloaders, param and efs isn't a good idea. As the kernel is between those data you shouldn't touch them either because the addresses are concated. 2000 - (1 (PBL) + 1 (PIT) + 40 (EFS) + 5 (SBL) + 5 (SBL2) + 20 (param) + 30 (Kernel) + 30 (recovery) )= 2000 - 132 = 1868 Units = 478 208 KiB = 467 MiB space that you trade like you want.

But flashing a RFS image that is bigger than the target partition won't work. You would have to create image that fit the partitionsize in order to get it working with odin / heimdall.
[Galaxy S I9000 Android Development] [Ramad]:
Has been added to the first post, many thanks. :)

Done! :)
[Galaxy S I9000 Android Development] RichMD:
Thanks - this is great

I am running the Darky 9.5 ROM on the Captivate and have been getting insufficient space in /system messages when trying to update Busybox. I understand partitions but I had no idea what a "PIT" file was or that it could potentially impact my problem. I haven't even fully read/digested your post but it is a very clear and detailed explanation. Thanks - this is exactly what I was looking for since I not only want to solve the problem, I want to understand the details.
[Galaxy S I9000 Android Development] Jekkaman:
Is this indepentent from the device flash size?We have 8 and 16 gb galaxy devices.
[Galaxy S I9000 Android Development] rlorange:
Just delete a system app you don't need with root explorer to get some free space.

**Simply Honey 3.1, Talon i9000 test kernel OC/1.2Ghz, JVK modem**
[Galaxy S I9000 Android Development] ENO_qc:
great information here...

So if i always flash in the "512" family, i can forget the pit file and the repatition and just use the pda, phone and csc files?
[Galaxy S I9000 Android Development] [Ramad]:
Yes, flash without pit unless it's needed by the firmware, so far only firmwares that starts with DX needs 513.pit files, otherwise it does not matter at all.
[Galaxy S I9000 Android Development] ENO_qc:
A super thanks !
[Galaxy S I9000 Android Development] chenthu:
Thank you so much for the information... a good professional explanation and a simple one too :)
[Galaxy S I9000 Android Development] verbuyst:
Thanks for the read.

There really should be a "guide section" on this forum where everything related to guides and explanations should be gathered.
[Galaxy S I9000 Android Development] enthalpie:
many thank's

Hello

great post that's what i am looking for

may i ask a question ?

I saw my /system is full. i was looking about pit information if a change pit file will i got more free space? i have now the answer NO ; but !!!

how can i free space ? I saw on /system/app a lot of files with .odex extension which are not used. so can I move it to some other place on /sdcard for exemple ?

regards
[Galaxy S I9000 Android Development] Bejda:
Let's try in english:

Like i've told you before,the only difference in usable space that you'll get by using another pit than 512 is a loss in dbdata...well,now you got the answer.

Like i've told you too odex files are needed by system apk (those you're willing to keep in system/app of course).Someone could surely give you better explanation but odex files are optimizations,don't know precisely what will happen if you delete the odex file of a system apk and try to use this apk after (should be force close?don't know...) But do you really think this tiny files will give you so much free space?

You've said you moved ringtones to sd,good way,but...like i've told you before,remove useless apk from system/app is more efficient....hum,like someone else told you before buddies now.apk or feedsandupdate could be a good choice,already done?

You said you've gain about 16Mo by removing ringtones and apk,for what purpose do you need more free space?

Would be cool if someone explain more precisely the odex files workaround and differences made by deodex rom cause I will suffer a lack of precision if I try to.
[Galaxy S I9000 Android Development] enthalpie:
?? i don'y know why you post here, i am french and i start talking on other forum. i will follow on original one
[Galaxy S I9000 Android Development] enthalpie:
please precision

Hi

Please you said

If a user does use 512.pit, 803.pit or 513.pit file then even if the space trading between /system and /dbdata is present but in reality the only change is reducing or increasing /dbdata while not benefiting from space increase of /system as the usable space is kept at 276.3MB no matter what pit file is used.

i undestand, /system partition is for all pit have the same size 276 Mb

but I we write above Three differents size of /system for the three PIT

so what's true same size ? and if not, so if i want to increase /system size i have to choice the pit with "big" /system size (513)

Thank's in advance for precision

regards
[Galaxy S I9000 Android Development] enthalpie:
@ramad

please give me precison

regards
[Galaxy S I9000 Android Development] kasper_h:
The 513 pit only gives a larger system partition, if it is flashed with Odin packages which create/use this larger system partition.

But why do you need a larger system partition?

Sent from my CM7 galaxy
[Galaxy S I9000 Android Development] enthalpie:
First

i i read correctly and well understand each PIT give more space from 512 one

512 :278Mb

803 : 287 Mb

513 : 297 Mb

So this sentence in post is false

* If a user does use 512.pit, 803.pit or 513.pit file then even if the space trading between /system and /dbdata is present but in reality the only change is reducing or increasing /dbdata while not benefiting from space increase of /system as the usable space is kept at 276.3MB no matter what pit file is used.

I want more space because after flashing with XXJVR ROM i have got my 289Mb /system partition was full and i got error message when updating Su and try to install some files under /system/etc/init.d

as i see now i can flash again with pit 803

Regards
[Galaxy S I9000 Android Development] [Ramad]:
@Bejda

Deodexing is stripping the applications of their odex files by moving the archives inside odex files which are called Classes.dex to the apk files, this process is called de-odex-ing. It's simple but very handy, as a result we can get more free space on /system for other applications and modifications, it's also useful when trying to modify the classes.dex in the apk files.

kasper_h gave the answer that I had in mind. Thanks kasper :)

If you need more space then you can (re)-move some applications from /system/app that you don't use or try to flash a deodexed firmware, I know that after I'm deodexing a firmware there will be around 30-40 MB of free space on system, depending on how big is the CSC file. You can also retrieve the non-allowed-to-write-to space by flashing a Kernel that can format the phone partitions to EXT4 or another filesystem, you can then use the full space of 513.pit or 803.pit, using rfs will limit the space to the amount that is programmed on the firmware itself. I wrote this as simple as I could, I hope that can help.
[Galaxy S I9000 Android Development] yagami:
Thanks for the explanation, but my question is this :

So a deodex application is its binary the same as the odexed one ?

I mean , is there any code reversed engenered ?

Or is this just a moving of classes , completly the same binaries ?

Because i wonder if by deodexing one can introduce bugs or change functionality of the app.