I just rooted my SG S4 Android 5.0.1 with auto root and (a friend's) Windows Odin. Everything worked fine (root complete and SU installed) till I think I gave a bad mount command in the root directory on the phone in terminal (i guess here it went wrong, not sure. Or perhaps during installation of bash or nano) when I was installing bash and nano. Since it rebooted, I lost the wifi and cannot adb shell into my phone anymore from mac.

However, everything except the wifi is still working. Adb and usb functions are still working. I can push and pull, however I just can't enter root directories through terminal anymore. I get the following error: - exec '/system/bin/sh' failed: Permission denied (13) -

I think my phone is still recoverable, however I don't know what to do and don't want to risk making things worse. Which andoird wizard can help this poor wifiless guy?

Ref: http://androidforums.com/threads/guide-full-bash-shell-with-nano-tab-completion-and-color-over-ssh.124506/ Download-File:

Below here were my bash nano install commands:

./adb shell
mount -o remount,rw /system 
cp -r /storage/extSdCard/bashnano/terminfo /system/etc
cp /storage/extSdCard/bashnano/profile /etc
cp /storage/extSdCard/bashnano/bash /data
cp /storage/extSdCard/bashnano/nano /data
chmod 755 /data/bash
chmod 755 /data/nano
cd /system/bin/
mv sh sh.old
ln -s /data/bash sh
ln -s /data/bash bash
ln -s /data/nano nano

export TERMINFO=/etc/terminfo
export TERM=linux

mount -o remount,ro /system 

P.S. So I also performed a regular mount in root, which i think is what made things bad!

  • I assume since you rooted, you installed a custom recovery? Most of them have an option to fix permissions. Give that a shot and see what happens? Not sure what to do, to repair what you did if the fix permissions doesn't work. But worst case, You can download the factory image for your device and flash it via odin.
    – jer3my
    Aug 19, 2015 at 4:56
  • I can run ./adb reboot recovery. I get a menu with the options: - reboot system now - apply update from dab - apply update from external storage - reboot to bootloader - apply update from cache - wipe data/factory reset - power down - view recovery logs - Enable cp logging - Disable cp logging. I guess from those options I should pick the factory reset, maybe? I used the package from autoroot to root my phone. I'm not sure what kind of recovery it installs: autoroot.chainfire.eu
    – Ansjovis86
    Aug 19, 2015 at 13:10
  • Or wait, is that custom recovery on my laptop. Because I just did the ./adb reboot recovery but that looks like a standard recovery. I have a recovery.img file in my platform-tools folder. Perhaps I should Odin flash that one?
    – Ansjovis86
    Aug 19, 2015 at 14:07
  • Ok, I flashed clockworkmod recovery now. It allows for 'mount /system'. Now I'm able to ./adb shell again. So I got one step closer it seems. However I have totally no permissions, so I can't even cd or chmod anything yet. Anyone knows what to do know?
    – Ansjovis86
    Aug 20, 2015 at 2:11
  • Hmm. I looked a little more and it seems that clockwork recovery removed the fix permissions awhile back. Apparently it was a placebo effect. Figured it might help. If you made a backup already. A factory reset couldn't hurt. Maybe it will undo what you did. Not 100% sure on that though. Have you asked over on the XDA forums yet?
    – jer3my
    Aug 20, 2015 at 2:40

1 Answer 1


Ok fixed the problem by installing firmware from sammobile.com. The Odin flash failed at the hidden.img, but I could recover the thing by running the instructions here: http://www.s4miniarchive.com/2014/07/solution-what-to-do-when-odin-fails-at-hidden.img.ext4.html

And I have my wifi back but lost root (but that's not a big deal). Look at that loverly wifi icon, it's back!

  • Haha, and I'm really feeling to reroot that damn thing again now. At least now I know how to come back when things go wrong. And thanks for ur help Jer!
    – Ansjovis86
    Aug 21, 2015 at 14:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .