17

We use autofs at work and I'm having trouble remembering some mount points. With autofs, you can only see currently or recently mounted volumes on a particular machine. How can I see the rest?

dromodel
  • 565
  • 2
  • 6
  • 9

4 Answers4

19

You can ask the root user to make the mount points always visible. This can be done by adding the following lines to /etc/sysconfig/autofs:

# BROWSE_MODE - maps are browsable by default.
BROWSE_MODE="yes"

Note: On recent Ubuntu versions the file is found at /etc/default/autofs

carl verbiest
  • 471
  • 4
  • 11
5

You seem to mix up devices and mount points here. If a device is not mounted then it has no mount point associated. A mount point is nothing but a directory when not associated to a storage device.

If you want to list all mount points (that is, all mounted devices), use :

df

However, if you need a list of storage devices available, use :

fdisk -l

fdisk requires root privileges in most cases. If you don't have root privileges, you can list storage devices files beginning with sd in the /dev directory : this should give you enough information :

ls -l /dev/sd*

You can also read the /proc/partitions file :

cat /proc/partitions
John WH Smith
  • 15,500
  • 6
  • 51
  • 62
  • any way to do it without root? I don't have it – dromodel Jun 26 '14 at 19:21
  • I edited my answer with a solution which does not require root privileges. Note that `fdisk` (and other non-root tips) do **not** mention mount points, but only *devices*. `mount` and `df` will give you a list of *device/mount point* associations. – John WH Smith Jun 26 '14 at 19:24
  • Not everything that can be mounted is a local device. – guntbert Jun 26 '14 at 20:13
  • @guntbert The OP mentioned "mounted volumes on a particular machine", therefore I excluded NFS possibilities. Plus, these go a little beyond the simple use of `mount` and `fdisk`. Finally, I mentioned "storage devices" only, and not "devices" in general. – John WH Smith Jun 26 '14 at 20:59
  • 2
    "autofs" to me generally implies remote media (NFS, SMB, ftp, ssh, ...) and removable local media - hence my point that the question cannot be answered with "the simple use of mount and fdisk" :-)) – guntbert Jun 27 '14 at 06:44
  • Yes these are NFS mounts from NFS servers. By that statement I just meant that on different machines you see different mounts, depending on which ones users on that machine happen to be using. – dromodel Jun 27 '14 at 20:22
  • Then the use of `fdisk` isn't quite appropriate. You should add this information into your question. – John WH Smith Jun 27 '14 at 20:34
  • 1
    I would like a way of seeing a stub for the mount point when the remote FS is not mounted. I can cause it to automount by typing 'ls /mnt/long_and_annoying_name' but I can no longer type 'ls /mnt/lo' to have it autocomplete. (Alternately, can zsh autocomplete autofs mount points itself?) – John Y Jul 19 '14 at 06:46
3

Just run 'mount' with no arguments. It will show you all mounted file systems. To my knowledge there is no way to see "historic" mount points other then somethings like cat /var/log/messages | grep mount. You will need to edit that last command quite a bit to get exactly what you want.

Ramesh
  • 38,687
  • 43
  • 140
  • 215
coteyr
  • 4,280
  • 16
  • 24
  • You could create a syslog entry for every mount attempt for autofs and review that. Config would be highly dependent on your syslogger. – coteyr Jun 26 '14 at 19:12
  • I don't have root but I'd like to see a list of all devices that could be mounted and at which mount points if I knew what they were – dromodel Jun 26 '14 at 19:22
3

I see the question is quite old, but the answers did not match, what I understood from it. This is for CentOS7 and probably RHEL.

You can cat /etc/auto.master. It will show you the defined mountpoints. There are although a couple of files in /etc/auto.*. These files are included by the auto.master and contain the subfolders, which will be automounted.