Hello there,
Im trying to create my own file explorer (a very stripped down one) with root privileges just to learn how to code for android. Anyways, i am able to access my /system folder and look in every folder besides the /data folder. There are no subdirectories... its just empty. When i check through ADB or through terminal emulator, i can see al the folders in the /data folder. So what am i doing wrong???
I have this setup for now,
Code:
final Runtime runtime = Runtime.getRuntime();
try {
runtime.exec("su");
}
just go get root access, but i dont even know if thats correct. The app asks for root permissions and i can accept it but i still cant view the /data folder...
I also tried
Code:
runtime.exec("mount -o remount,ro -t yaffs2 /dev/block/mtdblock5 /data");
and
Code:
runtime.exec("mount -o remount,rw -t yaffs2 /dev/block/mtdblock5 /data");
and still nothing...
Related
Is there a way to make all applications store their data in a folder other than /sdcard (root folder on the sd card) ?
I'm planning on rooting and thought that this time round I can keep my sdcard nice and organized by creating an "ApplicationData" folder in the root of the sdcard and somehow configuring android to use that.
On a similar note, can I move the DCIM (camera photos) to a different location too?
Will the below change-mount-point idea work?
Maybe as root we can
1) un-define /sdcard (in /etc/fstab) //or wherever its defined
2) define /sdcard as /dev/<hdb0>/ApplicationData //change hdb0 to the appropriate device/partition
thanks.
Yeah, I see your point... but quite frankly, I believe it's upto the app developers [my knowledge of the Android world is still from the stone-age!!]... if the app specifies that it's data will be stored in /sdcard/AppName, there's not much you can do, unless you can modify the app...
I was thinking that maybe as root we can
1) un-define /sdcard (in /etc/fstab) //or wherever its defined
2) define /sdcard as /dev/<hdb0>/ApplicationData
edit: added to post#1
britoso said:
I was thinking that maybe as root we can
1) un-define /sdcard (in /etc/fstab) //or wherever its defined
2) define /sdcard as /dev/<hdb0>/ApplicationData
edit: added to post#1
Click to expand...
Click to collapse
I did think of this too...
/sdcard --> /sd/AppData
rest of sd card --> /sd
but I think it would mean some other changes as well... for example... the mount usb functionality would have to be modified to mount/unmount a different volume...
So heres the contents of my fstab file:
Code:
C:\>adb shell cat /system/etc/fstab
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2 rw
/dev/block/mmcblk0p1 /sdcard vfat rw
/dev/block/mmcblk0p2 /system/sd auto rw
/system/modules/modules.sqf /system/modules squashfs ro,loop
/system/xbin/xbin.sqf /system/xbin squashfs ro,loop
I'll try changing line 4 (/sdcard), I'm guessing /system/sd is for when I apps2sd is enabled.
Question: How do I escape from INSERT/EDIT mode in VI? Tried pressing trackball+1, trackball+1+2...didnt work
Hey britoso!
Keep us updated with your accomplishments. I, personally, am very interested in being able to achieve this.
Good luck!
update: that didnt work.
Note: the way to get the ESCAPE character is CONTROL + [ (hold the trackball then press [ ). The control key is configurable and defaults to the Jogball/TrackBall
here are the contents of my fstab file, the camera app is still writing to the root of the sdcard (/sdcard/DCIM)
Code:
C:\>adb shell cat /system/etc/fstab
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2 rw
/dev/block/mmcblk0p1 /sdcard/AppData vfat rw
/dev/block/mmcblk0p2 /system/sd auto rw
/system/modules/modules.sqf /system/modules squashfs ro,loop
/system/xbin/xbin.sqf /system/xbin squashfs ro,loop
Heres the output of "df"
Code:
C:\>adb shell df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 197600 0 197600 0% /dev
tmpfs 4096 0 4096 0% /sqlite_stmt_journals
/dev/block/mtdblock3 148480 100088 48392 67% /system
/dev/block/mtdblock5 200960 63752 137208 32% /data
/dev/block/mtdblock4 97280 39628 57652 41% /cache
/dev/block//vold/179:1
15643712 6843256 8800456 44% /sdcard
@britoso
This is what I found out about mounts in Android...
The init program directly mounts all filesystems and devices using either hard-coded file names or device names generated by probing the sysfs filesystem (thereby eliminating the need for a /etc/fstab file in Android).
And from what I see in your df output, it didn't mount /sdcard/AppData...
Have a few ideas in mind... gonna try 'em out now...
craigacgomez said:
gonna try 'em out now...
Click to expand...
Click to collapse
thanks for the info. Let us know how it works out.
Here's what I reached finally...
To achieve this, I have 2 ideas...
1. We gotta modify the init and change the SD mount point to AppData and add another for the rest of the SD... this however would require a rebuilt ROM (I can't edit init on the phone, need to edit init.c from the source)
2. We push some startup scripts to achieve this, but so far, I haven't been able to mount anything else on /sdcard (operation failed), but I think I'm doing something wrong...
Didn't get much time to experiment... and it mite be a busy end of week for me... but I'll try to squeeze in so time to get this...
Why not ask Cyanogen to do this for us in his next ROM?
Or your next favorite modder?
I'm sure they'll like this idea!?
theres a setting in /init.rc that may help
Code:
export EXTERNAL_STORAGE /sdcard
However / is mounted read-only
mount
rootfs on / type rootfs (ro,relatime)
Click to expand...
Click to collapse
Hi i moved some files from system/app into the sd card to get some space so i could use the metamorph app but i didnt work so i was going to move back the files from the sd card to system/app but now they wont move there anyone know a soloution how to do this?
thanks in advance
system is readonly
you must do an
adb shell
mount /dev/block/mtdblock3 /system
then you can fool around with your system apps
mount /dev/block/mtdblock3 /system || I wrote that but it says
"mount: mounting /dev/block/mtdblock3 on /system failed: Device or resource busy"
i rooted my phone yesterday quite knew to android and i have no clue what to do
You are doing that in recovery mode right?
I tried in ClockworkMod Recovery v2.5.0.1 but it says Device or resource busy :/ have no clue.
ClockworkMod has a nice green menu on screen from where you can see (partitions menu) which partitions are already mounter and which are not.
You can also do adb shell and run "mount" in it to see which partitions are mounted and in what way. ClockworkMod has /etc/fstab so you can mount system just by running "mount /system". If system is already mounted, you can cd to /system/app and try "touch test". If you get permission denied then your system is mounted read-only otherwise you will see test file in /system/app if you run "ls".
I did adb shell and did run "mount" and it says /dev/block/mtdblock3/ on /system type yaffs2 <ro>
I downloaded a app called root explore and the main reason for that was so i could move some files from system/app so i could get some free space so i could use metamorph that was my plan and i moved some files i have eard you could move that wouldnt harm anything but it wasnt enough free space, so my plan was to move back the files i had moved into the sd card some went great but i have like 4 files that i cant bks it says "You cannot paste here because the file system is read-only" is there any other way to push those file into the system/app again? have tried the things u wrote up.
And im not a very pro of theese things i started with this yesterday so excuse me for being stupid!
This:
/dev/block/mtdblock3/ on /system type yaffs2 <ro>
...means that system is mounted read-only (mind that "ro" at the end).
Try running "mount -o remount,rw /system". If it doesn't help run "cat /etc/fstab" and post here the output. You need to be in recovery mode while doing this of course!
did "mount -o remount,rw /system" and it said mount: can't find /system in /proc/mounts
and the other one said
/dev/block/mtdblock4 /cache yaffs2 rw
/dev/block/mtdblock5 /data yaffs2rw
/dev/block/mtdblock3 /system yaffs2 rw
/dev/block/mmcblk0p1 /sdcard vfat rw
/dev/block/mmcblk0p2 /sd-ext auto rw
used my brain a little now and in the recovery settings i did mount the /system in the menu and now i tried to write cd /system/app and now in the cmd it is like this "/system/app #" anything useful?
Sure... as I already told you try to run "touch /system/app/test". This command shoud make empty test file in /system/app. If you get permission denied then you have read-only system. If it suceede, then your /system is writable and you can see all the contents of /system/app by runing "ls".
I wrote that and it wrote the same
"touch /system/app/test"
no permmission denied then it may have worked?
i checked and there is a testfile in /system/app now
I think i got it to work now thanks man for all your help!
hi, I found somewhere a linux command which after running it on android terminal (as rooted):
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
I have been able to read and pull system folder.allthough when I try to manual copy busybox in the directory /system/xbin/ it tells me that there is not enought memory...any ideas how to bypass that too?
I am using eclair 2.1 with hboot 1.01.0001
Are you in the recovery.. When you are doing this?? if so, then enable "Mount /system" under advanced options..
beastaki23 said:
hi, I found somewhere a linux command which after running it on android terminal (as rooted):
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
I have been able to read and pull system folder.allthough when I try to manual copy busybox in the directory /system/xbin/ it tells me that there is not enought memory...any ideas how to bypass that too?
I am using eclair 2.1 with hboot 1.01.0001
Click to expand...
Click to collapse
this is HTC's NAND protection. you need to wait for S-OFF to get a writeable system partition. like the previous post mentioned, currently you can only write to system partition when you are in recovery mode (or flash update.zips)
Hi!
I have rooted my phone (LG Optimus 2X) and mistakenly deleted some files.
I have these files, and want to push them back using adb, put my problem is, that when i try to mount the system in read / write mode using "adb remount" i get this error: "remount faileded: Operation not permitted".
I can't figure out how to fix it, i can pull files etc.
I have also tried to use the adb shell, and copy the files from the internal sdcard, but i'm getting the same error.
Only read-mode.. :/
Anybody who can help, fixing this problem?
If you want to mount /system just write:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Then you're good to go
How to unmount into read-mode only?
Thank! - You saved my day
mrhtml said:
How to unmount into read-mode only?
Thank! - You saved my day
Click to expand...
Click to collapse
A little easier to type...
Mount r/w
Code:
busybox mount -o,remount -rw /system
Mount r/only
Code:
busybox mount -o,remount -r /system
Edit: You shouldn't post stuff like this in dev
I have a rooted Pixel 7 and It was suggested that I rename a system file to prevent the system from updating itself (despite my having turned off all such options). My first attempt was to merely try renaming the file, but that didn’t work because the file systems in mounted RO.
I did some looking around, and the common approach to dealing with this issue is to remount the file system. Following is a ‘screen grab’ of my abd session:
Code:
cheetah:/ $ su
cheetah:/ $ ls /product
app etc fonts framework lib lib64 lost+found media overlay priv-app tts usr wallpaper
(this has the directory I want, so this file system)
cheetah:/ $ mount | grep product
/dev/block/dm-15 on /product type ext4 (ro,seclabel,relatime)
(this is a mounted file system)
cheetah:/ # mount -o rw,remount /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount -t ext4 /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount /dev/block/dm-15 /product
'/dev/block/dm-15' is read-only
(three attempts to remount – all failed)
So, now what should I try?
groston said:
I have a rooted Pixel 7 and It was suggested that I rename a system file to prevent the system from updating itself (despite my having turned off all such options). My first attempt was to merely try renaming the file, but that didn’t work because the file systems in mounted RO.
I did some looking around, and the common approach to dealing with this issue is to remount the file system. Following is a ‘screen grab’ of my abd session:
Code:
cheetah:/ $ su
cheetah:/ $ ls /product
app etc fonts framework lib lib64 lost+found media overlay priv-app tts usr wallpaper
(this has the directory I want, so this file system)
cheetah:/ $ mount | grep product
/dev/block/dm-15 on /product type ext4 (ro,seclabel,relatime)
(this is a mounted file system)
cheetah:/ # mount -o rw,remount /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount -t ext4 /product
'/dev/block/dm-15' is read-only
cheetah:/ # mount -o rw,remount /dev/block/dm-15 /product
'/dev/block/dm-15' is read-only
(three attempts to remount – all failed)
So, now what should I try?
Click to expand...
Click to collapse
I haven't used this, but maybe it can help you.
Lughnasadh said:
I haven't used this, but maybe it can help you.
Click to expand...
Click to collapse
Thank you. Seems like this might work, but after reading several pages, I am not sure how to install/use overlayfs. I have a Windows system - any chance you could point me to something that provides some guidance?
groston said:
Thank you. Seems like this might work, but after reading several pages, I am not sure how to install/use overlayfs. I have a Windows system - any chance you could point me to something that provides some guidance?
Click to expand...
Click to collapse
I've never used this before but I believe once you flash the module it makes the /system RW so you can start making modifications. There's a README that provides some information. I don't know of any other guides besides the information on that Github page.
Checking out the thread below might reveal a solution and/or give a clue or hint...
Pixel 7 Pro Stuck in read only mode (rooted with magisk 26.1) Am I missing something? HELP
Everything ive tried in FX Explorer fails. No matter what I try, for example editing build.prop or anything else, it constantly says read only. i cannot use any method to allow write access. Did i miss something when i rooted with Magisk? I dont...
forum.xda-developers.com
simplepinoi177 said:
Checking out the thread below might reveal a solution and/or give a clue or hint...
Pixel 7 Pro Stuck in read only mode (rooted with magisk 26.1) Am I missing something? HELP
Everything ive tried in FX Explorer fails. No matter what I try, for example editing build.prop or anything else, it constantly says read only. i cannot use any method to allow write access. Did i miss something when i rooted with Magisk? I dont...
forum.xda-developers.com
Click to expand...
Click to collapse
Good suggestion. I installed FX File Explorer, gave it the appropriate permissions, but was unable to change the /product filesystem to read/write.
groston said:
Good suggestion. I installed FX File Explorer, gave it the appropriate permissions, but was unable to change the /product filesystem to read/write.
Click to expand...
Click to collapse
When you say "gave it the appropriate permissions", just to confirm -- that doesn't mean that you changed the security permissions on the folder & files, correct? I hope it means you did not do what the OP in that thread had done and actually did enable root access particularly (hoping that's what you meant on "gave it appropriate permissions").
Because, in certain cases, I've changed permissions on files/folders vs. simply enabling root access mode....
Apologies in advanced if my inquiry seems fairly obvious (to the point of insulting maybe; it is not meant to be), but you never know and many foolish things has been done/assumed on this site that missed many (obvious) things because it wasn't confirmed....