Jelly Bean 4.2 File Structure Help

freakshow999

Senior Member
Oct 1, 2012
125
24
0
Long Beach, CA area
While I am well versed in the file structure tree from 2.3.5 through 4.1.2 as many of you know it is significantly different looking in 4.2.
In as such I can't figure out where some stuff is as or where it should be put. The most bothersome thing is that I had run a TWRP backup using the last version of TWRP not the latest and as it eats up my much valued space on my 16gb N7 I would like to delete it. I now have the newest TWRP and the backup is exactly where I expect it to be.

I really don't understand the new emulated/legacy folders as well as the sdcard and sdcard0 and why they are all there when it used to be just a root and an sdcard w/ an external extsdcard if you had one?

Thanks in advance, and yes I did an XDA search via Google but didn't find the answers I was looking for.

Sent from the Freak's Nexus 7 using Tapatalk HD beta 5
 
  • Like
Reactions: John336kjb

Wilks3y

Senior Member
Aug 3, 2012
1,703
637
0
Leek
Would also like ot know this, it looks so cluttered and messy now compared to the 2 folders you've refered to from 4.1.2

I think 4.2 has been a flop for Android, wouldn't go as far as saying as bad as the Vista flop for Microsoft though haha !
 
  • Like
Reactions: Migamix

bcsstinks

New member
Apr 24, 2010
2
0
0
New file structure

The new file structure has to do with the ability to have multiple profiles and it duplicates some things, still trying to get my head around it.

I do know that the original content of the SD Card (what it looked like before you installed the JB 4.2.1) is relocated to mnt/system/emulated.
I am hoping that once you have moved whatever you need to /storage/emulated/0 or data/media/0 that you can remove the contents of /mnt/system/emulated in order to free up space.

Follow up, No you cannot, after more research, it looks to this noob like what you saw on your SD Card before going to JB 4.2 is in /data/media and /data/media is mounted as /mnt/shell/emulated, so I don't think you would want to remove anything from /mnt/shell/emulated.
/mnt/shell/emulated/0 which I think belongs to the first user profile is linked to /storage/emulated/legacy and /storage/emulated/legacy is linked to /sdcard, /mnt/sdcard, and /storage/sdcard0.(Legacy appears to belong to the device owner, which is profile 0?)
It looks like the files you see in /sdcard after going to JB 4.2 are files that are actually located at /data/media/0, so to see files in /data/media, you would want to move them to /data/media/0 (or /data/media/1, or/data/media/2 etc if you have multiple profiles). It looks to me like there is some duplication of files between /data/media and /data/media/0, /data/media/1 etc. Which could explain the the amount of available space.
 
Last edited:

elfaure

Senior Member
Aug 1, 2011
520
108
0
San Francisco Bay Area
While I am well versed in the file structure tree from 2.3.5 through 4.1.2 as many of you know it is significantly different looking in 4.2.
In as such I can't figure out where some stuff is as or where it should be put. The most bothersome thing is that I had run a TWRP backup using the last version of TWRP not the latest and as it eats up my much valued space on my 16gb N7 I would like to delete it. I now have the newest TWRP and the backup is exactly where I expect it to be.

I really don't understand the new emulated/legacy folders as well as the sdcard and sdcard0 and why they are all there when it used to be just a root and an sdcard w/ an external extsdcard if you had one?

Thanks in advance, and yes I did an XDA search via Google but didn't find the answers I was looking for.

Sent from the Freak's Nexus 7 using Tapatalk HD beta 5
http://androidforums.com/verizon-ga...t/649940-4-2-sdcard-sdcard-0-observation.html

Found your post and let me jump on board. Here's a good discussion on the fiasco. I'm going to find out what that "special file" is called and set that appropriately for a SINGLE USER before I jump onto 4.2. What a complete and utter nightmare for TWRP, nandroid, and custom ROMS to have to deal with this, much less the average power user who will have live on this site a week just to find their files, then a couple more weeks to figure out how and where to move them (maybe back and forth to work with legacy ROMs and nandroids) if they are so lucky. Don't forget to brush up on your SELinux. Gapi the BAM man has the plan. Boys, its script time.
 
Last edited:

teddyearp

Senior Member
Jul 27, 2009
247
55
0
ted.servepics.com
http://androidforums.com/verizon-ga...t/649940-4-2-sdcard-sdcard-0-observation.html

Found your post and let me jump on board. Here's a good discussion on the fiasco. I'm going to find out what that "special file" is called and set that appropriately for a SINGLE USER before I jump onto 4.2. What a complete and utter nightmare for TWRP, nandroid, and custom ROMS to have to deal with this, much less the average power user who will have live on this site a week just to find their files, then a couple more weeks to figure out how and where to move them (maybe back and forth to work with legacy ROMs and nandroids) if they are so lucky. Don't forget to brush up on your SELinux. Gapi the BAM man has the plan. Boys, its script time.
OK, if you've got some magic to work in this department, I am now subscribed to await your plan since I wrote the sticky over at AF addressing this problem

http://androidforums.com/verizon-ga...-latest-jelly-bean-roms-edited-3-24-13-a.html
 

elfaure

Senior Member
Aug 1, 2011
520
108
0
San Francisco Bay Area
Can someone on 4.2 run this code from a terminal and post back the output? Thks.

Code:
cd /
find */0


---------- Post added at 07:26 AM ---------- Previous post was at 07:24 AM ----------

The "special file" is .layout_version located in /data somewhere. Can someone on 4.2 search for this file and let me know exactly where it is stored on the /data partition? Thks

---------- Post added at 07:33 AM ---------- Previous post was at 07:26 AM ----------

+1 ^^^ this. I have tried 4.2.2 a couple of times and there's nothing it has that keeps me with it. In fact, all it has a tiny bit of eye candy, but some other core functionality is broken, i.e. bluetooth, some have WiFi issues, etc.
+2^^^
 
Last edited:

laloutre

Senior Member
Mar 18, 2012
220
50
0
Can someone on 4.2 run this code from a terminal and post back the output?* Thks.

Code:
cd /
find */0
Hi
The find did not return anything :
Code:
[email protected]:/ $ [email protected]:/ # cd /
[email protected]:/ # find */0
find: */0: No such file or directory
1|[email protected]:/ # ls -la
drwx------ root**** root************* 2013-05-08 17:26 -m
drwx------ root**** root************* 2013-05-08 17:26 777
drwxr-xr-x root**** root************* 2013-05-08 17:25 acct
drwxrwx--x system** cache************ 2013-05-08 21:30 cache
-rw-rw-rw- root**** root*********** 1 2013-05-08 17:25 cmdline
dr-x------ root**** root************* 2013-05-08 17:25 config
lrwxrwxrwx root**** root************* 2013-05-08 17:25 d -> /sys/kernel/debug
drwxrwx--x system** system*********** 2013-05-08 17:25 data
-rw-r--r-- root**** root********* 120 2013-05-08 17:25 default.prop
drwxr-xr-x root**** root************* 2013-05-08 18:08 dev
lrwxrwxrwx root**** root************* 2013-05-08 17:25 etc -> /system/etc
drwxrwxr-x radio*** radio************ 2013-05-08 17:25 factory
-rw-r--r-- root**** root********* 919 2013-05-08 16:19 fstab.grouper
-rwxr-x--- root**** root******* 75292 2013-05-08 16:19 init
-rwxr-x--- root**** root******** 2487 2013-05-08 17:25 init.goldfish.rc
-rwxr-x--- root**** root******* 15837 2013-05-08 17:25 init.grouper.rc
-rwxr-x--- root**** root******** 1718 2013-05-08 17:25 init.grouper.usb.rc
-rwxr-x--- root**** root******* 19482 2013-05-08 17:25 init.rc
-rwxr-x--- root**** root******** 1095 2013-05-08 17:25 init.slim.rc
-rwxr-x--- root**** root******** 1795 2013-05-08 17:25 init.trace.rc
-rwxr-x--- root**** root******** 3947 2013-05-08 17:25 init.usb.rc
-rwxr-xr-x root**** root****** 109520 2013-05-08 17:25 main_init
drwxrwxr-x root**** system*********** 2013-05-08 17:25 mnt
dr-xr-xr-x root**** root************* 1970-01-01 01:00 proc
-rw-rw-rw- root**** root****** 188127 2013-05-08 17:25 ramdisk.gz
drwxrwx--x system** system*********** 2013-05-02 22:50 realdata
drwx------ root**** root************* 2013-04-05 23:29 root
drwxr-x--- root**** root************* 2013-05-08 16:19 sbin
lrwxrwxrwx root**** root************* 2013-05-08 17:25 sdcard -> /storage/emulated/legacy
d---r-x--- root**** sdcard_r********* 2013-05-08 17:26 storage
drwxr-xr-x root**** root************* 2013-05-08 17:25 sys
drwxr-xr-x root**** root************* 2013-04-28 21:54 system
-rwxr-x--- root**** root********* 272 2013-05-08 17:25 ueventd.goldfish.rc
-rwxr-x--- root**** root******** 1224 2013-05-08 17:25 ueventd.grouper.rc
-rwxr-x--- root**** root******** 5382 2013-05-08 17:25 ueventd.rc
lrwxrwxrwx root**** root************* 2013-05-08 17:25 vendor -> /system/vendor
-rw-rw-rw- root**** root***** 4872200 2013-05-08 17:25 zImage
[email protected]:/ #
The "special file" is .layout_version located in /data somewhere.* Can someone on 4.2 search for this file and let me know exactly where it is stored on the /data partition?* Thks
Here are results
Code:
[email protected]:/ # find / -name .layout_version
find: /storage/emulated/legacy/multirom: Permission denied
find: /storage/emulated/0/multirom: Permission denied
find: /mnt/shell/emulated/0/multirom: Permission denied
/realdata/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/.layout_version
/realdata/.layout_version
/data/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/.layout_version
/data/.layout_version
1|[email protected]:/ #
Multiple entries because I'm running MultiROM

Sent from my Nexus 7 using xda premium
 
Last edited:
  • Like
Reactions: elfaure

elfaure

Senior Member
Aug 1, 2011
520
108
0
San Francisco Bay Area
Hi
The find did not return anything :
Code:
[email protected]:/ $ [email protected]:/ # cd /
[email protected]:/ # find */0
find: */0: No such file or directory
1|[email protected]:/ # ls -la
drwx------ root**** root************* 2013-05-08 17:26 -m
drwx------ root**** root************* 2013-05-08 17:26 777
drwxr-xr-x root**** root************* 2013-05-08 17:25 acct
drwxrwx--x system** cache************ 2013-05-08 21:30 cache
-rw-rw-rw- root**** root*********** 1 2013-05-08 17:25 cmdline
dr-x------ root**** root************* 2013-05-08 17:25 config
lrwxrwxrwx root**** root************* 2013-05-08 17:25 d -> /sys/kernel/debug
drwxrwx--x system** system*********** 2013-05-08 17:25 data
-rw-r--r-- root**** root********* 120 2013-05-08 17:25 default.prop
drwxr-xr-x root**** root************* 2013-05-08 18:08 dev
lrwxrwxrwx root**** root************* 2013-05-08 17:25 etc -> /system/etc
drwxrwxr-x radio*** radio************ 2013-05-08 17:25 factory
-rw-r--r-- root**** root********* 919 2013-05-08 16:19 fstab.grouper
-rwxr-x--- root**** root******* 75292 2013-05-08 16:19 init
-rwxr-x--- root**** root******** 2487 2013-05-08 17:25 init.goldfish.rc
-rwxr-x--- root**** root******* 15837 2013-05-08 17:25 init.grouper.rc
-rwxr-x--- root**** root******** 1718 2013-05-08 17:25 init.grouper.usb.rc
-rwxr-x--- root**** root******* 19482 2013-05-08 17:25 init.rc
-rwxr-x--- root**** root******** 1095 2013-05-08 17:25 init.slim.rc
-rwxr-x--- root**** root******** 1795 2013-05-08 17:25 init.trace.rc
-rwxr-x--- root**** root******** 3947 2013-05-08 17:25 init.usb.rc
-rwxr-xr-x root**** root****** 109520 2013-05-08 17:25 main_init
drwxrwxr-x root**** system*********** 2013-05-08 17:25 mnt
dr-xr-xr-x root**** root************* 1970-01-01 01:00 proc
-rw-rw-rw- root**** root****** 188127 2013-05-08 17:25 ramdisk.gz
drwxrwx--x system** system*********** 2013-05-02 22:50 realdata
drwx------ root**** root************* 2013-04-05 23:29 root
drwxr-x--- root**** root************* 2013-05-08 16:19 sbin
lrwxrwxrwx root**** root************* 2013-05-08 17:25 sdcard -> /storage/emulated/legacy
d---r-x--- root**** sdcard_r********* 2013-05-08 17:26 storage
drwxr-xr-x root**** root************* 2013-05-08 17:25 sys
drwxr-xr-x root**** root************* 2013-04-28 21:54 system
-rwxr-x--- root**** root********* 272 2013-05-08 17:25 ueventd.goldfish.rc
-rwxr-x--- root**** root******** 1224 2013-05-08 17:25 ueventd.grouper.rc
-rwxr-x--- root**** root******** 5382 2013-05-08 17:25 ueventd.rc
lrwxrwxrwx root**** root************* 2013-05-08 17:25 vendor -> /system/vendor
-rw-rw-rw- root**** root***** 4872200 2013-05-08 17:25 zImage
[email protected]:/ #


Here are results
Code:
[email protected]:/ # find / -name .layout_version
find: /storage/emulated/legacy/multirom: Permission denied
find: /storage/emulated/0/multirom: Permission denied
find: /mnt/shell/emulated/0/multirom: Permission denied
/realdata/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/.layout_version
/realdata/.layout_version
/data/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/.layout_version
/data/.layout_version
1|[email protected]:/ #
Multiple entries because I'm running MultiROM

Sent from my Nexus 7 using xda premium
Please try this one instead, thanks

Code:
find -name '0' -type d
 

GedBlake

Senior Member
Jan 5, 2013
889
604
0
Ashton-under-Lyne, Manchester, UK
Please try this one instead, thanks

Code:
find -name '0' -type d
Not quite sure what you're looking for, but this is my TE output, running... well, see my sig.

Code:
[email protected]:/ $ su
[email protected]:/ # find -name '0' -type d
./storage/emulated/0
./acct/uid/0
./mnt/shell/emulated/0
./sys/devices/host1x/syncpt/0
./data/media/0
./data/system/users/0
[email protected]:/ #
Hope this is of some use.

Incidentally, without invoking root (su) first, the output went on at considerable length, with hundreds of 'permission denied's.

Rgrds.
Ged.
 
  • Like
Reactions: elfaure

laloutre

Senior Member
Mar 18, 2012
220
50
0
Please try this one instead, thanks

Code:
find -name '0' -type d

Hi,
Results on a 3g Nexus running multirom

Code:
[email protected]:/ # find -name '0' -type d./acct/uid/0
find: ./storage/emulated/legacy/multirom: Permission denied
./storage/emulated/0
find: ./storage/emulated/0/multirom: Permission denied
./mnt/shell/emulated/0
find: ./mnt/shell/emulated/0/multirom: Permission denied
./sys/devices/host1x/syncpt/0
./realdata/data/org.mozilla.firefox/files/mozilla/tzdmr7vi.default/Cache/0
./realdata/media/0
./realdata/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/data/org.mozilla.firefox/files/mozilla/tzdmr7vi.default/Cache/0
./realdata/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/system/users/0
./realdata/system/users/0
./data/media/0
./data/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/data/org.mozilla.firefox/files/mozilla/tzdmr7vi.default/Cache/0
./data/media/0/multirom/roms/Slim-tilapia-4.2.2.build.4/data/system/users/0
./data/data/org.mozilla.firefox/files/mozilla/tzdmr7vi.default/Cache/0
./data/system/users/0
1|[email protected]:/ #
Sent from my Nexus 7 using xda premium
 
  • Like
Reactions: elfaure