Permission denied when trying to mount USB storage I'm trying to mount USB storage using the "Terminal Emulator" app with the following commands:

mount -t vfat -o rw /dev/block/sd* /storage/usb1

or

su mount -t vfat -o rw /dev/block/sd* /storage/usb1

But I get a permission denied message.

I've tried different su binaries. One of them is:  http://e2e.ti.com/support/embedded/android/f/509/t/279726.aspx

The shell command which I'm using is working in adb, but I have to execute it within an app. Without permissions, I cannot do that. 

So:


Is it possible to root this Android image (I'm using TI release for Beaglebone Black)?
OR, can I give permissions using chmod? If I can, which files should I give permission?
OR, is my approach wrong?
I finally found the solution. Yes ADB of Beaglebone is rooted but there isn't a SU binary. So I wasn't able to execute this code within my app:

Process proc = Runtime.getRuntime().exec("su mount -t vfat -o rw /dev/block/sd* /storage/usb1");


But I finally find a program to root Beaglebone Black and install a valid SU binary. You can download it here :

http://www.unlockroot.com/unlockroot.html

But be careful! It installs bunch of unwanted programs to your computer too. Once you install the program, connect your Beaglebone via USB. First you need to unroot Beaglebone. So open the program, you downloaded, and click UNROOT. It will take a couple of minutes. Then restart your Beaglebone and click ROOT from program. Then restart your Beaglebone again. And voila :D You have 100% rooted Beaglebone with a valid SU binary.

You can mount and unmount USB storages and copy files within your application . But You should do it like that :

Process proc = Runtime.getRuntime().exec("su", null, null);
OutputStream os = proc.getOutputStream();

os.write(("mount -t vfat -o rw /dev/block/sd* /storage/usb1;
           cp -R /myFile /storage/usb1").getBytes("ASCII"));
os.flush();
os.close();
proc.waitFor();