Sneaky Samsung hidden partition: /dev/block/mmcblk0p3 (/mnt/apk)

daniel.weck

Senior Member
Nov 2, 2010
574
95
0
daniel.weck.free.fr
Due to a previous Odin ROM install, each time my Tab was restarting there was 3 apps automatically installed to /data/app (DioDict, PanzerPanic, InfeCCt). :mad:

There is a sneaky small hidden partition at /dev/block/mmcblk0p3, which gets mounted at startup by the Samsung recovery at /mnt/apk, and immediately disappears after it does its sneaky job ! :rolleyes: Note that this has nothing to do with the stock init.rc on my euro Tab, as I use a self-made initramfs ramdisc where I can control most aspects of the boot process...it seems to be a recovery-only procedure (see the post below about the /preinstall mount).

I went to recovery, mounted mmcblk0p3 manually, and deleted the contents of /mnt/apk, problem sorted :D The "parted" command easily shows the partitions on the internal SD card, including this not-so-mysterious-anymore space.

As I build my own kernel and craft my own initramfs ramdisc, I added an fstab that gets activated in recovery mode only, so I have easy mount options for mmcblk0p{1,2,3} and all the other important partitions. I use /res/etc/fstab, based on the ClockWorkMod recovery folder structure (/system/etc gets sym-linked). Anyway, I digress.

I assume that hidden.rfs (when flashed with Odin) is destined to this hidden internal SD card partition, so I guess that Heimdall could be updated to support this particular use-case...or maybe not ;)

Cheers, Dan
 
Last edited:

Boushh

Retired Recognized Developer
Mar 19, 2008
390
139
0
Portland, OR
That's your pre install partition.

Code:
    mkdir /preinstall
    mount rfs /dev/block/mmcblk0p3 /preinstall nosuid nodev check=no
    chown system system /preinstall
    chmod 0771 /preinstall
is how it's mounted by init.rc. So, you can just remove it from that to prevent it from mounting too.
 

daniel.weck

Senior Member
Nov 2, 2010
574
95
0
daniel.weck.free.fr
Ah, thank you for the clarification ! :)
EDIT: I have never seen the preinstall directory on my Euro Tab, but I also admit that I didn't pay attention to the stock init.rc (which has now been overridden by my self-made initramfs). By the way, it's not RFS on my Tab, but vFAT.

Nothing to do with hidden.rfs then ?

How come the APK files never get deleted from this partition ? It should really be just a one-off install, right ? Otherwise, as it stands it is designed to interfere with my nicely cleaned-up system at each device reboot ! :mad: ;) (and it is not controlled by the init.rc, but by the recovery process)
 
Last edited:

alex2792

Senior Member
Jun 6, 2010
338
23
0
I noticed that partition too on my Verizon Tab. I don't want to mess with it though, I think it contains some files that Samsung uses to unbrick dead tabs at their repair center.
 

konx777

Member
Apr 5, 2011
27
2
0
/dev/block/mmcblk0p3 means???

So guys,

whats the meaning of /dev/block/mmcblk0p3 not found anyway :confused:

I got that message after flushing back and forth between froyo-GB to my Samsung I9003 device. I did rooting also at that moment.

According to your post earlier i assume that there is a way to fix this problem.

*sorry for the 'very' newbie question*

Any suggestion where i can start trying ??? (i've ask here but hopeless):(