[Q] [A700] CyanogenMod 10.1.2 adb access to /data/media/ - Acer Iconia A700 and A510

I can't post this to the thread:
"[NIGHTLY][ROM][4.2.2] CyanogenMod 10.1 for Acer A700"
because of forum rules. Anyway I hope someone sees this ...
I just installed cm-10.1.2-a700 (2013.07.11) to my A700.
Installed CWM and boot.img via fastboot did a complete wipe and formated all the storage.
(Did this multiple times just to ensure I did not make anything wrong)
CM is working so far.
But I think there is a bug with permissions:
Trying to push files via adb to /data/media results in an error with "permissions denied".
The reason is:
the directory tree of /data/media is owned by user and group: media_rw
Code:
ls -l /data/media
drwxrwx--- 18 media_rw media_rw 4096 Jul 14 14:20 0
drwxrwxr-x 2 media_rw media_rw 4096 Jul 13 03:18 legacy
drwxrwx--- 14 media_rw media_rw 4096 Jul 14 14:05 obb
adb connects the A700 als user "shell".
But user shell does not belong into group media_rw
Code:
[email protected] / $ whoami
shell
[email protected] / $ groups
shell graphics input log mount adb sdcard_rw sdcard_r net_bt_admin net_bt inet net_bw_stats
also the file "/system/etc/permissions/platform.xml" states:
Code:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
</permission>
but correct would be:
Code:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>
Anyway changing that does not fix the problem.
Group and user IDs are hardcoded in Android so without baking the ROM myself there is no fix for the permission denied Problem. (am I right?)
Starting adbd with "adb root" would do the trick but only in developer builds, so this would be no solution for distributing a file transfer script which I am writing ...
Is there a solution or is this a real bug in cm-10.1.2 for A700?

lieschenmueller said:
I can't post this to the thread:
"[NIGHTLY][ROM][4.2.2] CyanogenMod 10.1 for Acer A700"
because of forum rules. Anyway I hope someone sees this ...
I just installed cm-10.1.2-a700 (2013.07.11) to my A700.
Installed CWM and boot.img via fastboot did a complete wipe and formated all the storage.
(Did this multiple times just to ensure I did not make anything wrong)
CM is working so far.
But I think there is a bug with permissions:
Trying to push files via adb to /data/media results in an error with "permissions denied".
The reason is:
the directory tree of /data/media is owned by user and group: media_rw
Code:
ls -l /data/media
drwxrwx--- 18 media_rw media_rw 4096 Jul 14 14:20 0
drwxrwxr-x 2 media_rw media_rw 4096 Jul 13 03:18 legacy
drwxrwx--- 14 media_rw media_rw 4096 Jul 14 14:05 obb
adb connects the A700 als user "shell".
But user shell does not belong into group media_rw
Code:
[email protected] / $ whoami
shell
[email protected] / $ groups
shell graphics input log mount adb sdcard_rw sdcard_r net_bt_admin net_bt inet net_bw_stats
also the file "/system/etc/permissions/platform.xml" states:
Code:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
</permission>
but correct would be:
Code:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>
Anyway changing that does not fix the problem.
Group and user IDs are hardcoded in Android so without baking the ROM myself there is no fix for the permission denied Problem. (am I right?)
Starting adbd with "adb root" would do the trick but only in developer builds, so this would be no solution for distributing a file transfer script which I am writing ...
Is there a solution or is this a real bug in cm-10.1.2 for A700?
Click to expand...
Click to collapse
Well, don't have time to look at the issue, but can only state what I know about CM, PA, and that is, these roms change the directory structure of internal and external storage.
I always run into the issue, where evreything is put in a directory called "0". And sometimes, it will replicate itself, with several subdirectories called "0". Depends on how often you flash CM roms. (on my A501 it filled the internal memory, which is why I don't run CM anymore)
Hence, my former CWM backups don't work, as they have issues with this directory structure.
Not sure if this helps.
MD

I'm running cm10.1.2 stable with out that issue.
Currently that dir is owned by root
Is this the first rom you've loaded past stock?
My platform.xml looks the same as yours.
Just gid=sdcard_rw

jamart3d said:
I'm running cm10.1.2 stable with out that issue.
Currently that dir is owned by root
Is this the first rom you've loaded past stock?
My platform.xml looks the same as yours.
Just gid=sdcard_rw
Click to expand...
Click to collapse
Naw, I've flashed plenty, but mainly run my own custom from stock unless I'm testing somebody's build.
Like I said, even on my A501, everytime I flashed a CM build, I wound up with the directory "0". This also was created on the internal sd as well. Each sub-dir "0" contained an image of the previous contents. Haven't investigated it a lot, but suspect maybe CWM versions or something else, however, I typically run the latest.
With my rom, I can simply do a "mount /data" and push without issues.
EDIT I'll check out pushing to the media folder. I notice there are no permissions on "Other" for that folder.
A chmod in the script perhaps would fix?

Sorry MD, I was asking the op.
I've loaded cm10.1.+ before and after the build he ref'd.
I think if he loads the stable, he may not have this issue
Anyway, just trying to get my 10 posts too.

hey guys thanks for your replys!
@Moscow Desire
I always run into the issue, where evreything is put in a directory called "0". And sometimes, it will replicate itself, with several subdirectories called "0". Depends on how often you flash CM roms. (on my A501 it filled the internal memory, which is why I don't run CM anymore)
Hence, my former CWM backups don't work, as they have issues with this directory structure.
Click to expand...
Click to collapse
Yeah I recognized that. but I do not see a problem there, because log in as root and move the data and most stuff is working. It has to be done only right after you flash the ROM, so I don't care.
doing a chmod right after flashing so that /data/media/ belongs to sdcard_r ... I did that once and quite some apps were broken afterwards.
So messing with chmod onto /data/media seems not a good idea. Also doing a "fix permissions" in CWM resets the access rights, anyway ...
(and the other way: doing a chmod in the script won't work because shell has no rights on /data/media)
Not beeing able to access data which belongs to user and group "media_rw" via adb is my problem.
@jamart3d
if uid = root and gid = media_rw, then the same problem occures. User "shell" can't access, because he has uid=shell and does not belong to group media_rw.
last half year or so i had iconiaN 2.6 running, right before i testet an nightly version of cyanogenmod 10.0, but was not satisfied. Last days I thought i might improve my A700 with cyanogenmod 10.1.2, but I'm not that happy with it yet.
----
I further poked into darkness of the rom...
I found that "/mnt/shell/emulated" is the fuse-mounted dir of /data/media/, so that might do as workaround.
But I still think that user "shell" should belong into group media_rw. And that beeing not the case I would say it is a bug.

Sorry, I can't replicate the bug in stable version after 711
Have you tired 7comp version?

jamart3d said:
Sorry, I can't replicate the bug in stable version after 711
Have you tired 7comp version?
Click to expand...
Click to collapse
I cant find a stable version more recent than 2013.07.11 or do you mean a nightly build?
I have not tried 7comp yet.

Sorry, yes I did mean 2013.07.11. stable,
It is the version I'm on now.
For some reason I thought you were trying the version just before.

Related

fix_permissions improvement

I've just installed the last porting of the cyanogen for my Magic 32a. I'm enjoining the idea behind the script fix_permissions. But, observing the structure of the files/folders in my /data/data/, I can see that it is not perfect.
It does chown the folders /data/data/NAME-OF-PACKAGE/ and the subfolders 'databases' and 'shared_prefs'.
Observing the typical contents of my /data/data/ I can see that some applications has further folders and some times also single files in /data/data/NAME-OF-PACKAGE/ that need a touch of chown.
For example:
/data/data/com.htc.android.mail/
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 app_config
drwxrwxrwx 1 10021 10021 2048 Aug 18 09:00 app_mail_eas
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 app_mail_temp
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 app_temp
-rw------- 1 10021 10021 1048576 Aug 18 09:00 bufferFileForMailAP
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 databases
drwxr-xr-x 1 1000 1000 2048 Aug 18 08:41 lib
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 shared_prefs
You can test on your system by yourself:
for APP in /data/data/* ; do echo -e "\n$APP" ; ls -l $APP ; done | more
I'm attaching an improved version that should fix the permissions on all the subfolders different than 'lib' and also on the single files.
I hope it works for you and that it can be included in the future firmwares.
UPDATE: in this thread, several users are making contributions to the original script (with a fast increasing version number ). There is also a report in the Cyanogen bug system: http://code.google.com/p/cyanogenmo...ID Type Status Priority Version Owner Summary
You should find there the last revision. Thanks to all for the contributions.
ankn said:
I've just installed the last porting of the cyanogen for my Magic 32a. I'm enjoining the idea behind the script fix_permissions. But, observing the structure of the files/folders in my /data/data/, I can see that it is not perfect.
It does chown the folders /data/data/NAME-OF-PACKAGE/ and the subfolders 'databases' and 'shared_prefs'.
Observing the typical contents of my /data/data/ I can see that some applications has further folders and some times also single files in /data/data/NAME-OF-PACKAGE/ that need a touch of chown.
For example:
/data/data/com.htc.android.mail/
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 app_config
drwxrwxrwx 1 10021 10021 2048 Aug 18 09:00 app_mail_eas
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 app_mail_temp
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 app_temp
-rw------- 1 10021 10021 1048576 Aug 18 09:00 bufferFileForMailAP
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 databases
drwxr-xr-x 1 1000 1000 2048 Aug 18 08:41 lib
drwxrwx--x 1 10021 10021 2048 Aug 18 09:00 shared_prefs
You can test on your system by yourself:
for APP in /data/data/* ; do echo -e "\n$APP" ; ls -l $APP ; done | more
I'm attaching an improved version that should fix the permissions on all the subfolders different than 'lib' and also on the single files.
I hope it works for you and that it can be included in the future firmwares.
Click to expand...
Click to collapse
Btw, I was wondering why we fix only userId and not also sharedUserId
as I'm quite sure I've seen them messed up sometimes after some of my to
ambitious experiments. Shouldn't be difficult to add support for that if there
is some evidence that it is a Good Thing(tm).
farmatito said:
Btw, I was wondering why we fix only userId and not also sharedUserId
Click to expand...
Click to collapse
I don't understand the meaning of the parameter "sharedUserId". Some packages in packages.xml use the parameter "UserId", others the "sharedUserId" one. What's the difference?
ankn said:
I don't understand the meaning of the parameter "sharedUserId". Some packages in packages.xml use the parameter "UserId", others the "sharedUserId" one. What's the difference?
Click to expand...
Click to collapse
shared user id is for the case when you have a program extended by another installable program in order to run in the same process:
http://developer.android.com/reference/android/R.attr.html#sharedUserId
Another improvement could be to fix the file modes as well. I have noticed that sometimes the user permissions on files and directories in /data/data get removed.
Then you get FCs with an sqlite error like below:
Code:
sqlite3_open_v2("/data/data/com.xta.foodmkt/databases/Hungry.db", &handle, 6, NULL) failed
The below commands fixes the access errors:
Code:
find /data/data -type d -exec busybox chmod u+rwx {} \;
find /data/data -type f -exec busybox chmod u+rw {} \;
farmatito said:
Btw, I was wondering why we fix only userId and not also sharedUserId
as I'm quite sure I've seen them messed up sometimes after some of my to
ambitious experiments. Shouldn't be difficult to add support for that if there
is some evidence that it is a Good Thing(tm).
Click to expand...
Click to collapse
I'm attaching another version with support to packages with sharedUserId; fixed the remount mechanism that doesn't work on the other firmware that I'm actually using (HoFo).
smeat said:
The below commands fixes the access errors:
Code:
find /data/data -type d -exec busybox chmod u+rwx {} \;
find /data/data -type f -exec busybox chmod u+rw {} \;
Click to expand...
Click to collapse
This code should fixes all the permission-related problems but it is too risky from the security point-of-view.
ankn said:
This code should fixes all the permission-related problems but it is too risky from the security point-of-view.
Click to expand...
Click to collapse
Why risky, if i understand it right:
directory: 700 (owner only can read, write or enter directory)
files: 600 (owner only can read or write file)
Where is the risk?
You can also use:
chmod 700 directory
chmod 600 files
farmatito said:
Why risky, if i understand it right:
directory: 700 (owner only can read, write or enter directory)
files: 600 (owner only can read or write file)
Where is the risk?
You can also use:
chmod 700 directory
chmod 600 files
Click to expand...
Click to collapse
It doesn't even go that far, it ADDS the owner to the permissions, not reset them to just the owner having permissions.
smeat said:
It doesn't even go that far, it ADDS the owner to the permissions, not reset them to just the owner having permissions.
Click to expand...
Click to collapse
This in my opinion is far more risky than doing
a chmod for the owner only at least in the case
that the permissions are messed up for whatever
reason as some insecure settings will not be corrected
that way, e.g.:
permissions are wrongly set to 666 or 777
than you do chmod +urwx file and the result
will continue to be an insecure setting 666 or
677 that doesn't enforce isolation between apps.
BTW, by looking at ls of /data/data it seems to
me that all folders have 755 permissions so
chmod 755 folder should be safe. For the deeper level:
Code:
/data/data/app 755
/data/data/app/files 700
/data/data/app/lib 755
/data/data/app/shared_prefs 771
but I have not the time right now to check all subfolders
to see if there are exceptions to this default settings.
smeat said:
It doesn't even go that far, it ADDS the owner to the permissions, not reset them to just the owner having permissions.
Click to expand...
Click to collapse
This is true. Sorry!
farmatito said:
This in my opinion is far more risky than doing
a chmod for the owner only at least in the case
that the permissions are messed up for whatever
reason as some insecure settings will not be corrected
that way, e.g.:
permissions are wrongly set to 666 or 777
than you do chmod +urwx file and the result
will continue to be an insecure setting 666 or
677 that doesn't enforce isolation between apps.
BTW, by looking at ls of /data/data it seems to
me that all folders have 755 permissions so
chmod 755 folder should be safe. For the deeper level:
Code:
/data/data/app 755
/data/data/app/files 700
/data/data/app/lib 755
/data/data/app/shared_prefs 771
but I have not the time right now to check all subfolders
to see if there are exceptions to this default settings.
Click to expand...
Click to collapse
fix_permissions is not about removing permissions and never has been from what I can tell. Currently it just goes through the /data/system/packages.xml and finds the listed owner of the /data/data files and then changes ownership of the files and directories.
I am talking about adding an additional chmod to make it so that file and directory owners are added as being able to read/write to the files they own. I have seen an issue were running something made it so that a ton of my application sqlite databases had file permissions of 060. When this happens you get the error I posted originally: sqlite3_open_v2("/data/data/com.xta.foodmkt/databases/Hungry.db", &handle, 6, NULL) failed. Even though the group write and read bit are set and the group is correct the error above happens. Adding the owner back as having read/write permissions fixes this error.
Again, adding permissions to only the user/owner of the files and directories does not open the files up to being written by other processes on the phone.
Again, adding permissions to only the user/owner of the files and directories does not open the files up to being written by other processes on the phone.
Click to expand...
Click to collapse
I know. I was trying to improve the concept of fix permission as you can not know
in advance how the permissions could have been messed up. So it would be better
to enforce some sane defaults rather than to add some hacks to fix a specific problem.
This obviously is only possible if there are some patterns in file and folder permissions of /data/data.
That is what i will try to find out.
farmatito said:
I know. I was trying to improve the concept of fix permission as you can not know
in advance how the permissions could have been messed up. So it would be better
to enforce some sane defaults rather than to add some hacks to fix a specific problem.
This obviously is only possible if there are some patterns in file and folder permissions of /data/data.
That is what i will try to find out.
Click to expand...
Click to collapse
Ahhh, sorry I misunderstood what you were getting at.
If you run:
Code:
find /data/data -type f -exec ls -l {} \;
Will tell you what all the files are currently set to.
A run of:
Code:
find /data/data -type d -exec ls -ld {} \;
Will list the current directory permissions.
What I can find is that any /sslcache directory is 700, /lib 755 and owned by 1000:1000, /database 771, /shared_prefs 771, But I have some apps with 700 directories for everything.
Here is a table for /data/data/app, format: directory/file, permissions, ownership
Directories:
/database 771 appuser:appgroup
/lib 755 1000:1000
/shared_prefs 771 appuser:appgroup
/sslcache 700 appuser:appgroup
/anythingelse 771 appuser:appgroup
Files:
/database/* 660 appuser:appgroup
/lib/* ??? ??????, never seen any files in these directories.
/sslcache/* 600 appuser:appgroup
/shared_prefs/* 660 appuser:appgroup
/anythingelse/* 660 appuser:appgroup
Does this align with what you are seeing? If so we can adjust the script to apply these permissions to the files and directories more selectively.
I was actually wondering about this very thing yesterday. Is there some reason why the initial script only changed the permissions of databases and shared_prefs?
I'm trying to think of a scenario in which you wouldn't just want a recursive chown, but especially in the case of wiping and then copying back data directories, having ALL the subdirectories owned by the app's uid seems preferable to having any of them owned by the wrong uid.
smeat said:
Ahhh, sorry I misunderstood what you were getting at.
If you run:
Code:
find /data/data -type f -exec ls -l {} \;
Will tell you what all the files are currently set to.
A run of:
Code:
find /data/data -type d -exec ls -ld {} \;
Will list the current directory permissions.
What I can find is that any /sslcache directory is 700, /lib 755 and owned by 1000:1000, /database 771, /shared_prefs 771, But I have some apps with 700 directories for everything.
Here is a table for /data/data/app, format: directory/file, permissions, ownership
Directories:
/database 771 appuser:appgroup
/lib 755 1000:1000
/shared_prefs 771 appuser:appgroup
/sslcache 770 appuser:appgroup
/anythingelse 771 appuser:appgroup
Files:
/database/* 660 appuser:appgroup
/lib/* ??? ??????, never seen any files in these directories.
/sslcache/* 600 appuser:appgroup
/shared_prefs/* 660 appuser:appgroup
/anythingelse/* 660 appuser:appgroup
Does this align with what you are seeing? If so we can adjust the script to apply these permissions to the files and directories more selectively.
Click to expand...
Click to collapse
So far this is what i've found:
Code:
/data/data/pkgdir uid/gid 755
/data/data/pkgdir/lib system/system 755
/data/data/pkgdir/databases uid/gid 771
/data/data/pkgdir/databases/*.db uid/gid 660
/data/data/pkgdir/shared_prefs uid/gid 771
/data/data/pkgdir/shared_prefs/*.xml uid/gid 660
/data/data/pkgdir/cache uid/gid 771
/data/data/pkgdir/cache/* uid/gid 771
The only differences are in the anythingelse part wher I have found
all possible combinations of permissions, but I suspect that these files
and dirs are setup by the apk at runtime as no reference could be found
for them in the apk package nor in the installd source code.
So i think it would be a big improvement to try to fix this standard dirs and their
contents with ownership and permissions as shown above.
This could save a lot of headaches to users and devs. Single apps with
exotic permissions could always be reinstalled or fixed manually.
In script 1.3 you should change:
cat /data/system/packages.xml | grep "^<package" | grep userId
to
cat /data/system/packages.xml | grep "^<package" | grep serId
as else no packages with sharedUserId will be found
farmatito said:
So far this is what i've found:
Code:
/data/data/pkgdir uid/gid 755
/data/data/pkgdir/lib system/system 755
/data/data/pkgdir/databases uid/gid 771
/data/data/pkgdir/databases/*.db uid/gid 660
/data/data/pkgdir/shared_prefs uid/gid 771
/data/data/pkgdir/shared_prefs/*.xml uid/gid 660
/data/data/pkgdir/cache uid/gid 771
/data/data/pkgdir/cache/* uid/gid 771
The only differences are in the anythingelse part wher I have found
all possible combinations of permissions, but I suspect that these files
and dirs are setup by the apk at runtime as no reference could be found
for them in the apk package nor in the installd source code.
So i think it would be a big improvement to try to fix this standard dirs and their
contents with ownership and permissions as shown above.
This could save a lot of headaches to users and devs. Single apps with
exotic permissions could always be reinstalled or fixed manually.
Click to expand...
Click to collapse
Yeah, I was assuming on the /anythingelse.
Alright here is my shot at this modification. Not much of a coder... so be gentle.
I created an issue for this on the code.google.com cyanogenmod site. thenefield posted some changes and I have integrated them into a new script.
smeat said:
I created an issue for this on the code.google.com cyanogenmod site. thenefield posted some changes and I have integrated them into a new script.
Click to expand...
Click to collapse
In your rewrite of the script, you forgot to apply the chown to the subfolders that are different than 'databases' and 'shared_prefs' as well as to the single files in the application-root. Look at my first post in this thread: these cases exist and we have to deal with them. In other words: you reverted my changes.

[Q] Building Harmony/GTablet CyanogenMod from source?

I'm getting pretty far along building CyanogenMod for the GTablet on Mandriva Linux x86_64, I pulled the latest source and did the following from a bash shell:
Code:
cd device/nvidia/harmony
./extract-files.sh
cd ../../..
cp ./vendor/cyanogen/products/cyanogen_harmony.mk ./buildspec.mk
. build/envsetup.sh
lunch cyanogen_harmony-eng
cd vendor/cyanogen
./get-rommanager
./get-google-files -v hdpi
cd ../..
make -j6 CYANOGEN_WITH_GOOGLE=true bacon
I'm wondering if I should have gotten the mdpi-tegra google apps instead? get-google-files requires the following change if so:
Code:
FILENAME=["gapps-hdpi-20101114-signed.zip","gapps-mdpi-20101020-signed.zip","gapps-mdpi-tiny-20101020-signed.zip","gapps-mdpi-tegra-20101020-signed.zip"]
VERSIONS=["hdpi","mdpi","mdpi-tiny","mdpi-tegra"]
then do:
Code:
./get-google-files -v mdpi-tegra
Has anyone gotten this working?
I'm almost 100% positive that you cannot use HDPI gapps. MDPI gapps are the ones that you need to use for CM6.1 for this device.
Good to know, I just got it built but now clockwork doesn't see the update-cm-6.1.0-Beta4-Harmony-signed.zip on the sdcard?!? I can mount and verify the .zip from linux, the file should be in the root directory, correct?
Weird, I tried copying over the clockwork update.zip and recovery/ dirs, now I can see LOST.DIR but nothing else from the recovery install from sdcard option...
Dumb question....but did you mount the sdcard? I've seen that happen if the card is not mounted to /sdcard
Possible /sdcard and /sdcard2 mount confusion?
Nope, from adb shell I can see /mnt/sdcard with the files (which match md5 checksums):
Code:
# ls -lF /mnt/sdcard
d---rwxr-x 3 system sdcard_r 4096 Jan 25 06:51 Android/
d---rwxr-x 2 system sdcard_r 4096 Jan 25 06:51 LOST.DIR/
d---rwxr-x 2 system sdcard_r 4096 Oct 29 2010 recovery/
----rwxr-x 1 system sdcard_r 83928334 Dec 5 2010 update-cm-6.1.0-Beta4-Harmony-signed.zip*
----rwxr-x 1 system sdcard_r 4003082 Nov 9 2010 update.zip*
Is there anything special that needs to be done with permissions? I did have to repartition the sd card, somehow it got really messed up when I tried formatting it from the tablet's setup app.
edit: I found out that the .zip needs to be on /mnt/emmc (which I guess shows up as sdcard from clockwork recovery).

[Q] rm: No such file or directory

Hi all,
First post here and of course search is off ATM, so, sorry in advance if it's already been posted.
The problem I'm currently having is via the terminal emulator, from root:
Code:
# rm -rf /datadata/com.skype.raider
rm: /datadata/com.skype.raider/files/<account>/chatsync/21/obj1286: No such file or directory
The whole problem seems related to this Skype problem:
community.skype.com/t5/Android/Please-re-install-skype-PROBLEM/td-p/71138
which has been introduced with the latest release of the app.
Trying to follow the suggestion someone gave on the thread I tried to delete the dir (after uninstalling the app) with the above result.
I've also tried to chmod and chown -R, but nothing has changed.
To me this looks like a dandling reference to the directory content from a bad coded piece of software. But that's just the idea it gave me.
If anyone has an idea on how to recover from this problem, it'll be more than wellcome.
Thanks
PS: /datadata is a yaffs2 fs.
Try /data/data instead of /datadata/ ?
/data/data is a symbolic link to /datadata
ok, quick update on the matter:
tried to touch the file, no errors whatsoever, but now:
Code:
# ls -l /datadata/com.skype.raider/files/<account>/chatsync/21/
-rw-rw-rw- 1 root root 0 Aug 27 15:51 obj1286
-rw-rw-rw- 1 root root 0 Aug 27 15:51 obj1286
#
WTH :-\

[Q] Not possible to create a symlink in /mnt/sdcard?

Hi,
Is there a way to create a symling in /mnt/sdcard (I want to point to a folder of the microSD)?
Each time I try (several times since yesterday evening...), I receive the message "Function not implemented"...
Example (/data/sdext2 is an EXT2 partition on my microSD) :
Code:
ln -s /data/sdext2/test /mnt/sdcard/Android/data/test
The usage of mount -o bind doesn't work for what I want to do
Thanks in advance for your help!
Regards.
First question of all: Are you rooted? If not, root first.
If you are rooted and using shell inside the TF, be sure you do "su" before entering any command to grant root privileges (you should have the # prompt instead of $).
Aside from that, it should work... If is still giving you trouble please post the entire log for that session (just copy paste what you've entered in the console), so we can help you better.
Hi,
First of all, thanks for your answer!
My TF is rooted and I use Revolver 3.11.
There are 2 partitions on my micro sd :
1) 8 GB - FAT32 - Primary
2) 22 GB - EXT2 - Primary
The second partition is mounted on /data/sdext2 (mount -t ext2 -o rw /dev/block/mmcblk1p2 /data/sdext2).
Here are the commands :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Code:
su
mount -o remount,rw /
cp -pr /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld /data/sdext2/com.triactivemedia.radiocontrolrotorworld
rm -r /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld
ln -s /data/sdext2/com.triactivemedia.radiocontrolrotorworld /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld
busybox ln -s /data/sdext2/com.triactivemedia.radiocontrolrotorworld /mnt/sdcard/Android/data/com.triactivemedia.radiocontrolrotorworld
Thanks in advance for your help!
Regards
Fat32 doesn't support symbolic links. You would need to use a couple of ext* or linux FS's.
Hi.
Thanks for the answer.
The second partition (/data/sdext2) is an EXT2 partition. So it seems it's not the issue...
Regards.
Sent from my HTC Sensation Z710e using Tapatalk
/mnt/sdcard is a fuse shim around /data/media. Crest your symlink there.
ln -s /Removable/MicroSD/folder /data/media/folder
Should generally work for most people, depending how how custom your tf is or in your case the card
Sent from my Transformer Prime TF201 using Tapatalk
Hi Spidey01!
Thanks a lot for your precious help!
You are right, I was able to create the symlink using :
ln -s /data/sdext2/Android/data/com.triactivemedia.radiocontrolrotorworld/ /data/media/Android/data/com.triactivemedia.radiocontrolrotorworld
If I go to /data/media/Android/data, everything is fine (see ls and ls -l here after) :
/data/media/Android/data # ls
com.google.android.apps.maps
com.google.android.gallery3d
com.google.android.music
com.google.android.videos
com.triactivemedia.modelhelicopterworld
com.triactivemedia.radiocontrolrotorworld
com.zinio.mobile.android.reader
/data/media/Android/data # ls -l
drwxrwxr-x media_rw media_rw 2012-01-10 15:31 com.google.android.apps.maps
drwxrwxr-x media_rw media_rw 2012-01-10 15:06 com.google.android.gallery3d
drwxrwxr-x media_rw media_rw 2012-01-10 14:57 com.google.android.music
drwxrwxr-x media_rw media_rw 2012-01-10 14:56 com.google.android.videos
drwxrwxr-x media_rw media_rw 2012-01-11 11:45 com.triactivemedia.modelhelicopterworld
lrwxrwxrwx root shell 2012-01-13 23:01 com.triactivemedia.radiocontrolrotorworld -> /data/sdext2/Android/data/com.triactivemedia.radiocontrolrotorworld/
drwxrwxr-x media_rw media_rw 2012-01-11 11:15 com.zinio.mobile.android.reader
If I go to /mnt/sdcard/Android/data, I see the link when I make a ls but not when I make a ls -l :
/mnt/sdcard/Android/data # ls
com.google.android.apps.maps
com.google.android.gallery3d
com.google.android.music
com.google.android.videos
com.triactivemedia.modelhelicopterworld
com.triactivemedia.radiocontrolrotorworld
com.zinio.mobile.android.reader
/mnt/sdcard/Android/data # ls -l
drwxrwxr-x root sdcard_rw 2012-01-10 15:31 com.google.android.apps.maps
drwxrwxr-x root sdcard_rw 2012-01-10 15:06 com.google.android.gallery3d
drwxrwxr-x root sdcard_rw 2012-01-10 14:57 com.google.android.music
drwxrwxr-x root sdcard_rw 2012-01-10 14:56 com.google.android.videos
drwxrwxr-x root sdcard_rw 2012-01-11 11:45 com.triactivemedia.modelhelicopterworld
drwxrwxr-x root sdcard_rw 2012-01-11 11:15 com.zinio.mobile.android.reader
Do you have another idea? Or should we admit that we can't use symlink with Fuse?
Thanks!!!
I am after this as well, have you managed to get it working?
I managed to symlink to /data/media/0 and file manager sees it there, but if I go to /sdcard there's nothing either.
Isn't there a way to edit fstab to get /sdcard to mount as ext4, instead of fuse? Because all my systems are Linux, I wouldn't have trouble mounting my Tablet over my laptop (even more because I only do wireless connections via ssh)
Sent from PomPoko [TF101G] using TapaTalkHD
This is how I did it.
mount -o bind /Removable/MicroSD /mnt/sdcard/extsd
frefol123 said:
This is how I did it.
Code:
mount -o bind /Removable/MicroSD /mnt/sdcard/extsd
Click to expand...
Click to collapse
I got the idea, but for what I need bind won't work
I want to symlink, e.g., a download folder from extsd in place of /sdcard/Download.
Bind only mounts the actual devices, subfolders won't work AFAIK
Sent from PomPoko [TF101G] using TapaTalkHD
leomeloxp said:
I got the idea, but for what I need bind won't work
I want to symlink, e.g., a download folder from extsd in place of /sdcard/Download.
Bind only mounts the actual devices, subfolders won't work AFAIK
Sent from PomPoko [TF101G] using TapaTalkHD
Click to expand...
Click to collapse
I just tried mount -o bind /Removable/MicroSD/Download /mnt/sdcard/extsd and it worked just fine, unless that is not what you meant.
Edit: nevermind, I just realized that you wanted to redirected the /sdcard/download folder to the micro sd.
The adroid app "FolderMount" will accomplish this and does so quite well. If you need to do mounts (links) outside of the internal and external sdcard folders, you will need to donate (inside the app; $2) and then use the option to uncheck destination folder checks. This app works really well for any data that isnt needed right at startup.
insanelycool said:
The adroid app "FolderMount" will accomplish this and does so quite well.
Click to expand...
Click to collapse
Thanks, but that looks like it requires root. If I had root, I would have already fixed this myself.
[Q] Can't create symlinks on sdcard0...
Running latest Carbon ROM, rooted.
I'm trying to link my /storage/sdcard0/Pictures/Screenshots into /storage/sdcard0/DCIM so Google+ will pickup and upload screenshots automatically.
I've fired up the Terminal Emulator, su'd no problem so prompt is a #.
cd /storage/sdcard0/DCIM works fine c/l prompt showing new path, pwd shows the same.
ln -s /storage/sdcard0/Pictures/Screenshots Screenshots
Gives the message: link failed Operation not permitted.
Obviously not a FAT32 issue as sdcard0 is the internal one so I assume EXT32...
Tried ln -sf... still nothing.
Any ideas?
Salut all!
I have android 4.2.2 with all user stuff stored in /data/media/0 (internal SD)
and clockworkmod backup hidden within /data/media/clockworkmod (id est it's not visible unless i navigate outside my SD with a help of some root explorer). But that's not an issue.
The issue is that I use PC based backup with Samba fileshare on smartphone and FreeFileSync running on Windows PC.
And Windows PC cannot access anything outside phone SD, so clockworkmod backups are out of syncing.
I suppose that linking /data/media/clockworkmod to /data/media/0/clockworkmod would make rom backups accessible from PC. Yeah?
So the main question is
What directories are actual and real?
I have
1) /data/media/0/
2) /mnt/shell/emulated/0/
3) /storage/emulated/0/
4) /storage/emulated/legacy/
And I cannot understand which of these is THE original one to operate with.
I would not want to create links on links on links on links...
Thank you!
chasman said:
Running latest Carbon ROM, rooted.
I'm trying to link my /storage/sdcard0/Pictures/Screenshots into /storage/sdcard0/DCIM so Google+ will pickup and upload screenshots automatically.
I've fired up the Terminal Emulator, su'd no problem so prompt is a #.
cd /storage/sdcard0/DCIM works fine c/l prompt showing new path, pwd shows the same.
ln -s /storage/sdcard0/Pictures/Screenshots Screenshots
Gives the message: link failed Operation not permitted.
Obviously not a FAT32 issue as sdcard0 is the internal one so I assume EXT32...
Tried ln -sf... still nothing.
Any ideas?
Click to expand...
Click to collapse
This is almost exactly what I want to do and I'm having the same problem. I want to get a symlink from /storage/sdcard0/DCIM/Studio to /storage/sdcard0/Studio, because a picture editing app I use stores the images it creates in /storage/sdcard0/Studio, and I want them to be synced to "the cloud" with my DCIM folder. I've tried the same steps as chasman, and gotten the same result.
May I ask a few questions regarding symlinks?
I'm thinking of solving a problem (wrote about it here) I have of sending multiple files that have the same name but aren't allowed to be renamed (which can cause issues) , by using symlinks to them (that will have unique names).
1. Will this solution work?
2. If this should work, would it require root, even if the path is public for all?
3. If it should work, what should be the exact command?
4. Is there anything I should know about this method?
5. Is there an official API on Android for symlinks?
6. Can it work on any device?
So I was able to create a symlink to external sdcard on LG g3 running rooted stock kit Kat Rom. I successfully changed Groove's (formerly xboxmusic) offline storage to external sdcard.
The following command was successful in creating a link, but Groove was unable to download music to the directory presumably due to permissions on /many
su
cp -rp /data/media/0/Android/data/com.microsoft.xboxmusic /storage/external_sd
rm -r /data/media/0/Android/data/com.microsoft.xboxmusic
ln -s /mnt/media_rw/external_sd/com.microsoft.xboxmusic/ /data/media/0/Android/data
After these commands, Groove was producing errors stating that there was not enough disk space. As said before, I believe this was due to it's lack of permissions to /mnt
Replacing the last command with the following worked and offline music is now downloaded to external sd card
ln -s /storage/external_sd/com.microsoft.xboxmusic/ /data/media/0/Android/data
Given my experience, you cant create a link in a fuse fs, but you can create a symblink to a fuse fs.
Hope this helps.
Thanks it worked!!
frefol123 said:
This is how I did it.
mount -o bind /Removable/MicroSD /mnt/sdcard/extsd
Click to expand...
Click to collapse
thanks!! this command worked like a charm, i was able to link /sdcard to /storage/sdcard1 to change the default storage location!! Again thankyou very much!
a small issue
soorya_cryo said:
thanks!! this command worked like a charm, i was able to link /sdcard to /storage/sdcard1 to change the default storage location!! Again thankyou very much!
Click to expand...
Click to collapse
you cant access the internal sd card later on after running this command. Only option is to reboot and revert back to the default settings.

[Q] ADB shell privileges can't write to SD card

On my other Android devices (Acer Iconia A500, Nook Color, Motorola Droid), when I invoke "adb shell" from my PC, I get a "shell" user prompt ("$"), and I can read and copy files to directories on my SD card.
When I attempt to do that on the Tab2 (7.0"), I can read files on the SD card, but I cannot write to any directory there (/storage/extSdCard mount point).
Since I'm rooted, I can "su" to a "root" user prompt and do what I want. However, what I really want is to move files to the SD card via "adb push", which uses the "shell" user, and thus doesn't work.
I've tried "adb root" from the PC, and that just disconnects the PC from the Tab2 until I unplug and replug the USB cable into the PC.
GT-P3113 running stock 4.1.1 (except for rooting via Odin).
Any suggestions as to what might be wrong?
ADB Root should automatically reconnect the device in root mode.
Go to
Settings==>Developer Options==>Root access
make sure its set to "Apps and ADB"?
Alternately try pushing to
/extSdCard and not /storage/exSdCard
It works without root for me.
Not yet
wjptam said:
ADB Root should automatically reconnect the device in root mode.
Go to Settings==>Developer Options==>Root access
make sure its set to "Apps and ADB"?
Alternately try pushing to /extSdCard and not /storage/exSdCard
It works without root for me.
Click to expand...
Click to collapse
"adb root" gives "adbd cannot run as root in production builds"
Under Settings/Developer Options, I have no "Root access" setting
There is no "/extSdCard" at the root level, and "adb push" to it fails.
Edit: Permissions on the mount points:
[email protected]:/etc # lo /storage/
lo /storage/
d--------- system system 2013-03-06 17:34 UsbDriveA
d--------- system system 2013-03-06 17:34 UsbDriveB
d--------- system system 2013-03-06 17:34 UsbDriveC
d--------- system system 2013-03-06 17:34 UsbDriveD
d--------- system system 2013-03-06 17:34 UsbDriveE
d--------- system system 2013-03-06 17:34 UsbDriveF
drwxrwxr-x system media_rw 1969-12-31 16:00 extSdCard
drwxrwxr-x root sdcard_rw 2013-03-06 17:41 sdcard0
It's the "media_rw" group owner, rather than the "sdcard_rw" group owner, that is the problem. The "shell" user has group access to "sdcard_rw" but not "media_rw". Of course "addgroup shell media_rw" (and its numerical equivalents) fails.
I too find this very annoying
adb shell...
sgn2$ id
uid=2000 gid=2000 groups=1003,1004,1007,1009,1011,1015,1028,3001,3002,3003,3006
sgn2$ ls -lad /storage/extSdCard
drwxrwxr-x 39 1000 1023 16384 Jan 1 1970 /storage/extSdCard
so adb doesn't have group 1023 needed to write to the external sd card. /etc/group doesn't exist. I don't know how to change this, and googling for a fix brought me here!
thanks very much for any help
Paul
---------- Post added at 08:09 AM ---------- Previous post was at 07:57 AM ----------
OK, after random googling I found this:
so the permission to write to the card is defined here:
http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE
and somehow we should be able to use the "pm" command to add permission:
http://developer.android.com/tools/help/adb.html
"list permission-groups"
"grant permission".
but adb isn't a package. hmmm.
!SOLVED!
so in group ID terms, adb shell gets sdcard_rw but not media_rw which is the group we need to have write on the external sd card.. a reminder:
Code:
[email protected]:/ $ ls -lad /storage/extSdCard /storage/sdcard0
drwxrwxr-x system media_rw 1970-01-01 01:00 extSdCard
drwxrwxr-x root sdcard_rw 2013-05-17 11:52 sdcard0
or numerically...
[email protected]:/ $ ls -ladn /storage/extSdCard /storage/sdcard0
drwxrwxr-x 39 1000 1023 16384 Jan 1 1970 /storage/extSdCard
drwxrwxr-x 47 0 1015 4096 May 17 10:52 /storage/sdcard0
ah... http://forum.xda-developers.com/showthread.php?p=40845568
suggests that editing the /etc/permissions/platform.xml might work?
looking in platform.xml I see...
Code:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>
and
<permission name="android.permission.WRITE_MEDIA_STORAGE" >
<group gid="media_rw" />
</permission>
I think the each permission name should only have ONE entry, i.e. the WRITE_EXTERNAL_STORAGE should be just sdcard_rw, the media_rw is bogus and gets ignored.
so, let's add this line:
Code:
<assign-permission name="android.permission.WRITE_MEDIA_STORAGE" uid="shell" />
then reboot. and voila!
Code:
[email protected]:/ $ id -a
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
my adb shell now has the required privilege to write to the external sdcard
--edit--
ok, no, it didn't work.

Categories

Resources