November 22, 2024, 01:35:50 PM

collapse

Author Topic: Android 4.2 Directory structure  (Read 5310 times)

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Android 4.2 Directory structure
« on: November 20, 2012, 09:17:46 PM »
I needed to bind directories using my USB flash drive as a source, and my "external" sdcard as a target. 

This was straightforward in OS 4.1.1 and 4.1.2.  Despite fuse directory structure and symlinks creating multiple paths to sdcard, I could simply bind /sdcard/usbstorage/sda1/iBird_Pro (S) to /sdcard/iBird_Pro (T).

In OS 4.2, this all changed.  Only one path reads my source target files.  I have to use /mnt/shell/emulated/0/usbstorage/sda1/iBird_Pro (S) to /sdcard/iBird_Pro (T).

Following are the unsuccessful symlinks and fuse paths that don't work as the source.
/mnt/sdcard/iBird_Pro
/data/media/0/iBird_Pro
/sdcard/iBird_Pro
/storage/sdcard0/iBird_Pro
/storage/emulated/0/iBird_Pro

So, to reiterate, the only true path to your sdcard in Android 4.2 is:
/mnt/shell/emulated/0/.  The extra subdirectory path takes me to my USB flash drive, nominally in sdcard/usbstorage/sda1.

n.b. I haven't tested the directory bind yet, but the /mnt/shell/emulated/0/sdcard/usbstorage/sda1 path is the only one that lets me read files off my flash drive.  Also note the 0 in the path will vary on a multiuser device.  It will be a 1 if you're the second user, a 2 if you're the third user, etc.

Hope this helps the rest of you who will be confronting the mysteries of Android 4.2.

Bird
« Last Edit: November 20, 2012, 09:40:42 PM by birdastrompgman »


Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline bjs229

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2682
  • Popularity: 47
    • View Profile
Re: Android 4.2 Directory structure
« Reply #1 on: November 20, 2012, 09:59:40 PM »
Just for the record. For a retired west coast dude, some of your posts party way too hard for me. I am way behind the curve.

Sent from my Nexus 7 using Tapatalk HD

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: Android 4.2 Directory structure
« Reply #2 on: November 21, 2012, 12:31:58 AM »
bjs, what can I say?  It's not drugs, so I  guess I'm an eccentric geek ;)

It gets stranger.  I tried the directory bind, and it didn't see any source directory contents.  I'd done the first test (1) with ES File Explorer.  So I tried a second test (2) with Root Explorer and got different results.  Then I tried another test (3) with ES File Explorer again.  The results with numbers worked.  The ones with Xs didn't.  The ? means I didn't try that path during that test.  Directory Bind will tell the truth, but it didn't work with the one path that worked with both file explorers.

1 2 3 /mnt/shell/emulated/0/usbstorage/sda1/iBird_Pro
X 2 X /mnt/sdcard/usbstorage/sda1/iBird_Pro
X X X /data/media/0/usbstorage/sda1/iBird_Pro
X 2 X /sdcard/usbstorage/sda1/iBird_Pro
X 2 3 /storage/sdcard0/usbstorage/sda1/iBird_Pro
X X 3 /storage/emulated/0/usbstorage/sda1/iBird_Pro
? 2 3 /storage/emulated/legacy/usbstorage/sda1/iBird_Pro
Edit: None of the paths worked with Directory Bind! I'm not sure what to do next.
« Last Edit: November 21, 2012, 01:12:12 AM by birdastrompgman »
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline bjs229

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2682
  • Popularity: 47
    • View Profile
Re: Android 4.2 Directory structure
« Reply #3 on: November 21, 2012, 12:50:15 AM »
I'm playing with you brother. I enjoy you as part of the family here. That's for sure. Happy Holidays to you and yours.
B

Sent from my Nexus 7 using Tapatalk HD

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: Re: Android 4.2 Directory structure
« Reply #4 on: November 21, 2012, 08:57:22 AM »
bjs, have a happy Thanksgiving holiday yourself. You are a valuable family member, too.

Directory Bind gave the following results.

/mnt/shell/emulated/0/usbstorage/sda1/iBird_Pro stopped at /mnt/shell

/mnt/sdcard/usbstorage/sda1/iBird_Pro got to sda1, but saw no flash drive contents.

/data/media/0/usbstorage/sda1/iBird_Pro stopped at /data

/sdcard/usbstorage/sda1/iBird_Pro got to sda1, but saw no flash drive contents. 

/storage/sdcard0/usbstorage/sda1/iBird_Pro
/storage/emulated/0/usbstorage/sda1/I Bird
/storage/emulated/legacy/usbstorage/sda1/iBird_Pro
all got to sda1, but saw no flash drive contents.

I upgraded to Stickmount Pro, but it didn't help.

Sent from my Nexus 7 using Tapatalk 2
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline birdastrompgman

  • Hero Member
  • *****
  • Posts: 840
  • Popularity: 28
    • View Profile
Re: Android 4.2 Directory structure
« Reply #5 on: November 25, 2012, 02:52:19 AM »
Semi-success. I was able to bind my directories by making the source /storage/emulated/0/usbStorage/sdb1/iBird_Pro, and the target /sdcard/iBird_Pro. There's a quirky aspect of Stickmount that keeps Directory Bind from seeing the source directory on first mount (when it's sda1),but it works on second mount (when it's sdb1).

There's still a problem with the apps not finding the data, but I'm getting closer. The directory binding works correctly, and I was even able to use the Directory Bind program to transfer the data files automatically from target to source directories.

Now the problem is that all four of my data-hog apps don't find their data files, despite the current linking. I'm sure it's something lost in the tangled web of emulations, symlinks, and fuses that 4.2 introduced.

Sent from my Nexus 7 w/ Tapatalk 2 @ 49.6 mpg
« Last Edit: November 25, 2012, 10:42:25 AM by birdastrompgman »
Bird has seen >650 North American bird species
Rooted Nexus 7
49.5 mpg avg for 53k miles in non-hybrid Scion xB
Retired 9 yrs, and loving it

Offline bjs229

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2682
  • Popularity: 47
    • View Profile
Re: Android 4.2 Directory structure
« Reply #6 on: November 25, 2012, 01:43:29 PM »
Second mount is the charm. Hopefully you are the only user.

 


* Top Boards

* 'Like' And 'Follow' Us!

* Top Posters

bjs229 bjs229
2682 Posts
S.Prime S.Prime
2017 Posts
Babyfacemagee Babyfacemagee
1263 Posts
matt matt
936 Posts
birdastrompgman birdastrompgman
840 Posts
loociddreemr loociddreemr
708 Posts
radiocycle radiocycle
653 Posts