Are there any restrictions on using "/ proc / mounts" in android

I have a problem with devices that have external memory (SD card) and internal data storage. Like the Samsung S3, there are two types of external storage for the SD card and internal data storage. The Environment.getExternalStorageDirectory() API does not get both, I searched the Internet and the fountain that I can read /proc/mounts as a question

How to get all mount point information for an Android device?

My question is: can I rely on the /proc/mounts file system on all devices and operating systems, or is there some kind of limitation? And is there any good documentation about this file system?

Thanks for the help.

+6
source share
2 answers

/ proc is the mount point for the Linux procfs virtual file system. It is specific to Linux, so it works with all Android installations.

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

0
source

See /proc/self/mountinfo ; it has all the information in /proc/mounts and more (for example, to mount the bindings, it tells you the installed path in the source file system).

+1
source

Source: https://habr.com/ru/post/921392/


All Articles