# Convert RFS to EXT4?



## thatthatisis

I've been researching and found tons of other scripts/update.zip files for OTHER Galaxy S phones to convert the file system. We've got a kernel compiled with ext4 support and CWM backup/restore working, so it shouldn't be too risky to try it, but I can't find any documentation on exactly how the scripts on the other phones are working. I assume since the partition sizes (and possibly names/configurations) are different for every phone that there's a bit more to it than simply creating ext4 versions of /data, /system, etc. and doing a CWM restore...

Anyone have experience/advice for the process that doesn't involve useless advice like "flash an ext4 rom/pit with odin"?


----------



## icebear

bump would love EXT4 for this phone


----------



## dcooterfrog

Why?
why is this better.


----------



## knightcrusader

dcooterfrog said:


> Why?
> why is this better.


I am pretty sure ext4 is faster than rfs. You'd see a performance jump if you switched over.

As far as I can tell, our recovery supports ext4... but I could be wrong. Converting to ext4 is something I will work on once I get a full official odin to fall back to. (An odin for something other than unreleased builds.)


----------



## thatthatisis

knightcrusader said:


> I am pretty sure ext4 is faster than rfs. You'd see a performance jump if you switched over.
> 
> As far as I can tell, our recovery supports ext4... but I could be wrong. Converting to ext4 is something I will work on once I get a full official odin to fall back to. (An odin for something other than unreleased builds.)


RFS has some lag problems and even Samsung abandoned it on the Galaxy S2. My preference would be to have the strat on ext4 with journaling turned on (more stable).

The recovery *should* support ext4 since it appears every release of CWM since version 3 has been compiled for it. Fortunately imnuts already recompiled the kernel with ext4 turned on, so I think we should be set.

Who knows when/if we'll get a factory rom leak. I have the source (available from Samsung) and am sure I could get it recompiled, but am unsure of the packaging involved. Knight - I believe someone reported the CWM you posted successfully restoring, yes? That'd mean that if it's just a re-partition that needs to happen, we have a way of recovering the system to stock. The stock partition information is pretty easy to come by with ADB (was taking a look at it tonight), I just wasn't sure if I'd have to modify the system source somehow and recompile after doing a partition change.

P.S. thanks for all the work on the phone, knight


----------



## poontab

Moved to general. Please use development sections for releases only.


----------



## skategeezer

I remember this tool from my fascinate and Droid Charge days.

Thanks to navenedrob over at XDA for coming up with this.

EXT4 format tool.

Here are two links one to the Fascinate and one for the Droid Charge.

http://forum.xda-developers.com/showthread.php?t=1090127

http://forum.xda-developers.com/showthread.php?t=1176751

Can someone that understands the partition setup on the stratosphere look at this?

This is not pretty but I have been here before with Droid Charge and it can be done.


----------



## thatthatisis

skategeezer said:


> Can someone that understands the partition setup on the stratosphere look at this?


The update package contains a shell script with very clear (and easy to modify) sections. It looks like I'll be able to work with that, but before trying it, I'll be hunting down the method to return to rfs. I'll probably start with something a little less crucial to booting (data or cache I suppose), as opposed to the system partition.

I have to do some real work right now, but I'll look into whether the partition locations are the same as the Charge. If someone else wants to do it while I'm busy working, these are the values from the Charge version of the script:

# PARTITION BLOCK LOCATIONS
system_part=/dev/block/stl10
data_part=/dev/block/mmcblk0p1
dbdata_part=/dev/block/stl11
cache_part=/dev/block/mmcblk0p3
extrastorage_part=/dev/block/mmcblk0p2
sdcard_part=/dev/block/mmcblk1p1

If these are the same, we may be able to get away without changing a thing and using the charge script.

It goes through a 4 stages:

/////////////////////////////////////////////////////////////

Forced file check

step1="$cmd_fsck -fy"

Breaking down the parameters, this builds the file system with extent, flex_bg and journaling all disabled, block size 4k, 0% of space reserved for super user, -F forces creation even if it's mounted or parameters don't make sense. Journaling is off for speed. I'm not sure why extent is off since it can generally boost performance - anyone know if it's not supported or otherwise not a good idea on a phone (I'm new to android, but plenty familiar with desktop environments)? Flex_bg lets block meta-data be stored anywhere - not sure of the benefits/support for this. I plan on leaving it alone.
step2="$cmd_mkfs -O ^extent,^flex_bg,^uninit_bg,^has_journal -b 4096 -m 0 -F"

Adjust parameters: disk check after 1 mount, no space reserved for privileged processes, enable journal data writeback (less secure than ordered journaling, but faster).
step3="$cmd_tune2fs -c 1 -m 0 -o journal_data_writeback"

Force file check, optimize directories
step4="$cmd_fsck -Dfy"

/////////////////////////////////////////////////////////////

I'm not sure how useful the info is to anyone, but I figure I may as well help compile data in one forum. I'm going to head down to the Verizon store and have them put insurance on my phone before I try this. If I screw up the filesystem and can't figure out a timely fix, it may just get "stolen" ;-) I'll keep y'all posted.


----------



## Dalladubb

It's not that same as the Charge, contact Knight Crusader for more information.


----------



## icebear

would love to see this happen =) it will warm my heart


----------



## selyb

Using the posts linked above, I downloaded the binaries and manually converted /data to ext4. KnightCrusader's CWM mounted and accessed the partition just fine and I had to manually restore the files because the cwm restore recreated the rfs partition 0_o
Anyway, I got an infinite boot animation loop


----------



## Dalladubb

Yeah, our partition system is not the same as the Charge's. Also, our recovery isn't built from source, so by converting I'm sure you fubarred your cache partition.


----------



## selyb

Dalladubb said:


> Yeah, our partition system is not the same as the Charge's. Also, our recovery isn't built from source, so by converting I'm sure you fubarred your cache partition.


how would it affect the cache partition?
Anyway, I'm pretty sure the reason it didn't boot is because init.rc explicitly mounts /data as rfs
Now, I can't seem to figure out how to edit our zImage


----------



## nagmier

You can't edit it, you have to build it from source

Sent from my SCH-I400 using Tapatalk


----------



## selyb

well I found some tutorial for the G1 to split the boot.img into its different parts, edit, and a cross-compiler to put it back together

The G1's boot.img is gzipped I think and ours is not AFAIK. In any case, that tutorial did not work for ours.


----------



## knightcrusader

selyb said:


> well I found some tutorial for the G1 to split the boot.img into its different parts, edit, and a cross-compiler to put it back together
> 
> The G1's boot.img is gzipped I think and ours is not AFAIK. In any case, that tutorial did not work for ours.


We don't have a boot.img, Samsung uses zImages which have integrated initramfs. There are tutorials out there that can tell you how take one apart and put it back together, but I haven't had luck with it. Its easier for me to just recompile the stock kernel with the initramfs changes


----------



## icebear

any news yet on ext4 for our phone im ready to pull my debt card out and donate to ever gets thiss done


----------



## imnuts

You will need to add ext4 support to the kernel in the *.rc files before you can format anything to ext4, just as an FYI. It's not terribly difficult to do, but it would need to be done, otherwise, the system couldn't mount the partitions or boot.


----------



## ben7337

Any updates on ext4? It looks like no one has said anything for a few months, but lots of kernels claim support for it, but even the tweaked 2.0 rom thread doesn't have a single mention of ext4. Has everyone decided to just let it go?


----------

