[Guide] Rooting the Nexus S 4G, with Linux

igotsanevo4g

Retired Moderator
Jul 31, 2010
3,396
601
113
Visit site
[WARN]I'm not responsible for what you do to your phone, yadda yadda, you know the drill[/WARN]

Its pretty straight forward, lets get to it. 2 options: easy, and involved.​

[NOTE]This is the hard way, scroll down if it's not for you.[/NOTE]
1. Set up the working AndroidSDK. We have a guide for that also, AndroidSDK linux

2. Add packages buy doing either - Navigating to your AndroidSDK folder, going to the 'tools' folder and double-clicking the file called 'android'; if a popup opens asking you what you want to do with it click 'Run'.

- Using this command: /home/<your-user-name>/Downloads/AndroidSDK/tools/android

3. Then, In Android SDK and AVD Manager, click on "Available packages". Check the box next to "Android SDK Tools, revision 8" and "Android SDK Platform-tools", and click on "Install Selected" then "Install". When prompted click "Yes" to restart ADB.

You should now have a folder in /home/<your-user-name>/Downloads/AndroidSDK/ called "platform-tools".

4. Now we put fastboot (in the stuffs zip attached here, grab both fastboot files) in the previously mentioned platform-tools folder then navigate to the file, right click it, click 'Properties', go to the 'Permissions' Tab and check 'Allow executing file as program'. OR use this command "chmod +x /home/<your-user-name>/Downloads/AndroidSDK/platform-tools/fastboot"

5. Now to set things up so adb and fastboot recognize your Nexus.

- Type this command into a terminal:
gksudo gedit /etc/udev/rules.d/51-android.rules

- Paste this into the blank file:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"

- Click save and close.
- Then, type the following terminal command:
sudo restart udev

6. Now we set up a path, enter:
gedit .bashrc

And add this line to the top of the file, filling in what yours really is:
#AndroidDev PATH
export PATH=${PATH}:/home/<your-user-name>/Downloads/AndroidSDK/tools:/home/<your-user-name>/Downloads/AndroidSDK/platform-tools

Save and close

7. On your Nexus S, go to Menu>Settings>Applications. Select "Development" and check the box next to "USB debugging" Power off the phone, and then hold down the Volume Up button and the Power button simultaneously to get into Bootloader/Fastboot mode. Connect your Nexus to the computer via USB.

8. Run fastboot oem unlock, and viola. Your bootloader is unlocked after confirming on screen.

9. Flash a recovery by: fastboot flash recovery /home/<your-user-name>/AndroidSDK/platform-tools/name-of-recovery.img

10. Flash the super user zip. -DONE
Credit
[NOTE]Time for the easy way now![/NOTE]

1. Turn off your nexus s, boot into fastboot mode by holding down both Volume Down and Power buttons together. Once in fastboot mode, connect your Nexus S/Nexus S 4G to your computer via micro-USB cable.

2. Download this nexussrootICS zip Download NexusS/rooting/nexussrootICS.zip at DownloadAndroidROM.com and un-zip the file

3. Navigate to the nexussrootICS that you just un-zipped in command (cd /nexussrootICS)

4. Then enter ./fastboot-linux oem unlock and agree to unlock your bootloader

5. Now enter ./fastboot-linux flash recovery twrp-crespo4g-2.0.0RC0.img to flash a recovery

6. Flash the super user zip and youre rooted!
credit
 

6tr6tr

Well-known member
Dec 29, 2009
1,211
14
0
Visit site
What's the benefits or drawbacks of each approach? What does the hard way offer that the easy way doesn't?

Thanks!
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
What do you mean "flash the superuser.zip"? How do I flash it?

After performing the image flash of CWM from the fastboot command, from your bootloader screen select RECOVERY. This will boot you into CWM recovery.

Then flash the Superuser.zip file in CWM (Install zip from sdcard).

Select reboot from the CWM menu and enjoy.. Rooted with CWM installed. Verify by looking for the Superuser app in your application list.
 

6tr6tr

Well-known member
Dec 29, 2009
1,211
14
0
Visit site
After performing the image flash of CWM from the fastboot command, from your bootloader screen select RECOVERY. This will boot you into CWM recovery.

Then flash the Superuser.zip file in CWM (Install zip from sdcard).

Select reboot from the CWM menu and enjoy.. Rooted with CWM installed. Verify by looking for the Superuser app in your application list.

Right, but how do I get superuser.zip on the device? Do I just hook in via USB and drag it into correct folder? Where do I put it?
 

6tr6tr

Well-known member
Dec 29, 2009
1,211
14
0
Visit site
After performing the image flash of CWM from the fastboot command, from your bootloader screen select RECOVERY. This will boot you into CWM recovery.

Then flash the Superuser.zip file in CWM (Install zip from sdcard).

Select reboot from the CWM menu and enjoy.. Rooted with CWM installed. Verify by looking for the Superuser app in your application list.

I think something's wrong with your instructions. It doesn't work. :(

I did exactly as you say:

1. flash recovery (this works)

2. Start CWM by choosing recovery (this works)

3. Now at this point I tried two things because neither one worked:
a. from desktop: fastboot superuser.zip superuser.zip (this throws an error: "FAILED (remote: Unknown Partition)")
b. Choose install from zip in CWM - but there is no zip! It's not on the device yet!
 

6tr6tr

Well-known member
Dec 29, 2009
1,211
14
0
Visit site
OK, I solved it by doing:

1. Install recovery
2. Start CWM
3. On desktop, use adb to send super user zip over:
adb push SuperUser.zip /sdcard
4. Install zip in CWM
 

Paul627g

AC Moderator All-Star
Moderator
Nov 25, 2010
15,963
2,752
0
Visit site
I think something's wrong with your instructions. It doesn't work. :(

I did exactly as you say:

1. flash recovery (this works)

2. Start CWM by choosing recovery (this works)

3. Now at this point I tried two things because neither one worked:
a. from desktop: fastboot superuser.zip superuser.zip (this throws an error: "FAILED (remote: Unknown Partition)")
b. Choose install from zip in CWM - but there is no zip! It's not on the device yet!

Ya I gotcha, the instructions probably weren't clear enough..

1. Flash the CWM recovery via fastboot command.
2. Boot into your CWM recovery from the "RECOVERY" option in the bootloader.
3. Choose MOUNTS & STORAGE then USB or SDCARD option to connect your computer & device and move the Superuser.zip file over to the device.
3b. Do as you said and push the superuser.zip file via ADB like you mentioned ;)
4. Flash the superuser.zip file in CWM recovery.
5. DONE

You were confused with the fastboot command. You only use the fastboot command to push the CWM recovery image to the device, from there you flash the superuser.zip file in CWM.

Anyhow you figured it out, thumbs up!
 

Jake Robb

New member
May 18, 2013
2
0
0
Visit site
Hi,

I have a Nexus S 4G running stock 4.1.1, and a Mac running 10.8. I've tried following rooting instructions from various websites, and everyone everywhere glosses over the details and never addresses the various things that could go wrong.

I have the full Android SDK installed and up to date. The date stamp on the directory I downloaded from Google is 20130514 -- just a few days old. I can see my device when connected via USB by running "adb devices".

I can reboot into bootloader mode just fine. I've unlocked the device. I can flash a recovery without issue. I've tried CWM and a couple others. The problem comes up when I try to flash SuperUser.zip. In CWM, it seems to go just fine, but when I reboot back into the OS and run the SuperUser app, it fails when trying to gain root access, and root-enabled apps like Greenify fail to perform their root-dependent functions. With TeamWin's recovery, it stops halfway through loading SuperUser.zip. If it's logging any error message anywhere, I haven't found it.

I've also tried sideloading SuperUser.zip. I don't know why this approach isn't recommended more often -- it's a zillion times easier than the mount-copy-unmount-install approach usually recommended on "how to root" sites. That said, it still doesn't work.

I'm a software engineer, so I know my way around computers in general, but I'm a noob when it comes to this stuff. Someone please help! Hopefully we can update these instructions once we figure out what's going wrong. :)
 

kdaq

Member
Jun 26, 2011
5
0
0
Visit site
Hey Jake,

I had the same problem. Nexus S 4G running stock 4.1.1, and it can't load SuperUser.zip

After a few tries here (Nexus Root Toolkit and manual) I finally succeeded via a different site -- nexushacks. Not sure if it was a different SuperUser.zip or because it used a seemingly newer TWRP (not CWM), but it did the trick.

Good luck!

EDIT: one addition. It seems this method only appeared to work. Once I rebooted, SuperUser didn't grant su permission to anything. To fix it, I had to switch to SuperSU. Not just any version, mind you -- the latest 1.30 (at time of writing) didn't work. I found a SuperSU 1.25 zip at rootzwiki and finally, FINALLY, it grants su properly!

Cheers,

-Kevin
 
Last edited: