• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[GUIDE] Rooting s3 mini from Linux with heimdall

Search This thread

arturaz

Member
Dec 25, 2010
8
18
Hey.

Just wanted to share my rooting experience.

My girlfriend just bought her S3 mini few days ago - and because Samsung Dive sucks balls (can be erased by doing factory reset), I felt the need to root, so cerberus anti-theft (http://cerberusapp.com, try it out, its awesome) could be written to /system (which requires root & survives factory resets).

Because I use Ubuntu Linux, I couldn't use Odin. Also from what I've read Odin reflashes whole phone, including bootloaders, recovery images and so on.

Because I've had XXALJL build originally in my phone, I've used this uk rooted rom as my rooting source.

Also, because the baseband is identical, I only flashed the system image, where /system/bin/su resides.

If you have a different baseband than your rooted image, this guide will not help you and you probably need to either: a) use odin to reflash everything. b) use your brain to figure your what to flash and where.

So here we go!

Flashing

I'm using ubuntu 12.10, 64 bit:

Code:
[email protected]:~/Downloads/rooted# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10
DISTRIB_CODENAME=quantal
DISTRIB_DESCRIPTION="Ubuntu 12.10"

Code:
[email protected]:~/Downloads/rooted# uname -a
Linux cyrix 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

The only thing you should be concerned about is whether you're using 32 or 64 bit OS.

I've used heimdall 1.3.1, because 1.3.2 has issues and I didn't want to risk. Perhaps 1.3.2 or 1.4-RC1 would work just fine too, but I've used 1.3.1 and that did work for me.

Get heimdall 1.3.1 from http://www.glassechidna.com.au/products/heimdall/ (choose 32 bit (i386) or 64 bit (x64) debian package appropriately). Install those. And lets get down to bussiness.

I RECOMMEND RUNNING ALL COMMANDS FROM ROOT USER

Some guides recommend rebooting your pc after heimdall install (it inserts some udev rules). I didn't do that (completely forgot), but do it, just to be on a safe side.

So first step is to determine what partition identifier does your system partition has. Put your device into download mode (power off. Then hold vol down + home + power & click vol up once).

After doing that, connect your usb cable to computer and run:

Code:
# heimdall detect

It should say:

Code:
Device detected

If it doesn't - none of the following commands will probably work.

Then - lets see what our PIT (partition information table? not sure about the acronym) looks like:

Code:
# heimdall print-pit

What we are looking for is system partition. Mine looked like this:

Code:
--- Entry #21 ---
Unused: No
Partition Type: 2 (EXT4)
Partition Identifier: 20
Partition Flags: 5 (R)
Unknown 1: 5
Partition Block Size: 524288
Partition Block Count: 2457600
Unknown 2: 0
Unknown 3: 0
Partition Name: SYSTEM
Filename: system.img

From this we can see that our partition identifier is 20.

So extract the downloaded .rar ROM file, then again, extract rooted.tar and go into that directory. And lets flash our system image (around 900mb).

If everything is fine it should look like this:

Code:
[email protected]:~/Downloads/rooted# heimdall flash --20 system.img 
Heimdall v1.3.1, Copyright (c) 2010-2011, 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...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Checking if protocol is initialised...
Protocol is not initialised.
Initialising protocol...
Handshaking with Loke...

Beginning session...
Session begun with device of type: 131072

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

Uploading SYSTEM
100%
SYSTEM upload successful
Ending session...
Rebooting device...
Re-attaching kernel driver...

Do not touch your PC while flashing. Do not move the phone. Do not fiddle with the cables. Hold your breath and wait. If all is fine, the phone should turn off itself. Wait until you get charging screen, then turn it back on.

You should have supersu installed. You can also install terminal emulator and try running su to make sure you have the root.

Congrats on having root!
 

WarioNeila86

Senior Member
Feb 8, 2012
95
14
Madrid
Hi dudes,

I have mi SGS2 soft bricked and I'm trying to recover it.
I've already opened a post here.

The thing is that I have discovered Heimdall by chance.
Fed up with the errors from Odin I decided to try in Linux.

I think my System partition is missing.
Find attached my result for heimdall print-pit.


Hope you can help me.

Regards,
Mario.
 

Attachments

  • heimdall-print-pit.txt
    4.6 KB · Views: 238

pminervini

Member
Jun 8, 2013
6
0
Thanks! (But should I backup something first?)

Thanks, exactly what I was looking for :)

One quick question: by rooting with Heimdall (on Linux), will I loose all my apps/accounts ? (It will take ages to recover them all..)

(also, where could I get updated as new Heimdall-friendly firmwares become available?)

Thank you again for your time.

Hey.

Just wanted to share my rooting experience.

My girlfriend just bought her S3 mini few days ago - and because Samsung Dive sucks balls (can be erased by doing factory reset), I felt the need to root, so cerberus anti-theft (http://cerberusapp.com, try it out, its awesome) could be written to /system (which requires root & survives factory resets).

Because I use Ubuntu Linux, I couldn't use Odin. Also from what I've read Odin reflashes whole phone, including bootloaders, recovery images and so on.

Because I've had XXALJL build originally in my phone, I've used this uk rooted rom as my rooting source.

Also, because the baseband is identical, I only flashed the system image, where /system/bin/su resides.

If you have a different baseband than your rooted image, this guide will not help you and you probably need to either: a) use odin to reflash everything. b) use your brain to figure your what to flash and where.

So here we go!

Flashing

I'm using ubuntu 12.10, 64 bit:

Code:
[email protected]:~/Downloads/rooted# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.10
DISTRIB_CODENAME=quantal
DISTRIB_DESCRIPTION="Ubuntu 12.10"

Code:
[email protected]:~/Downloads/rooted# uname -a
Linux cyrix 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

The only thing you should be concerned about is whether you're using 32 or 64 bit OS.

I've used heimdall 1.3.1, because 1.3.2 has issues and I didn't want to risk. Perhaps 1.3.2 or 1.4-RC1 would work just fine too, but I've used 1.3.1 and that did work for me.

Get heimdall 1.3.1 from http://www.glassechidna.com.au/products/heimdall/ (choose 32 bit (i386) or 64 bit (x64) debian package appropriately). Install those. And lets get down to bussiness.

I RECOMMEND RUNNING ALL COMMANDS FROM ROOT USER

Some guides recommend rebooting your pc after heimdall install (it inserts some udev rules). I didn't do that (completely forgot), but do it, just to be on a safe side.

So first step is to determine what partition identifier does your system partition has. Put your device into download mode (power off. Then hold vol down + home + power & click vol up once).

After doing that, connect your usb cable to computer and run:

Code:
# heimdall detect

It should say:

Code:
Device detected

If it doesn't - none of the following commands will probably work.

Then - lets see what our PIT (partition information table? not sure about the acronym) looks like:

Code:
# heimdall print-pit

What we are looking for is system partition. Mine looked like this:

Code:
--- Entry #21 ---
Unused: No
Partition Type: 2 (EXT4)
Partition Identifier: 20
Partition Flags: 5 (R)
Unknown 1: 5
Partition Block Size: 524288
Partition Block Count: 2457600
Unknown 2: 0
Unknown 3: 0
Partition Name: SYSTEM
Filename: system.img

From this we can see that our partition identifier is 20.

So extract the downloaded .rar ROM file, then again, extract rooted.tar and go into that directory. And lets flash our system image (around 900mb).

If everything is fine it should look like this:

Code:
[email protected]:~/Downloads/rooted# heimdall flash --20 system.img 
Heimdall v1.3.1, Copyright (c) 2010-2011, 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...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Checking if protocol is initialised...
Protocol is not initialised.
Initialising protocol...
Handshaking with Loke...

Beginning session...
Session begun with device of type: 131072

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

Uploading SYSTEM
100%
SYSTEM upload successful
Ending session...
Rebooting device...
Re-attaching kernel driver...

Do not touch your PC while flashing. Do not move the phone. Do not fiddle with the cables. Hold your breath and wait. If all is fine, the phone should turn off itself. Wait until you get charging screen, then turn it back on.

You should have supersu installed. You can also install terminal emulator and try running su to make sure you have the root.

Congrats on having root!
 
Last edited:

arturaz

Member
Dec 25, 2010
8
18
Thanks, exactly what I was looking for :)

One quick question: by rooting with Heimdall (on Linux), will I loose all my apps/accounts ? (It will take ages to recover them all..)

(also, where could I get updated as new Heimdall-friendly firmwares become available?)

Thank you again for your time.

This only rewrites /system partition, while all your apps/accounts are stored in /data. So in theory you shouldn't lose things. However I do recommend you always backup your stuff with `adb backup` before doing this. You can never be too sure.

As for new firmwares - no idea. OTAs should probably work.
 
  • Like
Reactions: pminervini

pminervini

Member
Jun 8, 2013
6
0
Thanks :) For the other Debian guys out there, I've just found out "adb" comes available for Sid ( packages debian org /sid/android-tools-adb -- there is a similar package in the Ubuntu repos) and requires MTP mode with USB debug on: bernaerts dyndns org /linux/245-ubuntu-precise-install-android-sdk

While the backup goes on (I'm doing "adb backup -apk -shared -all -f 08062013.ab", hope it's right), I'm looking for the right image file.

May this one fit? "Android 4.1.2 XXAMD3 official firmware"
www hotfile com /dl/209515302/bd1d1a3/I8190XXAMD3_I8190OXAAMD3_DBT.zip.html

UPDATE: no it's not, i should look for something fitting GT-I8190N; checking what I can do from OTA..
UPDATE 2: I've found this file: GT-I8190N-BTU-I8190NXXALL6-1356151513.rar ; I'm going to try to push its system.img with heimdall :) *crossed fingers*

Thank you again for all your help, you're awesome!

This only rewrites /system partition, while all your apps/accounts are stored in /data. So in theory you shouldn't lose things. However I do recommend you always backup your stuff with `adb backup` before doing this. You can never be too sure.

As for new firmwares - no idea. OTAs should probably work.
 
Last edited:

pminervini

Member
Jun 8, 2013
6
0
After a weekend trying to revive the I8190N (at least it was raining..) I tried to sum up my problem with Heimdall here:
forum xda-developers com/showthread.php?t=2317198

Thanks :) For the other Debian guys out there, I've just found out "adb" comes available for Sid ( packages debian org /sid/android-tools-adb -- there is a similar package in the Ubuntu repos) and requires MTP mode with USB debug on: bernaerts dyndns org /linux/245-ubuntu-precise-install-android-sdk

While the backup goes on (I'm doing "adb backup -apk -shared -all -f 08062013.ab", hope it's right), I'm looking for the right image file.

May this one fit? "Android 4.1.2 XXAMD3 official firmware"
www hotfile com /dl/209515302/bd1d1a3/I8190XXAMD3_I8190OXAAMD3_DBT.zip.html

UPDATE: no it's not, i should look for something fitting GT-I8190N; checking what I can do from OTA..
UPDATE 2: I've found this file: GT-I8190N-BTU-I8190NXXALL6-1356151513.rar ; I'm going to try to push its system.img with heimdall :) *crossed fingers*

Thank you again for all your help, you're awesome!
 
Just wanted to share my rooting experience....
Thank you, arturaz!

Why did I waste so much of my valuable lifetime by trying to get Odin to work on XP/W7 in a VBox? :mad:

Gonna donate to Benjamin now. He really deserves a beer or two ;)

BTW: heimdall can be found in the Debian testing branch now. Look out for "heimdall-flash" (Don't be confused by some "heimdal"-packages [only one 'L'], which are something completely different)
 

lov8

New member
Dec 30, 2013
3
0
Paris
Hey I'm using Linux Mint 32bits, I wonder if I can use the ubuntu 32 version for the software Heimdall ? if so, which one ?

Thanks
 
Last edited:

Clostry

Senior Member
Jan 7, 2014
72
14
Alternatively you can root your phone by flashing a custom recovery using heimdall, then going in recovery mode and installing supersu.

Tested with heimdall 1.40 and TWRP custom recovery, worked fine.
You have just to pay attention and find the right partition id for flashing "recovery.img".
 
Last edited:

Clostry

Senior Member
Jan 7, 2014
72
14
Can you post the output of this commands? With phone in download mode attached ofc.
Code:
lsusb
heimdall  detect  --usb-log-level debug
 

francesco.ro79

New member
Jan 22, 2014
3
0
heimdall tar gz error

When I try to load the system.img file (from cm10.2_golden.maclaw.20140118.ODIN_TWRP.tar.md5) from heimdall, before beginning to flash, I get the following error: Tar header contained an invalid file size.
I tried to load the uncopressed file too, then the file cm10.2_golden.maclaw.20140119.zip not for odin and I get the same error, what am I doing of wrong?
Thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Hey.

    Just wanted to share my rooting experience.

    My girlfriend just bought her S3 mini few days ago - and because Samsung Dive sucks balls (can be erased by doing factory reset), I felt the need to root, so cerberus anti-theft (http://cerberusapp.com, try it out, its awesome) could be written to /system (which requires root & survives factory resets).

    Because I use Ubuntu Linux, I couldn't use Odin. Also from what I've read Odin reflashes whole phone, including bootloaders, recovery images and so on.

    Because I've had XXALJL build originally in my phone, I've used this uk rooted rom as my rooting source.

    Also, because the baseband is identical, I only flashed the system image, where /system/bin/su resides.

    If you have a different baseband than your rooted image, this guide will not help you and you probably need to either: a) use odin to reflash everything. b) use your brain to figure your what to flash and where.

    So here we go!

    Flashing

    I'm using ubuntu 12.10, 64 bit:

    Code:
    [email protected]:~/Downloads/rooted# cat /etc/lsb-release 
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=12.10
    DISTRIB_CODENAME=quantal
    DISTRIB_DESCRIPTION="Ubuntu 12.10"

    Code:
    [email protected]:~/Downloads/rooted# uname -a
    Linux cyrix 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

    The only thing you should be concerned about is whether you're using 32 or 64 bit OS.

    I've used heimdall 1.3.1, because 1.3.2 has issues and I didn't want to risk. Perhaps 1.3.2 or 1.4-RC1 would work just fine too, but I've used 1.3.1 and that did work for me.

    Get heimdall 1.3.1 from http://www.glassechidna.com.au/products/heimdall/ (choose 32 bit (i386) or 64 bit (x64) debian package appropriately). Install those. And lets get down to bussiness.

    I RECOMMEND RUNNING ALL COMMANDS FROM ROOT USER

    Some guides recommend rebooting your pc after heimdall install (it inserts some udev rules). I didn't do that (completely forgot), but do it, just to be on a safe side.

    So first step is to determine what partition identifier does your system partition has. Put your device into download mode (power off. Then hold vol down + home + power & click vol up once).

    After doing that, connect your usb cable to computer and run:

    Code:
    # heimdall detect

    It should say:

    Code:
    Device detected

    If it doesn't - none of the following commands will probably work.

    Then - lets see what our PIT (partition information table? not sure about the acronym) looks like:

    Code:
    # heimdall print-pit

    What we are looking for is system partition. Mine looked like this:

    Code:
    --- Entry #21 ---
    Unused: No
    Partition Type: 2 (EXT4)
    Partition Identifier: 20
    Partition Flags: 5 (R)
    Unknown 1: 5
    Partition Block Size: 524288
    Partition Block Count: 2457600
    Unknown 2: 0
    Unknown 3: 0
    Partition Name: SYSTEM
    Filename: system.img

    From this we can see that our partition identifier is 20.

    So extract the downloaded .rar ROM file, then again, extract rooted.tar and go into that directory. And lets flash our system image (around 900mb).

    If everything is fine it should look like this:

    Code:
    [email protected]:~/Downloads/rooted# heimdall flash --20 system.img 
    Heimdall v1.3.1, Copyright (c) 2010-2011, 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...
    Attempt failed. Detaching driver...
    Claiming interface again...
    Setting up interface...
    
    Checking if protocol is initialised...
    Protocol is not initialised.
    Initialising protocol...
    Handshaking with Loke...
    
    Beginning session...
    Session begun with device of type: 131072
    
    Downloading device's PIT file...
    PIT file download sucessful
    
    Uploading SYSTEM
    100%
    SYSTEM upload successful
    Ending session...
    Rebooting device...
    Re-attaching kernel driver...

    Do not touch your PC while flashing. Do not move the phone. Do not fiddle with the cables. Hold your breath and wait. If all is fine, the phone should turn off itself. Wait until you get charging screen, then turn it back on.

    You should have supersu installed. You can also install terminal emulator and try running su to make sure you have the root.

    Congrats on having root!
    1
    Thanks, exactly what I was looking for :)

    One quick question: by rooting with Heimdall (on Linux), will I loose all my apps/accounts ? (It will take ages to recover them all..)

    (also, where could I get updated as new Heimdall-friendly firmwares become available?)

    Thank you again for your time.

    This only rewrites /system partition, while all your apps/accounts are stored in /data. So in theory you shouldn't lose things. However I do recommend you always backup your stuff with `adb backup` before doing this. You can never be too sure.

    As for new firmwares - no idea. OTAs should probably work.