1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to Root using Ubuntu

Discussion in 'Android Devices' started by SupraLance, Dec 12, 2010.

  1. SupraLance

    SupraLance Well-Known Member
    Thread Starter

    Rooting is no longer necessary if going directly to CM7 or newer custom ROM via Odin/Heimdall, athough you will need ADB (steps 1-4). AFTER STEP 4, skip to Post 3.

    Backup your data before starting, just in case.

    1. Get ADB set up on your computer.
    -Download the Android-SDK for linux. [This is the development package for Android]
    -Extract the /tools directory to your desktop. [You may have to install 7zip onto your computer first. It's in the Ubuntu repositories.]
    -Make directory "bin" and move the ADB executable to there:
    mkdir -p ~/bin
    mv ~/Desktop/tools/adb ~/bin/

    2. Gather some Information
    -On your phone, go to Settings-Applications-Development and check USB debugging.
    -Plug your phone into the computer. [*Regular mode, not download mode]
    -On computer, in Terminal, type "lsusb" without the quotes
    One of the output lines should be similar to this:
    "Bus 001 Device 002: ID 04e8:681c Samsung Electronics Co., Ltd"
    -Write down the first 4 characters after ID. These are the Vendor ID (in this example, 04e8). The Bus & Device will be different each time you plug/unplug the phone or restart the computer.
    -In Terminal, type "ID" without the quotes to get your user name and group name if you are unsure what these are

    3. Set a Udev rule so you can use ADB
    -Open a text editor as root. In Terminal with Kubuntu, this is "kdesudo kate".
    -Paste the following line into the text editor and then modify:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="<your phone's vendor ID>", OWNER="<your username>" GROUP="<your group name>"
    For the Fascinate in the example above, "<your phone's vendor ID>" is replaced with "04e8". You keep the quotes but get rid of the <> when you put in your information.
    -Save this file as "etc/udev/rules.d/51-android.rules"
    -Also save file as "lib/udev/rules.d/51-android.rules"
    [Note: you actually only need 1 of these, but which one varies from system to system]
    -In Terminal, cd to etc/udev/rules.d and type "ls" to verify your new file is there. Also check lib/udev/rules.d.
    -Restart udev or entire computer to get this to take effect
    [Note- some instructions suggest setting a udev.rule that gives permissions 0666 which grants permissions to the entire world. My way only gives permissions to the one user who needs them, which is safer. The rule priority number 51 is somewhat arbitrary and other numbers will work.]

    4. Check your work
    -In Terminal, type "lsusb" like you did earlier
    One of the output lines should be similar to this:
    "Bus 001 Device 002: ID 04e8:681c Samsung Electronics Co., Ltd"
    -This time, you are interested in the numbers after Bus & Device, which have probably changed from earlier if you restarted your computer.
    -In Terminal, type "ls -l /dev/bus/usb/001/002" EXCEPT 001/002 is Bus/Device from the example above, substitute Bus/Device numbers from your "lsusb" output line.
    -If the output line you get includes your username and groupname rather than "root root" you may continue. Otherwise reread and repeat Steps 2 & 3.
    -*Make sure your phone is still in USB debugging mode. There should be a red triangle with an exclamation point in the status bar of the phone.
    -In Terminal, type "sudo adb devices" [*sudo is only needed the first time you run adb.]
    You should see your phone listed.

    THE REMAINING STEPS ARE OUTDATED and still here for historic reference only.

    5. Download the Root Package (No Longer Available)
    Driver downloads are not needed for Linux.

    6. Extract the 4 files to
    This is the folder you created in Step 1 and should have ADB in it already.You can extract to the desktop and then move as you did in step 1.

    7. Move into the /bin directory and verify.

    In Terminal, type "cd bin" and then "ls" to make sure all 5 files are there.

    8. Push these files to the phone and run the root:
    In Terminal, copy and paste each following line one at a time (press enter after each line):

    adb push su /sdcard/su
    adb push rage.bin /data/local/tmp/rage.bin
    adb push busybox /sdcard/busybox
    adb shell
    [Note: this should change your prompt to just a $ because now you are remotely on your phone]
    cd /data/local/tmp
    chmod 0755 rage.bin

    [Note: This will check the process limit, find the ADB process number, and then spawn processes to reach this limit. It will return you quickly to a $ prompt, but IS NOT DONE. WAIT for a line similar to "[+] Forked 3705 childs." and it to kick you back to your home directory prompt. The first time I ran it my phone got an email while it was running and locked up. After 20 minutes I closed the Terminal and restarted Step 8. This time it completed in less than a minute.]

    9. Make the Root permanent
    -In Terminal and back in your /bin directory, type "adb shell"
    This time you should get a # prompt instead of a $ prompt. This means you are remotely on your phone as root.
    -Copy and paste each following line one at a time (press enter after each line):

    mount -t rfs -o remount,rw /dev/block/stl9 /system
    cd /system/xbin
    cat /sdcard/su > su
    cat /sdcard/busybox > busybox
    chmod 4755 su
    chmod 4755 busybox
    adb install Superuser.apk

    10. Verify you have root.
    -Restart phone.
    -In terminal, type "adb shell"
    You should get a $ prompt
    -In terminal, type "su"
    A popup should appear on the phone asking for superuser permissions.
    When granted, the shell prompt should change to #

    When you install and run a program which requires root, the same pop-up should appear to request root access. Then when you open SuperUser, it should list the programs that have been granted root access.

    Foxcow, OMJ, saps and 2 others like this.
  2. SupraLance

    SupraLance Well-Known Member
    Thread Starter

    Next step, Install CWM.

    THIS STEP IS OUTDATED and still here for historic reference only. Newer CWM is required and it is best to install through Heimdall.

    "This information is extracted from this thread at xda.

    ClockworkMod image for the Fascinate
    Unzip this file into 3 files
    -Copy zImage from .zip file to your sdcard.
    -Unmount your phone from the computer.
    -Copy redbend_ua to your /bin folder from Root instructions above
    -In Terminal, type &quot;cd bin&quot; and then &quot;ls&quot;
    You should see redbend_ua listed.

    -From the /bin directory, Copy & Paste each of the following lines:

    adb push redbend_ua /data/local

    adb shell
    chmod 755 /data/local/redbend_ua
    /data/local/redbend_ua restore /sdcard/zImage /dev/block/bml7
    [Note: phone will reboot after this commmand and kick you out of shell]
    adb shell
    /data/local/redbend_ua restore /sdcard/zImage /dev/block/bml8
    [Note: again phone will reboot and kick you out.]


    -Select &quot;Flash ClockworkMod Recovery&quot;
    -Select &quot;Fascinate&quot;
    -Grant SuperUser when it asks"
    Foxcow, OMJ, dan409 and 2 others like this.
  3. SupraLance

    SupraLance Well-Known Member
    Thread Starter

    Next up, Installing Heimdall (Open Source Odin)

    You need Odin, or an equivalent, to install the DJ05 modem or any rom not packaged as a .zip for CWM. You also need this as insurance in case you soft brick.

    Odin is a leaked Samsung program never meant for public consumption and runs only in Windows. It won't run in Linux under Wine, but will run through VirtualBox with some modifications to see the USB.... http://androidforums.com/samsung-i7500/59070-odin-gnu-linux.html If your not familiar with VirtualBox, it does not emulate Windows. It runs an actual copy of Windows inside Linux. You have to have a licensed copy of Windows available for this.

    There is an open source alternative that works on Linux and Mac's as well. It's called Heimdall, and has been in testing at XDA (see this thread for Beta versions) for several months now. Read about it more and download the latest stable version here: Heimdall – Glass Echidna.

    For Ubuntu, you will need the .deb packages in the above links. Opening .deb packaged in Kubuntu (and I assume Ubuntu) automatically installs the program. If you are also installing the front-end, be sure to install the base Heimdall first. After installation, the front-end can be opened by running command "heimdall-front-end". Readme files can be found in /usr/share/doc/heimdall-fronted.


    I prefer the Command line version, and actually only needed 1 quick command to get a new fascinate to MIUI. I simply downloaded JT's version of CWM 4.0 for Odin, pulled the recovery.bin from there to my /bin directory from step 1 of post 1, and used the command "heimdall flash --recovery recovery.bin --no-reboot" to get the new CWM onto the phone. Then I used the 3-button reboot to CWM, and flashed the MIUI .zip.
    Foxcow, androidman78, OMJ and 3 others like this.
  4. Frisco

    Frisco =Luceat Lux Vestra=

    Very nicely done, SupraLance.

    Added to the Root Guide sticky.
  5. saps

    saps Extreme Android User

    Excellent SupraLance one stop shopping :)
  6. androidman78

    androidman78 Lurker

    I am no stranger to ADB for windows. But setting ADB up in LINUX based laptop is a problem....I followed these instructions to a "T"....and nodda. What am I missing?
    I have read tons of posts on UDEV rules from ANDROIDFORUMS to XDA and nothing "SEEMS" to work?? I know a bit about LINUX and am running KUBUNTU 10.10 {fresh install}haven taken updates but after this is next step. Did everything you said SupraLance and get all the outputs you stated and still ADB will not see device..?? ADB is in /bin and i created rules as stated in "/etc/udev/rules.d and "/lib/udev/rules.d have rebooted and lsusb sees----THIS---

    Bus 001 Device 002: ID 04e8:681d Samsung Electronics Co., Ltd Galaxy Portal/Spica Android Phone

    So then I do this and should see my ID and GROUP info.....I do

    dan@dan:~/Desktop/android-sdk-linux_86/tools$ ls -l /dev/bus/usb/001/002
    crw-rw-r-- 1 dan dan 189, 1 2010-12-14 14:20 /dev/bus/usb/001/002

    Next is to start ADB and see my device as I should by what the post says...

    dan@dan:~/Desktop/android-sdk-linux_86/tools$ adb devices
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    List of devices attached

    NOTHING?????So try running ADB as SUDO like some posts say....

    dan@dan-:~/Desktop/android-sdk-linux_86/tools$ adb kill-server
    dan@dan-:~/Desktop/android-sdk-linux_86/tools$ sudo adb devices
    [sudo] password for dan:
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    List of devices attached

    Still nothing??? What piece of the puzzle am I missing?? I have tried all variations of different rules to no avail. I set rules and reboot each time to be sure they take effect. The phone is an SCH-I500 Mesmerize Rooted not a Fascinate but for all purposes hardware is Identacle just different software and all the IDs are the same and I have doublechecked this....Can someone please HELP me and let me know what is wrong? As stated above am on fresh nonUDed Kubuntu 10.10 and everything up to seeing an ADB device is working and installed correct....PLEASE HELP>>>THANKS in advance....:thinking:
  7. OMJ

    OMJ Bazinga

    great post thanks supra
  8. SupraLance

    SupraLance Well-Known Member
    Thread Starter

    Are you getting "????????? no permissions" or just no devices listed?

    If nothing is listed after "List of devices attached", This would mean that linux can see your phone plugged into the usb but adb can either not see or is not recognizing it. This will happen if you missed the first step of #2 and your phone is not in USB debugging mode. It will also happen if your phone is in Download mode. It should be in regular phone mode but with USB debugging checked under apps/development. There should be a red triangle with an exclamation point in it on your phone's status bar. First post edited to make this clearer.

    If you are getting the error "??????? no permissions", Adb probably is not running as root on your computer. We know you have phone permissions from the "ls -l /dev/bus/usb/001/002" output.

    You are correct that "adb devices" should be ran as "sudo adb devices" the first time you run adb. Adb should automatically run as root after the first time, but getting it to run as root that first time can be tricky. First post edited to include this.

    The only thing I see different on your "lsusb" output is the "Galaxy Portal/Spica Android Phone" listed at the end after "Ltd". With the Fascinate in regular mode, there is nothing listed after "Ltd". If I put the Fascinate in download mode, I get "Z100 Mobile Phone" after the "Ltd". First post edited to show my full "lsusb" output.
    androidman78 likes this.
  9. androidman78

    androidman78 Lurker

    well new twist in red recovery reset adbd and now had to recheck usb debug but now permissions are ROOT ROOT what now and my lsusb changed to nothing after the samsung....going to keep at this and retry steps 2&3 to se what my be needed see what you think I should do now...when adb starts i get "??????????? no permissions" what to do?
  10. SupraLance

    SupraLance Well-Known Member
    Thread Starter

    If permissions are ROOT ROOT then the udev/rules.d you set is not being applied to the phone. Is your rule still there in /udev/rules.d ? Are you still logged in as the same user? Is the phone's vendor ID displayed after lsusb still matching the one in the udev/rules.d?
    androidman78 likes this.
  11. androidman78

    androidman78 Lurker

    OK got it....2 LONG DAYS.... was missing the part about doing an adbd reset in red recovery because im running a voodoo kernel...may want to add this as it was a point that "tripped" me up following your post to a T..... Also changed platform to 10.4 out of frustration and didnt need to Linux is Linux....only syntax can change in my case it did and in 10.4 you use ATTRS and not SYSFS but if, Im running 10.10 need SYSFS...so not sure on what platforms you need SYSFS or ATTR or ATTRS...can you clarify if you know and what are all 3 -- last 4 alfanumeric code of the device id...ie...04e8:681d was for one mode and 04e8:681c was for another and not sure of third ? My device is an USCC i500 mesmerize and not a VZW i500 fascinate but it does not matter same HW just different SW device ids are the same.....99.9%sure at least...Thank you SupraLance for supporting you post. I want to change to platform that runs best on somewhat outdated laptop I have for Linux only Dev computer and that was Linux mint 9 not sure if that uses SYSFS or ATTRS for udev rule will get it now that i got RED RECOVERY ISSUE with adbd reset because without that your post works ot a T, and does not show device...of course I was using this post to set udev rules only and not root so... my bad that would have never been an issue otherwise....can you please help with the 2 last questions if you can......3 IDS as I may want a custom udev rule set and SYSFS OR ATTRS what platforms/syntax question? as many post vary on what syntax to use...if that is too broad a Q can you keep it as to LINUX Mint 9 LDXE -(isadora).... THANKS SUPRALANCE
  12. SupraLance

    SupraLance Well-Known Member
    Thread Starter

    SCH I-500 Fascinate "lsusb" output lines: (Mesmerize probably the same)
    In USB debugging mode:
    "Bus 001 Device 021: ID 04e8:681c Samsung Electronics Co., Ltd"
    In regular, non-debug mode:
    "Bus 001 Device 025: ID 04e8:681d Samsung Electronics Co., Ltd"
    In download mode:
    "Bus 001 Device 022: ID 04e8:6601 Samsung Electronics Co., Ltd Z100 Mobile Phone"
    Not seen in recovery mode.

    I'm afraid I am less familiar with other Distro's than you are. I'm actually a Noob to most of this, just well researched in this narrow area. I wrote this as I rooted my first Android device. [Which is now on Stupidfast DJ05 with Heimdall as a safety net, having never been violated by a Windows device :) ]. I've read quite a bit about Voodoo, but have never used it, so not familiar with the requirement to reset adbd.
    androidman78 likes this.
  13. androidman78

    androidman78 Lurker

    Thankyou for your input may want to review and use whats been gone over in this post as another use for it may help others just trying to setup adb in linux distro's as was my case...Thank You again hope some of this may help another in the future...
  14. Foxcow

    Foxcow Well-Known Member

    Excellent! Thank you very much.
  15. Foxcow

    Foxcow Well-Known Member

    I do have one question though. In the Clockwork recovery file, redbend_ua is not present. I check the XDA thread and got the file from there but it wasn't listed in there either.

    Is the file necessary?
  16. robob686

    robob686 Lurker

    Hey, just used this thread to root (but not flash anything...). Works great! Thanks Supra!


    I actually didn't get clockwork from this thread (so I didn't outright get redbend_ua). I mixed and matched the threads a little. I got the "all in one" tar file from xda-forums, untarred it, then flashed the modem and clockwork through heimdall. This is done with something like "heimdall --recovery recovery.bin". Put the update.zip (from some CWM version, you can find one online) on your SD card before you flash clockwork, then after flashing both of those, boot into recovery and install it.

    Hope this answers your question...
    Foxcow likes this.
  17. Foxcow

    Foxcow Well-Known Member

    Thanks for the response. I will give this a shot tonight.
  18. grondinm

    grondinm Lurker

    hello guys. i am new the the android sceen.(actually dont have my phone yet) doing so preliminary reading. i am in canada with telus. if i remember right from my winmo modding days these things are all very device/carrier independent so will this work with my telus fascinate? i'm pretty sure the first part will work but the Clockworkmod will it work with a telus phone?
  19. Moqtada

    Moqtada Lurker

    So I am using Ubuntu, and have been reading constantly trying to figure this out. I found this thread and it seems the most promising, but I am getting hung up on something that may be trivial.

    I am a noob so please bare with me.

    I open
    Code (Text):
    1.  $ sudo gedit
    type in
    Code (Text):
    1. SUBSYSTEM=="usb", SYSFS{idVendor}=="048e", OWNER="MYNAME" GROUP="adm"
    of course substituting my real username for MYNAME

    then I try to save as: etc/udev/rules.d/51-android.rules

    but my computer wont let me save the file, I believe it doesn't recognise the ending ".rules"

    can anyone help?
    sorry if this is too noob.
  20. robob686

    robob686 Lurker

    I am by no means an expert on this, but try getting root access first with
    Code (Text):
    1. sudo -s
    put your password in, and then create the file and save it...

    Also, what error message are you getting (verbatum, please).
  21. Foxcow

    Foxcow Well-Known Member

    When using gedit, its recommended that you use gksudo.

    "gksudo gedit"

    Are you trying to save the file from gedit and it still doesn't work? If so, save the file to the desktop, in the terminal type "gksudo nautilus" so you can open nautilus with root privileges, navigate to the specified directories and place the file there.

    Hope this helps.
  22. Foxcow

    Foxcow Well-Known Member

    I'd like to confirm that the original poster's method does work for stock 2.2. It took me about 10 minutes.
  23. anderlan

    anderlan Lurker

    I too confirm that the method at the top works on my Fascinate after OTA update 2.2 ED01. WOOTS!

    Fascinate ED01 Root Linux !!!
    Ubuntu Fascinate Froyo ED01 Root !!!

    I added those 2 lines so that Fascinate owners who use Ubuntu or Linux will be able to find this page! There are some "throw your hand over your shoulder to wipe your butt" style methods that I found for Windows which are tricky and actually wipe your data. Unlike the procedure at the top above is what I used with my first 2.1 build on the Fascinate and it still works, and as you would expect from any rooting process, keeps your data! Again, woohooo!
  24. Foxcow

    Foxcow Well-Known Member


    After getting the update (ED04) last night, I had to re-root today. After rooting, I did get another prompt to update again. The baseband version, however, is displayed as ED04 in phone settings.

    Did anyone else experience this?
  25. marty331

    marty331 Newbie

    I used this process last night to root my Samsung Infuse. It worked beautifully!

Samsung Fascinate Forum

The Samsung Fascinate release date was Q3 2010. Features and Specs include a 4.0" inch screen, 5MP camera, GB RAM, Hummingbird processor, and 1500mAh battery.

Q3 2010
Release Date

Share This Page