[Q] Testdisk on Android Shell - General Questions and Answers

Hey Guys,
can someone help me ? I will raun the Data Recovery Program of Testdisk and Photorec on my Transformer HC3.2 as SuperUser in a Terminal Emulator for Android. The Terminal Emulator runs great. At same time a tested it with an SSHD.
I have Downloaded the Linux Version of Testdisk (Linux, kernel 2.6.x i386/x86_64)
If i will start the file "testdisk_static" solo and with su command but every time it says "permission denied". In File Explorer i set the PErmissions of the file and in the command shell two times with chmod 7777 but se thame problem.
Permisson Denied !!!
Has someone any idea how i can fix this problem ???
Here is the Link of the Programm : cgsecurity.org/wiki/TestDisk_Download

I think testdisk and photorec are not include in Busybox. As far as I know, you just can't run them directly on Android.

Related

[Q] Anyone have Linux/Ubuntu/Fedora Working Currently On GB?

Problem:
I've worked with every available distribution of Linux, trying to get the damn thing working on my phone. Troubleshooting the ***t out of it, and no deal. Constant errors/files not found etc. So, rather than post my logs and ask for help troubleshooting them (as I've obviously been unable to do), I thought I'd just ask:
Does anybody have a Linux build (besides android!) working on their phone that's running Gingerbread or ICS? If yes, can you post your software specs?
Here are mine currently:
Busybox- v1.19.3-Stericson in /system/xbin
Firmware Version- 2.3.5
Baseband Version- T959VUVKG6
Kernel- 2.6.35.7-T959VUVKI3-CL611444
Build Number- Gingerbread.VUVKI3
Mod Version- Octaine Team Acid
Thanks, this has been a pain in my **s for too long now!
S
I had both Fedora and Ubuntu working on Froyo at one point through lots of modifying and editing of the scripts.
What do you need them for anyway? I think it's more of a hassle to set them up than it's worth.
Well, I am working quite a bit now with linux for servers and such, and it's good to have a system (even minimal) that I can use/reference, plus it helps me get better at it.
Get this: I was so frustrated that I went back to BlackIce (keeping my gb bootloaders) and the damn thing loads right up, ubuntu 11.04, no problem. So, I then loaded up Valhalla's GB build and, sure enough, that works too. So, going with my luck I load octane 2.x GB which i've been digging of late and no deal, ubuntu just won't load.
Now, trying the same trick I cannot get it to work. It just won't load now when I SH it. Here's the instructions that worked before (and I've tried them all!):
http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html
Also, I hard bricked again (corrupted bootloaders from a Parallels Windows stallout) but did Adam's UnBrickable Mod and that's all better. Everybody needs to check it out, it's awesome:
http://forum.xda-developers.com/showthread.php?t=1333424
So FBI, any idea why linux is so temperamental? Once it SH's properly, it always works.
(Thanks to all the developers for their great roms!)
Yeah I noticed that slight changes from different ROMs based on the same kernel base had that effect too. I'm thinking it had to do something with the busybox installations since I had to edit the script sometimes. For some reason on some installs running mount won't work unless you use it as busybox mount. It was very iffy like that. I haven't even tried it again because of how frustrating it is to get even a boot. The other thing is that if you try to do a shutdown from ubutu/fedora it doesn't even kill the processes all the way so the only way you can clear some ram up with with a reboot.
Yeah man, I was figuring Busybox myself. I've tried old installs, new installs, xbin only, bin only, xbin & bin, etc. It's so frustrating because I can't figure it out. When it was working it was great, pretty stable.
So the first problem always lists as:
Remounting /system rw...
Mount: no such file or directory
Usage: mount [-r] [-w] etc, etc
So does this tell us that the system is not mounted rw? I used the Mount/system r/w application, but I cannot verify it's doing it's job. Everything is rooted properly, CWM also.
In Terminal on the phone I ran:
"mount | grep system"
which gave me
"/dev/block/st19 on /system type ext4 (rw,relatime,barrier=0,data=writeback)"
which leads me to believe the system is r/w.
I'm converting the system back from ext4 using CWM Voodoo to disable Lagfix and system Lagfix to see if this has any effect. Will report.
No deal. Didn't do a damn thing. I'm going to crack this if it's the last thing I do....
I'm using Better Terminal Pro, Bash shell, and under command line in options it lists the Shell as: /system/bin/sh-
The sh install.sh also tells me:
"Mounting: Loopback mount
mknod: /dev/block/loop254: File exists"
Does this mean that all (255) of my loops are used? Do I need to remove programs?
The available loop device thing never got resolved. Nameless originally fixed it by making it use 254 so that there was a low chance of the loop device being available, but the phone's OS is very iffy about letting a new loop device get assigned to a system image file. Can't really help you out since I never got it to consistently mount with different roms.
Linux on SGS4G Working! Done and Done!
Figured it out.
I can get Ubuntu 11.04, 11.10 & Debian 6 to mount repeatedly in all sorts of ui updatable configurations using this information:
http://www.nerd65536.com/2011/07/installing-ubuntu-in-android-version-2.html
It's a friggin Christmas Miracle! Can't tell you how much time I've wasted working this out, and it all boils down to the sh and run scripts.
So, without further ado, here goes.
!!Make sure you're rooted!!
!!The quotes just tell you what to type. Don't type them!!
1.
Download one of the three builds on the website listed above (or build your own, it should work fine). Extract it from tar.bz2, they should all extract to a linux file, this includes the necessary scripts. Put it on the sd-card on your phone.
2.
Download the new scripts that (Nerd) listed found here: http://ohm.nerd65536.com/android-linux/scripts-latest.tar.bz2
And extract them. You'll have another file that says linux. Open it, take the three files inside (install.sh, root-scripts & scripts) and paste them in the linux folder you moved to your sd-card. They will overwrite the ones currently there. These scripts work for sgs4g, the originals did not.
3.
Install the latest BusyBox in xbin if it's not already installed (must be rooted). Latest is 1.19.3
4.
Download a terminal client, like Better Terminal Emulator or Android Terminal Emulator. I use the first. The terminal needs to run the commands as root, especially the linux vnc command as it didn't want to work for me no matter if I started by typing su. Better Terminal Emulator has a check box to always start in root.
5.
Open up your terminal emulator and type su if you are not rooted there. Then change directory to the linux file on the sd-card. run the sh file there.
Like this:
"su"
"cd /sdcard/linux"
"sh install.sh"
If it works, the resulting dialog in terminal won't throw up any problems.
6.
Get back to / on sd by typing in terminal:
"cd /"
You should then have a: / # prompt, which means you are still rooted.
Enter:
"linux"
Which should result in a: [email protected]:/#
This means Linux is running. Congratulations. It should continue to run unless you shut down your phone.
7.
Download a VNC client, like Android VNC Viewer (free) or Remote VNC Pro, which I use. Add a new entry in it, with the following settings:
Host: localhost
Port: 5901
Password: cheesecake
Color: 24-bit
Name: Linux
When that's done save if you can or back out if you can't, and go back to your terminal emulator.
8.
It should still say: [email protected]:/#
If it doesn't, fine, if it does, just go back to root prompt by typing:
"exit"
Which should get you: / #. Then type:
"linux vnc"
Which should run itself and mount the chroot environment. It should tell you your new 'X' desktop is localhost:1, and have a: / # prompt again.
It might also ask you for a password, if so then put whatever password you'll remember in that's longer than 6 characters and verify it. This only happens once.
9.
Go back to your VNC client and if you entered a password in step 8. then edit your listing to your password instead of cheesecake, if not then don't.
Click on the Linux link and BAM! (shameless Emerilism), you're at your Linux desktop which should be running a iceWM desktop interface, which is fast. The LXDE desktop is nicer and if you want that then go into you're terminal and get into the linux shell by typing:
"linux"
And then switch to LXDE by typing:
"apt-get autoremove icewm- lxde+"
Which will run through the removal/ installation, and verify you want to download the <400mb files. Type:
"y"
And give it time to finish. When finished, just go back to your VNC client and hit Linux again, and you will have a nice looking functional desktop, with a cpu load graph on the bottom. I tried using Gnome desktop and Unity 2d, but both of these would install and not fully run with all options. They are heavier and slower, but cool non-the-less. Let me know if anyone has luck with these on Android.
Notes-
You only have to type "linux vnc" once in terminal to start linux every time you boot your phone. Otherwise, just open your VNC client and click on Linux to use it. Easy!
You will want to update and upgrade your linux after install, do so by typing in terminal:
"apt-get update"
"apt-get upgrade"
Also, you might run across a problem if you try to add-apt-repository, that's because that python command is not present. To use it, enable by typing:
"apt-get install python-software-properties"
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
http://www.androidfanatic.com/community-forums.html?func=view&catid=9&id=1610
Thanks to Nerd65536 for the info, write-up and files. He fixed my problem.
sconsylman said:
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
Click to expand...
Click to collapse
You're welcome.
It's actually a lot easier than that to make the image larger. Just pop the SD card into a Linux machine and:
(Assuming the original file is: /media/phone/linux/linux.img)
Code:
resize2fs /media/phone/linux/linux.img 4095M
And you're done. resize2fs is made of magic!
Note: Most SD cards are FAT32, which has a filesize limit of 4GiB. The above instructions will make the file a megabyte less than that.
nerd65536:
Thanks! Worked like a charm. Had to e2fsck -f /media/SDCARD/linux/linux.img (phone plugged in to Mint) before i did it to check over the file system, but then it ran immediately. Much appreciated.
Have you had any luck on native boot? I've been working a little on this, as I can't run BackTrack arm well virtually, it gets buggy. Granted the telephony systems won't work during, but the functionality should be pretty good if we could run it standard.
Also, while I'm thinking of it, is it possible to run the img from an ext4 partition on the card? I have an existing one being used for link2sd files and would much prefer using it as it's a far superior file system to fat32, without the 4G limits. Vnc should have no problem graphically, but would the linux.img chroot properly?
It would probably work but you would have to alter the script to mount the other partition if it doesn't do it automatically and change the path. Shouldn't be too hard.
I'm getting an error when I try running sh install.sh:
Code:
# sh install.sh
readlink: applet not found
Remounting /system rw ...
sh: Can't open /linux/scripts/fsrw
Installing scripts in /system/bin ...
cd: can't cd to /linux/scripts
cp: write error: No space left on device
cp: omitting directory 'root-scripts'
Unable to chmod /system/bin/root-scripts: No such file or directory
cp: omitting directory 'scripts'
Unable to chmod /system/bin/scripts: No such file or directory
cp: omitting directory 'tmp'
Unable to chmod /system/bin/tmp: No such file or directory
Mounting the Linux image ...
install.sh: /system/bin/linux: not found
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't stat '/linux/root-scripts/*': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
# linux
linux: not found
NuVanDibe said:
I'm getting an error when I try running sh install.sh:
Code:
# sh install.sh
readlink: applet not found
Remounting /system rw ...
sh: Can't open /linux/scripts/fsrw
Installing scripts in /system/bin ...
cd: can't cd to /linux/scripts
cp: write error: No space left on device
cp: omitting directory 'root-scripts'
Unable to chmod /system/bin/root-scripts: No such file or directory
cp: omitting directory 'scripts'
Unable to chmod /system/bin/scripts: No such file or directory
cp: omitting directory 'tmp'
Unable to chmod /system/bin/tmp: No such file or directory
Mounting the Linux image ...
install.sh: /system/bin/linux: not found
Customizing the image ...
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
install.sh: cannot create /data/local/mnt/etc/resolv.conf: directory nonexistent
Installing root-scripts ...
mkdir failed for /data/local/mnt/root/scripts, No such file or directory
Unable to chmod /data/local/mnt/root/scripts: No such file or directory
cp: can't stat '/linux/root-scripts/*': No such file or directory
Unable to chmod /data/local/mnt/root/scripts/*: No such file or directory
Install finished
# linux
linux: not found
Click to expand...
Click to collapse
cp: write-error.. no space left on device? You need more space dude

GOOGLE TV & Better Terminal Emulator V4.0.3

First of all I would like to thank my intuitions on this discovery! the SONY Google TV can be rooted, well, at least the /system partition can be changed to read/write. I have not actually executed the command to do so, but I do know the necessary path to the Google TV's /system partition. I recently discovered that the the Google TV uses Better terminal Emulator pro V4.0.3, and I was looking around on the magicandroidapps.com WIKI and noticed that there was an application called TV Terminal Emulator Pro, but I think that was a throw-off. Better Terminal Emulator Pro version 4 works perfectly when trying to access system level permissions on SONY's (notice I said SONY) Google TV. Here are the facts. Hopefully someone can try the usual remount command and switch the system to read/write
1.install Better Terminal Emulator Pro (version 4.0.3 ONLY!) no other version will work
Hit the menu button in your SONY Google TV remote once the terminal has opened and in the default shell setting, choose the Almquist shell as the default!
2.type this command in the terminal
\ $/system/bin/ash
This will give you permission to execute all /system/bin commands(ash=advanced shell)
you will now have a prompt like this one below
\w \ $
3.you can now type this command to see all files in /system/bin directory:
\w \ $ls /system/bin
4. type this command:
\w \ $/system/bin/mount
NOTE: This command will give you a list of all partitions within the TV's file system!
NOTE:The system partition will be in the list of mounts called /dev/block/sda5. It is the only one of two mounts that is in read only mode.
NOTE: This directory is a ext3 file system, and this should be added in the remount command in terminal. Plaese give me some feedback on this matter because I know you GTV fans have been waiting on something like this!!
GOOGLE TV & Better Terminal Emulator Pro V.4.0.3 [UPDATE]
So have figured out how to issue the command to remount the system partition to rw, but it appers that I am not in root? For those who do not know the command, here it is:
\w \$ mount -o remount,rw -t ext3 /dev/block/sda5 /system
mount: permission denied (are you root?)
This is no big deal, this just means that we are getting closer to seeing just what this giant tablet can go. This also means that the command is corrects as well, for one to get an output like the one above., I will try to use another shell and see what commands will have to be executed and get back with all you GTV users.
NOTE: This is post is related to the (SONY Internet TV) and NOT the LOGITECH Revue
ALSO: Those of you who are trying to use ADB to control the television, The \$ adb root command cannot be executed in a production build of GOOGLE TV, which led me to go with Better terminal Emulator Pro.
GOOGLE TV & Better Terminal Emulator Pro V4.0.3 [UPDATE]
Hay guys, I was playing around some more with the terminal and I see that there ARE busybox commands present in the application.
I think the trick to rooting the SONY NSX32GT1 would be the CHMOD command. Entering this command while in the BASH shell when the emulator starts will give you the options for executing the command properly. if smeone can help me out with this command to change the permissions of the /system file system, that would be great. The CHOWN command may be of some use as well. I am almost 100 percent sure that if we change the permissions of the filesystem with one of these commands, we will be on our way to getting proper root access to out TVs!
If you are familiar with linux commands, please post a reply with the proper execution, and I will, in return, provide some very exclusive information about the television!
Here are some pics of the terminal up and running with busybox v1.16.2 built in.
i believe u may be speaking of commands like chmod -R 777 /system to give read write and execute permissions to user group owner .or chown root:root but to do any of that u must be root (the owner of most system files) or owner of said files in order to change owner group permissions and more. those commands come after a su or sudo in full bash. so u would still have to remount as rw. but the fact u got busybox installed is nice perhaps we can start looking at other root options if the busybox commands can be found during zerg or other overflow
Sent from my SPH-D710 using xda premium

Can't run adb shell!

hi have this problem...
when i run "adb shell" the output is :
exec '/system/bin/sh' failed: No such file or directory (2)
its normal? ho i can fix it?
some details
tft101g
firm. 9.2.2.6
where are you trying to run the shell from?
i try from ubuntu, arch and win7..
but the problem is on the tab
terminal emulator app crash and in /system/bin there isnt any sh
ps : with my other android i have no problem with adb
If /system/bin has no sh file that's probably the problem.
Try placing sh in /system/bin (I attached it). Should help fix the problem if that's where it exists.
thanks but...this is the core of the problem
with last update i lost the root, ota rootkeeper dont work, so i cant write in system, i don't now how its possibile that i lost sh, but every method for rooting not working now (because adb shell not work).
I stunned by this!! i dont how whar i can do....
Have you tried a factory reset and reinstall, that's about all I can think of to fix adb shell at this point, aside from waiting for a new update that includes it.
you may check /system/xbin in the offchance it was relocated...
factorty reset doesn't help! still not found
and yes i find it in xbin but without root i can cp it
I guess a terminal app would need to specifically look for it in xbin.
I don't know how this would work, I'd say you need to wait for the next OTA.
yeah..
i have download the last update from the asus site, and after the update sh is in the rigth place
Terminal emulator work again
its strange that i can reflash an update that was already installed but...now work and bye asus its time for cocking
tanks to all

Installing Unix command

Hi! I'm new to android and I'm trying to install the command "file". file is a unix command that is used to determine the filetype of a file. I use this command a lot on my computer and would really like to have it on my phone as well. I downloaded the source but when I run ./configure I get permission denied even if I run as root and chmod 777. What am I doing wrong? Is there a precompiled version?

[Q] Android Terminal - Permission Denied!

I'm rooted and using Terminal with Superuser Permissions:fingers-crossed:
i want to run an executable:highfive:
HTML:
./<EXECUTABLE>
it doesn't work
it works perfectly on Ubuntu or any other Linux Distribution on PC:victory:
it says
HTML:
Cannot Execute - Permission Denied
any help:cyclops:
yousefs said:
I'm rooted and using Terminal with Superuser Permissions:fingers-crossed:
i want to run an executable:highfive:
HTML:
./<EXECUTABLE>
it doesn't work
it works perfectly on Ubuntu or any other Linux Distribution on PC:victory:
it says
HTML:
Cannot Execute - Permission Denied
any help:cyclops:
Click to expand...
Click to collapse
I realized after long search that the storage has been mounted with the -noexec option:victory:, so we can use executables, i copied the file to /data/local as they say it's mounted with -noexec option:good:, now i get different error when executing:
HTML:
not executable: magic 7F45
now what is this??:silly:
i even tried coping the files to /system/bin and got the same 'magic' error
now what is the magic here?:cyclops:

Categories

Resources