Fixing ext4 partition in Android TV (Akai) - no e2fsck present - Android Q&A, Help & Troubleshooting

Hi, my first opened discussion, after very much pain since i am not expert at linux shell commands / environment, i have dismounted the userdata partition, now i need to check/repair it with a e2fsck / fsck.ext4 but isn't there on this Android TV (damn!), so i tried to import it from my Tablet that is vers. 4.4.2 against 4.4.4 of TV, passing it before to a Windows Xp pc through USB cable, then to TV using a USB pendrive, when i try to run it with or without superuser rights it fails, it tells :
system/bin/sh: e2fsck: not found [when in normal user mode]
su: exec failed for e2fsck Error:No such file or directory
[when used with su -c behind]
the file exists:
$ su -c ls -l
-rwxrwxrwx root root 122576 2012-03-25 13:36 e2fsck
Any Ideas? Much thanks!

Already solved, thanks the same.

Related

Unable to browse /data/app-private with adb

I'm using the adb.exe command directly from the Android SDK to connect to my Xperia X10's file system. Here are the commands I issued:
D:\android_sdk\tools>adb shell
$ cd data/app-private
cd data/app-private
$ ls
ls
opendir failed, Permission denied
$ su
su
pwd
pwd
ls -l
ls -l
Permission denied
$ /data/app-private
$ opendir failed, Permission denied
$ exit
exit
D:\android_sdk\tools>
Two questions: 1) Why is it commands entered after typing "su" are echoed? 2) How come I can't browse the app-private directory even after entering su?
Thanks.
Have you rooted your X10 ? (think not)
A # prompt indicates superuser privileges, you did not get to be a superuser.
Why you get an echo I don't know.
mattiL said:
Have you rooted your X10 ? (think not)
A # prompt indicates superuser privileges, you did not get to be a superuser.
Why you get an echo I don't know.
Click to expand...
Click to collapse
Yes the phone is rooted. I have the AT&T branding, but used the one-click exploid to root the phone, and it works as Titanium Backup when running tells me it gained Superuser priviledges. I don't know what I'm doing wrong. This is from an MS-DOS prompt in Windows.
When you use SU for the first time, you need to have the phone screen on and unlocked. It will ask for superuser permissions. Then it will work.
naplesbill said:
When you use SU for the first time, you need to have the phone screen on and unlocked. It will ask for superuser permissions. Then it will work.
Click to expand...
Click to collapse
Ha, thanks, it worked. The key was typing SU just before I unlock the phone, then it asks me on the phone that "Unknown" wants superuser access. Thanks again.
I was finally able to apply the 'Enable Non-Market apps' fix via adb thanks to this little tip
I'm learning- slowly...
How exactly do I run scripts on this phone when connected to a PC?
Code:
C:\android_sdk\tools>adb shell
$ su
su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
# cd sdcard
cd sdcard
# ls -l testscript.sh
ls -l testscript.sh
----rwxr-x system sdcard_rw 54 2010-10-06 10:52 testscript.sh
# sh testscript.sh
sh testscript.sh
: not foundsh: ■#!/bin/sh
: not foundsh: /sh
: not found
mkdir <target>
#
Any ideas?
If anyone told me "You should save your files in UNIX format where each text line ends in 0x0A, and not 0x0D 0x0A as in Windows, it will work" ... you'd be right. UNIX doesn't like carriage return & line feed pairs when trying to run a shell script.

Manual rooting - cannot mount /system as read/write

I have researched xda and the web for my problem, but it seems to be different from other posters.
I bought a Nextbook Premium 7 with Android 2.3.1 and wanted to root it. Another user already mentioned hack apps like Gingerbreak, superoneclick and z4root did not work, therefore I thought I would try the manual rooting method from the guide below:
http://www.nexusoneforum.net/forum/nexus-one-development-hacking/10940-simple-sdk-setup-guide.html
I pushed Gingerbreak and ran it using ADB, and it was successful granting temporary root. However, in the next step when I tried to remount /system as read/write (in order to install Superuser), it did not work - this step was:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
After executing this, I DID NOT get any error message like other posters (eg. NO "remount failed: operation not permitted").
However, when I tried to execute the next part:
chmod 777 /system/bin (or chmod 777 /system/app)
I got an error message: "Read-only file system".
This tablet has a Rockchip rk2918 processor and Android 2.3.1, otherwise I know nothing about it. The company (nextbookusa.com) does not have any firmware support on this model yet.
Can anyone help? Thanks.
More research on the web makes me suspect this tablet uses cramfs file system, because I've seen "cramfs" coming up in other similar 7 inch rk2918 tablets.
I understand it is common for chinese tablets with similar hardware to have similar basic Android OS, which is modified by the brand owner in their own specific models.
Apparently cramfs is read-only. I can only find one post where the poster successfully rooted the device by unpackaging the firmware, added Superuser, repackaged it and re-install it (as a firmware update) like a "custom(ised) ROM".
I guess until Nextbook issues firmware update on their website to unpackage and add root, there is no way to do it now.
Also RK2918
I've just bought a GoogleTv box with RK2918. I know that there's cramfs on it. I have a firmware from the producer. Any tips or trix on howto root it?
I received a RK2918 WOPAD 9.7 with a built in 3G and I have same issue can't mount system as RW. No messages but get access denied. Busybox is installed in /system/bin and GingerBreak ran fine and gave proper message when completed.
Just can't copy Superuser.apk because I have no write access. This is alot different than the GTAB. I can see the # prompt # and I can see files and dirs I make are root - but not access to Superuser.apk to allow other programs to write.
Any help would be appreciated. Also when I use busybox whoami I get the following:
# busybox whoami
whoami: unknown uid 0
Prior to me doing it the manual root method - I used Z4root and UniversalAndroot - no success.
As far as me thinking I have some root access I did the following:
# cd /data/local/
# ls
tmp
# ls -l
drwxrwx--x shell shell 2011-09-12 17:31 tmp
# su
# ls -l
drwxrwx--x shell shell 2011-09-12 17:31 tmp
# mkdir test
# ls -l
drwxrwx--x shell shell 2011-09-12 17:31 tmp
drwxrwxrwx root root 2011-09-12 18:23 test
apparently I have root access but can't execute the remount command or that block in not writable while system is up - but not sure.
Anyhelp would be appreciated!
sorry for bad english, the issue seems to be in boot ini and recovery mode, i had the same issue on a tab rk 2918, you can only unpack then repack after modifying anything you want, but not mount on rw.
has anyone tried zergRush root method for this tablet yet?????
I tried using SuperOneClick's zergRush on my WoPad i7. Same results.
dicksoft said:
I've just bought a GoogleTv box with RK2918. I know that there's cramfs on it. I have a firmware from the producer. Any tips or trix on howto root it?
Click to expand...
Click to collapse
Hello, I also have an rk2918 tvbox. I succesfully rooted it and prepared a custom rom..
you can check if you have my same box and download the rom my site.. you can find it searching "clamelmod" with google..
Converting cramfs to ext3
You will need to convert the cramfs to ext3, check the instructions described at:
google for "google sites rk2918tools", 1st link.
Let me know if it worked.
hey do you know how to put ics on this rk2918 box?

How to root an Android Virtual Device?

I want to root my Android 4.0.4 virtual device for developing.......... How to root it?
Here you go ... ;-)
Paresh Kalinani said:
I want to root my Android 4.0.4 virtual device for developing.......... How to root it?
Click to expand...
Click to collapse
The following method is actually for 2.2 virtual machine ... but should work fine for 4.0 too ... i'll confirm after i have tested it ... meanwhile you can try it ..
You'll require
'su' binary
and
'busybox binary'
SU BINARY : See post's end
BUSY BOX BINARY : see posts end
Then, we need to start the emulator by providing extra partition size to /system. This can be done only through command-line
Code:
emulator -avd MyAndroid -partition-size 128 -no-snapshot-load
Make sure the AVD “MyAndroid” is already created. The “-no-snapshot-load” option is used if we enabled the snapshot. As a result, we will start the emulator with extra disk space for /system. By this, we can adding extra files to /system later.
Then, we need to use “adb shell” to remount the /system so that we have write access to the /system.
Code:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
Then, we can push the su and busybox to the /system/xbin.
Code:
adb push su /system/xbin/
adb push busybox /system/xbin/
Now, to actually make the su work properly, we need to chmod it,
Code:
adb shell chmod 06755 /system/xbin/su
adb shell chmod 06755 /system/xbin/busybox
Now, we need to install Superuser.apk (which you can get together with “su”). We can install it with “adb install” command. It is required when the other apps request for “su”.
We can try our “su” with Root Checker Basic or Stericson Busy-box.
Now, that is rooting. You might feel happy with it. However, if we restart the emulator, without snapshot, all the “su” does not work any more. So, we are going to customise the ROM image.
Failures
Now, if we restart the emulator, everything will return to default. No more “su” and Android Market. Why? The reason is because whatever we done to the /system, it will not save to the ROM image.
The /system is actually from the system.img, installed with android-2.2 in my case. This file is mounted in emulator as yaffs2 file system format. In order to customise this ROM image, I have tried several ways.
Using unyaffs, it can only extract the image, but I cannot continue. I can simply pull the /system using adb command without it.
Using yaffs2utils, unyaffs2 produced nothing. And the image built by mkyaffs2 does not allow the emulator to boot.
Using mkyaffsimage, also not work as above.
Some resources mentioned that, we can get the mkyaffs2image utility when building the Android source. But the problem is, to get the source, it requires a lot of disk space and need a long time to download.
So, what is the best way to modify the system.img? I even tried the low level way using dd to extract the /dev/block/mtdblock0, but failed.
Solution
Finally, I tried to solve it with userdata-qemu.img. This is the /data folder that will always modified when we install apps in the emulator. Restarting the emulator does not reset /data. Therefore, we can simply create the ROM image from /data. We can done it simply clean all the /data.
Code:
adb shell busybox rm -R /data/*
This will remove everything is /data, except “lost+found” folder.
Code:
adb shell busybox ls /data
Check with ls command, make sure only “lost+found” left.
Now, since the /system contains the “su”, “busybox”, Market and Google Services Framework we have done earlier, we need to copy the whole /system to the /data.
Code:
adb shell busybox cp -a /system/* /data/
adb shell busybox ls /data
As a result, the /data is identical to the /system.
Now, we have the userdata-qemu.img file in the AVD folder, which is modified. Close the emulator. Then, we can use the userdata-qemu.img file as the system image. We can rename it to system.img, or calling it as the system with “-system” option from the emulator command-line.
Start the emulator with this customised system.img, now, we have busybox by default, and also Android Market. :good::highfive:
Tip
If you are doing this on windows make sure you CD to here for issuing the commands:
%profilename%\AppData\Local\Android\android-sdk\tools
Don't use the stuff in C:\Program Files\Android. That is the wrong location.
The below gets your GAPPS too. You can download Cyanogens GAPPS to get what you need. Just edit the necessary lines below.
cd %profilename%\AppData\Local\Android\android-sdk\
.\tools\emulator -avd MyAndroid -partition-size 2047 -no-snapshot-load -verbose
echo wait for boot
pause
.\platform-tools\adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
.\platform-tools\adb push %~dp0platform-tools\su /system/xbin/
.\platform-tools\adb push %~dp0platform-tools\busybox /system/xbin/
.\platform-tools\adb shell chmod 06755 /system/xbin/su
.\platform-tools\adb shell chmod 06755 /system/xbin/busybox
.\platform-tools\adb shell busybox rm -R /data/*
.\platform-tools\adb shell busybox ls /data
.\platform-tools\adb shell busybox ls /data
.\platform-tools\adb push %profilename%\Downloads\gapps-ics-20120317-signed\system /system
.\platform-tools\adb shell busybox cp -a /system/* /data/
Which busybox binary?
You don't say which of the various busybox files in the .7z archive is to be used on the AVD?
I try to push the su, I got this message:
C:\adb>adb push sources\root\su /system/xbin
failed to copy 'sources\root\su' to '/system/xbin/su': Directory not empty
Then try push the Superuser.apk
C:\adb>adb push sources\root\system\app\Superuser.apk /system/app/Superuser.apk
failed to copy 'sources\root\system\app\Superuser.apk' to '/system/app/Superuser
.apk': Out of memory
I think that's because of this:
View attachment 1617834
How to make the System ROM space more freely???
----------------------------------------------------------------------------
Sorry for my noob question. Now, I see.
I have done untill rename userdata-qemu.img to system.img
But while I run from AVD Manager, my AVD got bootloop.
That's because you haven't started your emulator with additional space. Use the -partition-size option as per niranjan94's post above.
I found an even better way to make a /system image, and adapted it for use on Windows hosts and using the x86 emulator images now available.
References:
http://blog.thecobraden.com/2012/06/making-persistent-changes-to-android.html
http://code.google.com/p/android-group-korea/downloads/detail?name=mkfs.yaffs2.x86
Place this batch file in the same folder as the mkfs.yaffs2.x86 binary and you'll get an emulator image updated to your liking and ready to run.
Code:
@echo off
adb -e remount
echo Pushing mkfs.yaffs2.x86 to device...
adb -e push mkfs.yaffs2.x86 /data/local/
echo Executing chmod 770 /data/local/mkfs.yaffs2.x86
adb -e shell chmod 770 /data/local/mkfs.yaffs2.x86
echo Setting /system partition to read-only (Just to be safe!)
adb -e shell mount -o ro,remount /dev/block/mtdblock0 /system
echo Creating YAFFS2 image of /system
adb -e shell /data/local/mkfs.yaffs2.x86 /system/ /mnt/sdcard/_system.img
echo Pulling image to local directory...
adb -e pull /mnt/sdcard/_system.img
echo Cleaning....
adb -e shell rm /data/local/mkfs.yaffs2.x86
adb -e shell rm /mnt/sdcard/_system.img
echo OK
pause
Don't work on 4.2.2 emulator
Ι mean I push it, give permissions, install su.apk ... still nothing...
On 4.2.2 emulator
Hi,
I got the same error on 4.2.2 emulator.
So I tried with size 256:
emulator -avd Andy2 -partition-size 256 -no-snapshot-load
and it worked fine.
Also, I'm using CPU ARM (armeabi-v7a). So for busybox I used the binary from this thread:
http://forum.xda-developers.com/showthread.php?t=1380278
Error while trying to permanent patch rooted android
Hi,
While trying to root my android emulator where I delete all the files in the /data/ folder and copy files from /system/ to /data/, I am getting the following error,
Code:
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
cp: write error: No space left on device
Could anyone help me how to overcome this issue?
Hi,
i've followed your instructions step by step and didn't encounter any problems while executing the commands, but the emulator is not getting rooted according to the Root Checker app (see also the screenshot attached). Could you help me please to solve this issue?
Here is an enumeration of the commands I've entered into the console:
emulator -avd Huawei -partition-size 256 -no-snapshot-load
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
adb push "C:\Users\Admin\Desktop\Superuser-3.0.7-efghi-signed\system\bin\su" /system/xbin/
adb push "C:\Users\Admin\Desktop\busybox binary\busybox" /system/xbin/
adb shell chmod 06755 /system/xbin/su
adb shell chmod 06755 /system/xbin/busybox
adb install "C:\Users\Admin\Desktop\Superuser-3.0.7-efghi-signed\system\app\Superuser.apk"
adb install "C:\Users\Admin\Desktop\Root Checker App.apk"
Hi,
I have the device created in AVD, started, but for the life of me I cannot open ADB:
Code:
[email protected]:~$ sudo adb devices
[sudo] password for joel:
List of devices attached
[email protected]:~$
What to I have to do to trick the virtual device in advertising ADB? Developer is on, USB debugging is on. Using a virtual device as closely matching the LG Optimus F3Q as I can recall (so API 16 / Android 4.1.2 loaded).
Many thanks.
EDIT: Figured it out. Need to use the adb provided in the Android SDK (in the platform-tools directory), not any other version (I was using the Debian-provided one).
Unable to root nexus 4 avd
I tried to root Nexus_4_API_21.avd (lollipop) following commands from the post exactly.
I used latest versions of superuser, and busybox.
But at the end emulator is not rooted.
Could someone help with with this, if you have rooted avd please share it so that I can download.
Thank you.
Regards
I tried to root with Lollipop, Kitkat, and even Gingerbread, but it doesn't work.
Under Lollipop and Kitkat, it's not rooted, but under Gingerbread, I can't install any application afterwards.
When I try to, the emulator looks like it reboots, but it never goes to the end, and keeps showing the Android logo glowing.
For android 4, 5 and 6 I write manual in russian. Read it here: http://4pda.ru/forum/index.php?showtopic=318487&view=findpost&p=45421931
Worked for me with AVD Lollipop and Marshmallow.

[Q] Get stucked in a read only filesystem

Dear all,
i dont know exactly how i did it but im now on my ubuntu touch in a read only filesystem...
Code:
sudo apt-get update
sudo: unable to mkdir /var/lib/sudo/phablet: Read-only file system
I noticed that as i wanted to connect with ssh to the phone to transfer my .csv file but have no write access anymore.
If i flash the phone with
Code:
phablet-flash cdimage-legacy
i have write access.
Reflashing to
Code:
phablet-flash cdimage-touch
bring me back to a Read-only file system
What did i wrong (well this could be hard to answer by you ^^) and how can i solve this?
Try phablet-flash cdimage-touch -b
You'll lose all your data!!
Thanks!
So to understand it for the future:
Code:
phablet-flash cdimage touch [B]-b[/B]
performs a full bootstrap where
Code:
phablet-flash cdimage touch
just flash the daily build without data whiping?
Yes, you're right! With -b you do a clean flash and you can start from scratch. Without the bootstrap it just overwrites system data (system apps, ...) but all your files are still on the device.
Tip: Type into a terminal phablet-flash cdimage-touch -h to see all commands (but I think you've already done this).
If you are on Read-Only (recent builds) you can switch with :
$ adb shell
$ mount /dev/loop0 / -o remount,rw
It remains only one session
source : https://wiki.edubuntu.org/QATeam/TouchTesting
eagleofdeath13 said:
If you are on Read-Only (recent builds) you can switch with :
$ adb shell
$ mount /dev/loop0 / -o remount,rw
It remains only one session
source : https://wiki.edubuntu.org/QATeam/TouchTesting
Click to expand...
Click to collapse
That's the most helpful thing I've seen since ubuntu-system emerged... Thanks, I was ready to revert to cdimage-touch, but now I won't have to. :highfive:
So following the example, I opened terminal on my GNex (latest ubuntu-system --channel saucy --no-backup) and typed in
Code:
sudo mount /dev/loop0/ -o remount, rw
after entering the password for sudo, I next typed
Code:
sudo dpkg-reconfigure tzdata
and it brought up the timezone applet.
I was allowed to write my current time to the system!!!!!
I did the same
And you can apt-get too ^^

[Q] Make a full backup for flashing with busybox

Hello
There's a way for making a backup with RAW extension that can be flashed with fastboot in asus fonepad (i don't know about others)
See this: http://forum.xda-developers.com/showthread.php?t=1818321
Back up of the whole memory block (via adb)
Connect the phone in ADB mode and unlock the screen.
Open one Cygwin Terminal and enter (replace mmcblk0 if needed):
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
You will see the cursor blinking at the left. Now the phone is waiting to send the block over the network.
Open another Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
You will see how the image size is growing until it finishes. Now you have the whole phone backed up in raw format. You can see the contents of the GPT partition with gptfdisk tool, available for windows, linux and such. See official website and sourceforge to get it. You can do it the same from ClockWorkMod Recovery but you have to mount first the /system partition since the busybox included with clockworkmod does not come with netcat and you have to use the one from the system partition.
With further linux tools you could edit or extract single partitions from the whole block.
Click to expand...
Click to collapse
But it's for rooted devices only. how can i make a backup with busybox non-root?

Categories

Resources