Which file from the /proc/ file system contains a list of all currently mounted devices?

Prepare for the LPI 101-500 Certification Exam. Utilize flashcards, navigate multiple choice questions, and benefit from hints and explanations. Begin your Linux certification journey today!

The file that contains a list of all currently mounted devices is /proc/mounts. This file provides an accurate view of the mounts that the Linux kernel currently recognizes. It serves as a dynamic reflection of the current state of the mounted filesystems and can include useful information such as the mount point, filesystem type, and any mount options that were specified.

The reason /proc/mounts is significant is that it is updated in real-time by the kernel, ensuring that what you read is always current without needing to issue another command to check the mounts.

While /proc/self/mounts is often a symbolic link to /proc/mounts for the currently running process, it specifically pertains to the mounts as viewed from the context of that process. Therefore, while you could technically access the current mounts this way, it is typically more straightforward and conventional to refer to /proc/mounts.

Other files in the /proc/ directory serve different purposes: /proc/devices lists the character and block devices recognized by the kernel, while /proc/partitions shows information about disk partitions. None of these files provide the list of currently mounted filesystems as /proc/mounts does.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy