0

I have installed Linux (Ubuntu distro) on my Android tablet, a Nexus 7 (no SD card at all), in a so-called CHroot install.

I am a Linux beginner, so my understanding is quite limited.

When in Linux (using a terminal emulator on the SSH service, logged in as root), I list the contents of the top level "/" directory and can see 18 directories, including: bin proc sys mnt srv home srv ..... and others

When using the Android app "ES File Explorer" (aka FX), I can only see 13 folders. There is some overlap, but some directories are unique to the FX view, and some are missing.

For example, the folder '/vendor' is visible in FX, but not on the linux terminal. Also, the folder /mnt shows different contents when I check it in FX versus the linux terminal.

I created a new test directory on the linux terminal, but cannot "see' it when I use FX.

I should note that my Android tablet has been rooted (verified), and I have turned on the Root option inside ES File Explorer, which allows me to successfully browse the "/" directory and subdirectories.

Why do I see a different directory structure when I view it via linux terminal versus the Android File Explorer?

Hours later: Having read up more on Linux Deploy, it seems to me that use of the "chroot" feature is part of the explanation - the root level and tree structure for the Linux environment is located at a lower level somewhere within the Android 'main system's tree structure - a "virtual" root so to speak.

However, that still means I should be able to "see" it using FX, shouldn't it? And how do I know where this virtual root is located within the Android tree?

  • Thank you Stephen Schrauger for your detailed answer (see below). I have not been able to find the "*.img" file that contains the file structure for the installed Linux, but your answer explains why I would see a different structure once inside the Linux sandbox. – cvm Apr 30 '15 at 14:16
  • It might not be a '.img' file, but it would probably be something like that. You could try using DiskUsage to find large folders and files; it may help you pinpoint the location (find a folder/file with the same size as the Linux "hard drive"). – Stephen Schrauger Apr 30 '15 at 16:00
0

This is due to your CHroot install. The entire Linux hard drive is probably contained inside of a binary file or disk image.

When you start Linux, you have to use the Android app. It acts like a virtual machine controller. The app mounts the Linux disk image in memory and loads Linux. Linux can never see outside of this sandbox virtual filesystem, and native Android cannot see into it either. Since Android sees it as a single file, ES File Explorer can't view the contents directly (it would see a file named something like Linux_HD.img).

The reason some folders are the similar is because Android OS and Linux OS share a similar codebase. Both Android and Linux (and Mac) have some default folders, such as /mnt, /etc and others. But the naming is purely coincidental for your purpose; changing files within the folder on the virtual Linux install won't modify the Android files.

Depending on the app you use to install and run Linux, it may have an option to mount parts of the Android folder within the Linux file structure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.