I have an ASUS Transformer Pad TF101. I finally got round to rooting it just now.
/sdcard is not FAT32. It's a fuse filesystem based in ext4. So it is capable of using
So that I can work on it optimally, I'd like to be able to place executables in
/mnt/sdcard. (Note that while it is called
sdcard it is not, in actual fact, an SD card; it is internal storage.) I'd also like
chmod in general to succeed, as it causes problems with certain things in Mercurial when it fails (even when I've patched the things in the main codebase to make it work at all, a few things in Python standard library calls still break).
I presume that the problem is something to do with the mount flags, but I don't know what, so here they are:
$ mount ... /dev/block/mmcblk0p7 on /data type ext4 (rw,nosuid,nodev,noatime,nodiratime,errors=panic,user_xattr,acl,barrier=1,nodelalloc,data=ordered) ... /dev/fuse on /mnt/sdcard type fuse (rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other) ...
I'm not sure what happens with the FUSE stuff, but I know that
/sdcard's contents are stored in
Here, then, is the baffling thing about it all:
- As 10126 (terminal) in /sdcard, I can't chmod.
- As 1023 in /sdcard, I can't chmod.
- As 0 in /sdcard, I can chmod.
- As 10126 in /data/media, I can't chmod.
- As 1023 in /data/media, I can chmod.
- As 0 in /data/media, I can chmod.
chmod a+w /data/media, 10126 can then chmod appropriate files in /data/media, but still neither 10126 nor 1023 can chmod in /mnt/sdcard, which is what I ideally want. (Because it sorts out all the rest of the permissions so that you don't end up with fragmented file ownership.)
Also, if I create files in /sdcard, they will be owned by UID/GID 0/1015 (1015 being
sdcard_rw), while if I create them in /data/media, they will be owned by the UID/GID of the user (0/0) rather than 1023/1023 in /data/media (they will still be owned by 0/1015 in /sdcard—I don't understand that but am not drastically worried by it).
So then, my question: how can I make it so that any account can successfully
chmod in /mnt/sdcard, rather than just root?
I have been using /mnt/sdcard and /sdcard interchangeably in this question; /sdcard is symlinked to /mnt/sdcard.