6

I'm having a problem with devices that has an external storage (SD card) and internal data storage. Like in Samsung S3 device there are two kind of external storages the SD-card and the internal data storage. The Environment.getExternalStorageDirectory() API do not get both, I have searched the internet and fount that I can read the /proc/mountslike the question

How to get all the mount point information for android device?

My question is can I rely on the /proc/mounts filesystem on all devices and operating systems or there are any limitations? And is there any good documentation about this filesystem?

Thanks for helping.

Community
  • 1
  • 1
AnasBakez
  • 1,230
  • 4
  • 20
  • 36
  • What kind of "problem" do you have? Are you aware of what kind of data is supposed to be saved using the external storage? Also see http://askubuntu.com/questions/9819/format-of-proc-mounts for an explanation about the format. I don't think that it will change, at it would break many systems. But that is just a guess. – wojciii Aug 09 '12 at 21:18

2 Answers2

1

Look at /proc/self/mountinfo; it has all the information in /proc/mounts and more (e.g., for bind mounts it tells you the mounted path within the source filesystem).

Sam Morris
  • 1,858
  • 1
  • 17
  • 18
0

/proc is a mountpoint for a Linux virtual filesystem, procfs. It is specific to Linux, therefore works with all Android installations.

The best possible documentation for procfs is its source code, but it requires some familiarity with Linux kernel and C. Also see Documentation/filesystems/proc.txt in the kernel sources, it may contain relevant information for you.

Dmytro Sirenko
  • 5,003
  • 21
  • 26