Version 7 (modified by Rick van der Zwet, 6 years ago) ( diff )


Modify Internal SDcard storage to External SDcard

The Samsung Galaxy XCover2 (S7710) has only roughly 500MB left on emulated internal storage which is not enough these days if you like to install a lot of applications. There are many tricks around to move data/cache/applications to the external SD card, but all of them has it quirks. Since large SDcard these days are fast and cheap enough having I think this could be done better, by simply discarding the internal /data storage and use an sdcard partition instead.


What I will do is modify the /fstab.samsungskomer to change the mount of the ext4 /data of the internal location /dev/block/mmcblk0p25 to the second partition of the external SDCard /dev/block/mmcblk1p2. Technically speaking you do not even need to root your device, but by flashing firmware you will need to do some pretty advanced stuff.


Format SD Card

Format 32GB class 10 or higher SDcard with two partitions:

  1. 20GB vfat partition, this will serve as the normal extSdCard
  2. 12GB ext4 partition, this will serve as the new /data partition (make sure it is the second and last partition)

Compile Android Tools

 $ git clone
 $ cd core
 $ git checkout android-4.2.1_r1

 $ cd libmincrypt
 $ gcc -c *.c -I../include
 $ ar rcs libmincrypt.a *.o
 $ cd ../mkbootimg
 $ gcc mkbootimg.c -o mkbootimg -I../include ../libmincrypt/libmincrypt.a

 $ cd ../mkbootfs
 $ gcc mkbootfs.c  -o mkbootfs -I../include

 $ cd ../libsparse
 $ gcc -o simg2img -Iinclude -lz simg2img.c sparse_crc32.c backed_block.c output_file.c sparse.c sparse_err.c sparse_read.c

Modify stock kernel

I assume you have a stock kernel laying around if not download it from the links below.

 $ ./ boot.img

 $ mkdir ramdisk; cd ramdisk
 $ gzip -dc ../boot.img-ramdisk.gz | cpio -i

 # Alter {{{ fstab.samsungskomer }}} and change /data mountpoint from {{{/dev/block/mmcblk0p25}}} to {{{/dev/block/mmcblk1p2}}} 
 $ vim fstab.samsungskomer

 $ cd ..
 $ mkbootfs ./ramdisk | gzip > ramdisk-new.gz
 $ mkbootimg --cmdline 'no_console_suspend=1 console=null' \
  	    --kernel boot.img-kernel \
	    --ramdisk ramdisk-new.gz \
            -o boot-new.img

Upload kernel

  1. Put device in download mode (VolumeDown+Home+Power) on power-on.
  2. $ sudo heimdall flash --pit S7710.pit --Kernel ./boot-new.img # FYI: Pit file retrieval below

Enjoy your new device

The phone will need to be rebooted a few times and it will be complaining about corruption and encryption, just go will the flow and acknowledge the notifications. Ones completed enjoy your improved Samsung Galaxy XCover 2 (S7710).


Retrieve PIT file

  1. Put device in download mode (VolumeDown+Home+Power) on power-on.
  2. $ sudo heimdall download-pit --output S7710.pit
  3. Reboot device to perform other heimdall actions as other actions will fail after this.

Root Device

  1. Install recovery ROM found at some background at
  2. Install (or latest) via recovery mode (Hold VolumeUp+Home+Power on boot).
  3. Enjoy your rooted phone

Reset to factory defaults

$ unzip $ tar -xf S7710XWAOB1_S7710XENAOA2_HOME.tar.md5 $ ls *.img

 boot.img  cache.img  hidden.img  recovery.img  STE_boot1.img  STE_boot2.img  system.img

Use the PIT file to find out the mapping between image files and partition name to use: $ heimdall print-pit --file ./S7710.pit | grep -e '---' -e 'Partition Name' -e 'Flash Filename'

--- Entry #0 ---
Partition Name: MBR,GPT
Flash Filename: 
--- Entry #1 ---
Partition Name: MasterTOC
Flash Filename: STE_boot.bin
--- Entry #2 ---
Partition Name: PIT
Flash Filename: skomerxx.pit
--- Entry #3 ---
Partition Name: MD5HDR
Flash Filename: md5.img
--- Entry #4 ---
Partition Name: STEboot1
Flash Filename: STE_boot1.img
--- Entry #5 ---
Partition Name: STEboot2
Flash Filename: STE_boot2.img
--- Entry #6 ---
Partition Name: Dnt
Flash Filename: dnt.ssw
--- Entry #7 ---
Partition Name: reserved
Flash Filename: 
--- Entry #8 ---
Partition Name: CSPSAFS
Flash Filename: cspsa.img
--- Entry #9 ---
Partition Name: CSPSAFS2
Flash Filename: cspsa2.img
--- Entry #10 ---
Partition Name: EFS
Flash Filename: EFS.img
--- Entry #11 ---
Partition Name: ModemFS
Flash Filename: modemfs.img
--- Entry #12 ---
Partition Name: ModemFS2
Flash Filename: modemfs2.img
--- Entry #13 ---
Partition Name: Fota
Flash Filename: ssgtest.img
--- Entry #14 ---
Partition Name: IPL Modem
Flash Filename: ipl.bin
--- Entry #15 ---
Partition Name: Modem
Flash Filename: modem.bin
--- Entry #16 ---
Partition Name: Loke4
Flash Filename: normal.bin
--- Entry #17 ---
Partition Name: 2ndLoke4
Flash Filename: normal2.bin
--- Entry #18 ---
Partition Name: PARAM
Flash Filename: param.lfs
--- Entry #19 ---
Partition Name: Kernel
Flash Filename: boot.img
--- Entry #20 ---
Partition Name: Kernel2
Flash Filename: recovery.img
--- Entry #21 ---
Partition Name: SYSTEM
Flash Filename: system.img
--- Entry #22 ---
Partition Name: CACHEFS
Flash Filename: cache.img
--- Entry #23 ---
Partition Name: HIDDEN
Flash Filename: hidden.img
--- Entry #24 ---
Partition Name: DATAFS
Flash Filename: userdata.img

Ensure device is connected using a good quality USB cable, battery is changed and turn it on to download mode using simultaneous press of Volume Down + Home + Power.

Now flash the device:

$ sudo /usr/local/bin/heimdall flash --pit ~/S7710.pit --STEboot1 ./STE_boot1.img --STEboot2 ./STE_boot2.img --Modem ./modem.bin --Kernel ./boot.img --Kernel2 ./recovery.img --SYSTEM ./system.img --CACHEFS ./cache.img --HIDDEN ./hidden.img

Heimdall v1.4.2

Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna

This software is provided free of charge. Copying and redistribution is

If you appreciate this software and you would like to support future
development please consider donating:

Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading STEboot1
STEboot1 upload successful

Uploading STEboot2
STEboot2 upload successful

Uploading Modem
Modem upload successful

Uploading Kernel
Kernel upload successful

Uploading Kernel2
Kernel2 upload successful

Uploading SYSTEM
SYSTEM upload successful

Uploading CACHEFS
CACHEFS upload successful

Uploading HIDDEN
HIDDEN upload successful

Ending session...
Rebooting device...
Releasing device interface...


Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.