[GUIDE] Extract .rfs files

Search This thread

mopodo

Senior Member
Aug 16, 2009
142
51
I came from HTC Hero to the Samsung Galaxy S GT-I9000
So I had never problems with cooking something up, but in the Galaxy I faced .rfs files and a flashing tool I can't use on linux...

So I searched through some boards to find a way to extract the .rfs files here a working guide for the S I9000.

What you need
  • Linux (tested with Debian testing)

It's pretty simple, execute this commands as root on your computer


SHORT WAY (thanks to mimocan)
Code:
# mount -o loop factory.rfs /some_dir



LOOOONG WAY
Attatch the rfs file to the loop device
Code:
# losetup /dev/loop0 /somedir/factoryfs.rfs

Create a directory to mount the device
Code:
# mkdir /somedir/mnt

Mount the device
Code:
# mount /dev/loop0 /somedir/mnt
the content of the rfs is NOT saved on the sdcard! you have to copy it!

Now you can copy the content from the /sdcard/tmp directory to the sdcard
Code:
# cp -R /somedir/mnt /somedir/factoryfs

hope this is helpful for someone
 
Last edited:

psternx

Member
Jul 18, 2010
19
4
This works because rfs is based on vfat.
But have you ever tried this on cache.rfs or dbdata.rfs?
The mounted folder is empty. The cache.rfs in my case was around 1.2 mb.

Maybe the 1.2 mb are journaling data rfs uses?

I also tried mounting cache.rfs and dbdata.rfs directly on my sgs without any luck.
Since the phone has built in rfs drivers it should be able to mount it.
 

mopodo

Senior Member
Aug 16, 2009
142
51
This works because rfs is based on vfat.
But have you ever tried this on cache.rfs or dbdata.rfs?
The mounted folder is empty. The cache.rfs in my case was around 1.2 mb.

Maybe the 1.2 mb are journaling data rfs uses?

I also tried mounting cache.rfs and dbdata.rfs directly on my sgs without any luck.
Since the phone has built in rfs drivers it should be able to mount it.

If you open the cache.rfs or dbdata.rfs from a PDA build (tested I900XXJP3) in a hexeditor you will see they are empty, just the headers and a lot of zeros ;)
 

Laum

Senior Member
Jun 23, 2010
180
19
Actually Cache.rfs file in CSC is a renamed update.zip. At least with a few firmwares I have tried. So just open it with, for example, 7-zip and you can browse the files.
 

bloodrider

Senior Member
Aug 17, 2010
141
17
Tried to mount a cache.rfs and got a "Device or resource busy".

Then tried to open it trough MagicISO, and voilá, I got the CSC files I needed :D
 

a-son

Senior Member
Aug 17, 2008
183
11
Tierra del norte
www.softdevs.se
Now im into modifying factoryfs.rfs and hoping you can give me some tips.

Alt1
mount -o loop factoryfs.rfs directory & Copy files to a new place and edit them but how to create a .rfs from that point?

Alt2
sudo mount -v -o rw,loop,uid=$UID factoryfs.rfs Directory
Edit the files , umount the .rfs . Mount it again but the the changes are gone.

How do you do it?

Thanks.
 

ykkfive

Inactive Recognized Developer
Jul 25, 2010
3,222
3,018
ykkfive.blogspot.com
Now im into modifying factoryfs.rfs and hoping you can give me some tips.

Alt1
mount -o loop factoryfs.rfs directory & Copy files to a new place and edit them but how to create a .rfs from that point?

Alt2
sudo mount -v -o rw,loop,uid=$UID factoryfs.rfs Directory
Edit the files , umount the .rfs . Mount it again but the the changes are gone.

How do you do it?

Thanks.


for me, i'll definitelty mod it elsewhere
 

Val3r10

Senior Member
Jul 6, 2006
228
6
yess!!!!

how to recompile the .rfs ?????

BUMP!
Actually some cache.rfs aren't simple renamed zipfiles, as they (i.e. multi-csc) also contains more stuff

So I loopmounted rw the vfat cache.rfs, extracted and modified the contained sec_csc.zip (this one IS an update.zip structured file...)

But when I put it inside, sync, unmount and mount again to verify stuff, I got a corrupted filesystem and a corrupted zip file.

Any clue to successfully modify contents of such .rfs ?
 

coldflid

Senior Member
Dec 27, 2010
1,586
782
I came from HTC Hero to the Samsung Galaxy S GT-I9000
So I had never problems with cooking something up, but in the Galaxy I faced .rfs files and a flashing tool I can't use on linux...

So I searched through some boards to find a way to extract the .rfs files here a working guide for the S I9000.

What you need
  • Linux (tested with Debian testing)

It's pretty simple, execute this commands as root on your computer


SHORT WAY (thanks to mimocan)
Code:
# mount -o loop factory.rfs /some_dir



LOOOONG WAY
Attatch the rfs file to the loop device
Code:
# losetup /dev/loop0 /somedir/factoryfs.rfs

Create a directory to mount the device
Code:
# mkdir /somedir/mnt

Mount the device
Code:
# mount /dev/loop0 /somedir/mnt
the content of the rfs is NOT saved on the sdcard! you have to copy it!

Now you can copy the content from the /sdcard/tmp directory to the sdcard
Code:
# cp -R /somedir/mnt /somedir/factoryfs

hope this is helpful for someone

Is there a way to convert it back to rfs?
 

lownoise

Senior Member
Sep 3, 2010
206
127
@all
Is there a way to convert it back to rfs?:confused:
If you used the shortway # mount -o loop factory.rfs /some_dir
than you can modify the files in some_dir.
when finished simple un mount the some_dir and the files are saved in the factory.rfs
Then tar and md5 the factory.rfs and you can flash it with odin
 

Bluephantom3

Senior Member
Jan 23, 2011
74
5
Sydney
If you have extracted it with MagicISO and now just want to create it back to factoryfs.rfs can I do this with Cygwin and what would the command line be?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    I came from HTC Hero to the Samsung Galaxy S GT-I9000
    So I had never problems with cooking something up, but in the Galaxy I faced .rfs files and a flashing tool I can't use on linux...

    So I searched through some boards to find a way to extract the .rfs files here a working guide for the S I9000.

    What you need
    • Linux (tested with Debian testing)

    It's pretty simple, execute this commands as root on your computer


    SHORT WAY (thanks to mimocan)
    Code:
    # mount -o loop factory.rfs /some_dir



    LOOOONG WAY
    Attatch the rfs file to the loop device
    Code:
    # losetup /dev/loop0 /somedir/factoryfs.rfs

    Create a directory to mount the device
    Code:
    # mkdir /somedir/mnt

    Mount the device
    Code:
    # mount /dev/loop0 /somedir/mnt
    the content of the rfs is NOT saved on the sdcard! you have to copy it!

    Now you can copy the content from the /sdcard/tmp directory to the sdcard
    Code:
    # cp -R /somedir/mnt /somedir/factoryfs

    hope this is helpful for someone
    3
    Code:
    #mount -o loop factory.rfs /some_dir
    should do the same
    1
    If you used the shortway # mount -o loop factory.rfs /some_dir
    than you can modify the files in some_dir.
    when finished simple un mount the some_dir and the files are saved in the factory.rfs
    Then tar and md5 the factory.rfs and you can flash it with odin

    unfortunately don't work (I used debian distribution).
    When you flash odin-package with modified factory.rfs, galaxy s will not boot just vibrates