Backup S5 stockRom before TWRP & root? Possible? Which tool? How?

ankade

Senior Member
Apr 21, 2014
100
11
0
How to backup stockRom S5 before starting to follow any instructions to root + flash + LineageOS ...

What I want:

* backup my brand new stock ROM Galaxy S5 SM-G900F
* before I even start with TWRP, root, etc.
* with an apk, via USB on a PC ... any way that would work
* or if total backup does not exist, then at least the EFS partitions?

because:

* I might want to sell it later
* I might have to send it back
* flashing TWRP & LineageOS might fail
* I have lost mobileInternet on an LG-V20 already because something went strange when flashing
* I am careful

Is there any way to backup a Samsung S5 before I even start with following any instructions here?
Am I asking for something impossible?
Was I on the right way already (see below), but have done something wrong?
Is it perhaps only possible after rooting? If so, then which tool do you recommend then?

Thanks a lot!
:)

What I have tried:

* xda developer galaxy-s5/general every thread title until page 5 https://forum.xda-developers.com/galaxy-s5/general/page5
* xda developer search for "S5 backup", "S5 EFS", and a few other searches. Sorry for being dumb, please help me search, thanks.
* Heimdall PIT, but "ERROR: Failed to send request to end PIT file transfer!"
* Odin PIT, but "Can't open the specified file. (Line: 1892)"
* Samsung Tool 5.0 com.sec.ricky310711.samsungtool.apk https://forum.xda-developers.com/showthread.php?t=2696153 but the app-->Backup-EFS hangs at "Please Wait..." <-- probably because I could not install busybox because no root yet.
* manual EFS backup with dd https://forum.xda-developers.com/showthread.php?t=2737448 but I get a "su: not found", obviously, because unrooted

Code:
Heimdall v1.4.0
...
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...
ERROR: Failed to send request to end PIT file transfer!
ERROR: Failed to download PIT file!
Ending session...
ERROR: Failed to send end session packet!
Releasing device interface...
Code:
<ID:0/003> Added!!
<ID:0/003> Odin engine v(ID:3.1301)..
<ID:0/003> File analysis..
<ID:0/003> Total Binary size: 0 M
<ID:0/003> SetupConnection..
<ID:0/003> Initialzation..
<ID:0/003> Set PIT file..
<ID:0/003> DO NOT TURN OFF TARGET!!
<ID:0/003> Can't open the specified file. (Line: 1892)
<OSM> All threads completed. (succeed 0 / failed 1)
 
Last edited:

Ibuprophen

Senior Member
Sep 4, 2012
9,551
6,495
253
Upstate New York
Though, I don't have your specific variant, the typical "just in case" files (that I personally always begin with) to obtain are the following:

1) Stock Firmware File (I just go with the latest and sometimes the 1 previously released).

2) Latest Odin PC Software.

3) Latest Samsung USB Drivers for the PC.

4) PIT file (PIT = Partition Information Table).

Those are usually the bare essentials that I begin with.


Good Luck!


~~~~~~~~~~~~~~~
UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my Enigma Machine {aenigma = Latin for "Riddle"}.
 

ankade

Senior Member
Apr 21, 2014
100
11
0
Great, thanks a lot. That is a helpful list.

2) Latest Odin PC Software.
Which is the latest you are using? The version "Odin3-v3.13.1" does NOT work, see above.

How exactly do I extract the current state of my (still unrooted) SM-G900F ?

Thanks.
 
Last edited:

ankade

Senior Member
Apr 21, 2014
100
11
0
I have now tried again manually:

Code:
heimdall download-pit --output s5.pit
Is that the right command?

It only worked after overwriting the MSM8960 driver with zadig.exe

Then it looks like this:

Code:
Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

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

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

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...
then after a while:


Code:
ERROR: Failed to send request to end PIT file transfer!
ERROR: Failed to download PIT file!
Ending session...
ERROR: Failed to send end session packet!
Releasing device interface...
 

ankade

Senior Member
Apr 21, 2014
100
11
0
heimdall 1.4.2

Hooray, big progress. It was a version problem, older versions of heimdall seem faulty. And grrrmpf: the "heimdall" website which comes up at the top on search engines ... provides an outdated 1.4.0 version. Which seems broken. But hooray, the 1.4.2 version of heimdall works:

this looks good, no?

Code:
cd heimdall_1.4.2_win64
heimdall print-pit --no-reboot
Code:
Heimdall v1.4.2
Copyright (c) 2010-2017 Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/
This software is provided free of charge. Copying and redistribution is encouraged.
If you appreciate this software and you would like to support future development please consider donating: http://www.glassechidna.com.au/donate/
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.
Code:
Entry Count: 30
Unknown 1: 1598902083
Unknown 2: 844251476
Unknown 3: 21325
Unknown 4: 14413
Unknown 5: 14137
Unknown 6: 52
Unknown 7: 0
Unknown 8: 0
now there are 30 such entries:
Code:
--- Entry #0 ---
Binary Type: 0 (AP)
Device Type: 2 (MMC)
Identifier: 1
Attributes: 5 (Read/Write)
Update Attributes: 1 (FOTA)
Partition Block Size/Offset: 8192
Partition Block Count: 30720
File Offset (Obsolete): 0
File Size (Obsolete): 0
Partition Name: APNHLOS
Flash Filename: NON-HLOS.bin
FOTA Filename:
I got the new heimdall 1.4.2 version from here:
https://github.com/Benjamin-Dobell/Heimdall/issues/295#issuecomment-364729538
and because he only provides the source, the binary from here
https://github.com/tothphu/heimdall_build/
 
Last edited:

ankade

Senior Member
Apr 21, 2014
100
11
0
this worked too:
Code:
heimdall download-pit --no-reboot --output S5-download-pit.pit
It resulted in a non-human-readable binary file of 8192 bytes.

But:

How to backup partitions?

with
Code:
heimdall --help
I can see that there I can flash ONTO the device with e.g.
Code:
heimdall flash --RECOVERY twrp-x.x.x-x-klte.img --no-reboot
but there does not seem to be a
Code:
heimdall read --RECOVERY --file recovery.img --no-reboot
?

how to READ a partition FROM the device?

?
 
Last edited:

ankade

Senior Member
Apr 21, 2014
100
11
0
Now I have tried it via USB debugging, with "minimal_adb_fastboot_1.4.3_portable.zip"

but
Code:
 adb shell

ls -al /dev/block/platform/msm_sdcc.1/by-name/efs
lrwxrwxrwx root     root              2014-05-24 16:36 efs -> /dev/block/mmcblk0p12

dd if=/dev/block/mmcblk0p12 of=/storage/3164-3234/S5/efs.img
results in
Code:
dd: /dev/block/mmcblk0p12: Permission denied
and
Code:
su -
/system/bin/sh: su: not found
so it looks as if my first hope has to be declared dead ...

No system backup without root, right?
?

But what I don't understand ... How did people extract these here then: https://www.sammobile.com/firmwares/galaxy-s5/SM-G900F/ ???
I have found instructions how to get back to stock rom, but I would like to use my own original stockROM for that. But I don't know how to back it up. Please help. Thanks.
 
Last edited:

ankade

Senior Member
Apr 21, 2014
100
11
0
how to root?

The phone is this one:
  • Samsung S5
  • SM-G900F
  • Android version 6.0.1
  • Android security patch level: 1 January 2017

I have tried these root tools:
  • Kingroot (NewKingrootV5.3.7_C197_B451_xda_release_2018_06_19_20180620193529_242043.apk) --> "Generating adaptation strategy, please come back later"
  • Towelroot v1.0 (tr.apk) --> "This phone isn't currently supported"
I did not want to try CF-Auto-Root because it says "If you have a Samsung-KNOX-enabled device, this package will trip the KNOX warranty flag. This flag cannot be reset, and will prevent some applications from working."

Is there really no way to get root without first installing TWRP ?
?
 
Last edited: