[Transformer TF300T Android Development] pe1dnn:
I don't understand this step, change to F2FS and then format again, I think this will change it right back to ext4.

I think there is some misunderstanding here between formatting and writing the file system structure. In the old days of blanc discs, formatting was needed to create the cylinders, tracks and sectors, so chopping up the space in, for example, 512 kB blocks. So the steps are:

Part 1:

- Write down a track on one site of a platter and chop it up in, for example, 512 kB sectors

- Repeat this for the other platters until all tracks are written, the stacked tracks form a cylinder

- Then move a bit sideways for the next cylinder unit all cylinders are done.

This is called low level formatting and since more than 30 years or so not needed any more as it is done in the factory and never again. It's nonsense on flash storage. Maybe you remember this from floppies when they were not pre-formatted at the factory.

Part 2:

- Verify the media, in this step a pattern is written to each sector and this is later read back to check if there are no weak spots in a sector, build a map of usable and unusable sectors in memory.

Step 2 is also for the most part useless for more than 30 years because any drive since then will manage bad sectors internally and the application using the disk will only see good sectors. For flash media however this can be used to wipe all flash blocks.

Part 3:

- Write down the file system, this is just record keeping. It keeps track of what is stored where on disk

Writing the file system takes almost no time at all, the bad sector map of Part 2 is used to mark sectors as unusable in the file system so these will not be used.

Part 2 and 3 are called high level formatting. However since hard drives do not expose bad sectors any more but handle them internally, the prupose of Part 2 today is to access every sector so the drive can detect the status, the sector map will never show any bad sectors.

Okay so now that happens if you use the format option in TWRP is that it does Part 2 and Part 3; wiping all the flash blocks and then writing out the ext4 file system. That wiping is what makes formatting so very, very slow. If you would just use mkfs.ext4 to create only the file system it would be finished in seconds since that will only do Part 3 without resetting the flash blocks.

Maybe you remember this from floppies too, you have a fast format which only does Part 3 (and reuses the bad sector map from the previous file system and does not wipe data in the sectors) and a full format which also includes Part 1 and 2 (for floppies also Part 1 so it can deal with unformatted floppies) and takes a lot more time.

If you than change to F2FS then it will only take a few seconds too, it will just put the file system there and done. So now you see that formatting it after that is useless, the flash blocks are already reset, doing it again would only take time and wear out the flash (emmc in this case) storage. Also putting ext4 is part of the formatting process so you are just putting ext4 back when formatting again.

So format /data. This should take long, for me over 30 minutes (maybe there is something smart that resetting goes faster when the flash blocks are already reset?). Then change to F2FS which should be just seconds, it's only a few write actions. And then don't do anything to the data partition anymore and install the ROM following the instructions.

So hopefully this helps to understand the steps and why formatting ext4 takes so long and f2fs does not. Taking care of wiping unused flash blocks once the tablet is running is done by a background trim command when you use ext4, however f2fs is flash aware so it does it as part of the regular housekeeping.