9

I'm getting the following output when the mount command is executed.

[root@]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sda3 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)

I'm not able to understand the output of this command. Can anyone give the explanation for this output?

3
  • It tells you what devices are mounted in what locations, and what type of filesystem it has. What exactly don't you understand?
    – cjm
    Sep 23, 2013 at 5:21
  • what are the different filesystems in Linux ? Sep 23, 2013 at 5:34
  • Related: unix.stackexchange.com/questions/3192/…
    – slm
    Sep 23, 2013 at 5:45

3 Answers 3

18

Running mount without arguments will output a list of filesystems mounted according to the table of mounted filesystems in /etc/mtab. The /etc/mtab file is typically maintained by mount and umount, although in some environments (such as live CDs) /etc/mtab may be a symlink to /proc/self/mounts.

The kernel maintains the information of mounted filesystems in the current mount namespace in /proc/[pid]/mounts. Traditionally, the Linux kernel exposed all mounts via /proc/mounts, but since the introduction of per-process mount namespaces in kernel version 2.4.19, /proc/mounts is a symlink to /proc/self/mounts. The format of these files is documented in the manual page for fstab.

Note that as /etc/mtab is maintained by user space programs, it is entirely possible for the contents of /etc/mtab and /proc/self/mounts to differ. This can occur if filesystems are mounted or unmounted directly via the mount() and umount() system calls, without going through the mount and umount programs. Differences between separate mount namespaces can also cause discrepancies between /etc/mtab and /proc/self/mounts.

Each line in the mount output is of the form:

fs_spec on fs_file type fs_vfstype (fs_mntopts)

where

  • fs_spec describes the block device or remote filesystem to be mounted.

  • fs_file describes the mount point for the filesystem.

  • fs_vfstype describes the type of the filesystem.

    A list of filesystems the current kernel supports is exposed via /proc/filesystems. Detailed documentation for each filesystem can be found in the Linux kernel tree.

  • fs_mntopts describes the mount options associated with the filesystem.

    Filesystem independent options are listed in the mount manual page. For filesystem specific options consult the kernel tree documentation for that filesystem.

2
  • Traditionally, and still the case on most systems, the information comes from /etc/mtab which mount/umount maintain. Some Linux distributions replace /etc/mtab with a symlink to /proc/self/mount but not all do. Sep 24, 2013 at 11:32
  • @StephaneChazelas Thanks for your comment. I edited the answer accordingly and added a note on the implications. Sep 24, 2013 at 13:07
5

At first you need to know differences between Virtual Filesystems and Physical Filesystems (check google).

proc, sysfs, tmpfs,devpts, sun_rpc and gvfs-fuse-daemon are Virtual filesystems.

/dev/sda1 and /dev/sda3 are media devices: physical filesystems.

proc: proc is a Virtual filesystems for managing processes, you can see every PID and another resources.

sysfs: is another Virtual filesystem managed by the kernel; it assists proc, though not in PIDs but in hardware and another resources.

/dev/pts : on GNU/Linux, you have virtual terminals and real terminals, for real terminals you can access via: /dev/tty1, /dev/tty2, /dev/tty2 swtich via CTRL+ALT+F1..8 But for virtual terminals, you have /dev/pts/ directory, it contains /dev/pts/0, 1, 2 and so on each digit for one virtual terminal.

/dev/shm : shm is abbreviation of SHared Memory, it's a place of sharing data.

RPC : Remote Procedure call.

tmpfs : When the kernel needs space for each task, mount it type. Such as /tmp

NOTE: At first, read about Virtual filesystems then read about mounting.

6
  • 2
    "logical" filesystems isn't the usual term. "Virtual" filesystems is more common.
    – Mat
    Sep 23, 2013 at 6:12
  • 1
    @MohsenPahlevanzadeh That's not the meaning of "vfs" (you've invented your own, this isn't the definition used in Linux kernel development), "virtual filesystem" is the standard name for this.
    – Chris Down
    Sep 23, 2013 at 6:37
  • Ohi read wikipedia, sorry for wrong info, i updated my post. Sep 23, 2013 at 6:43
  • @MohsenPahlevanzadeh You should also use the term "namespace" carefully because in the context of the Linux kernel the term is heavily associated with kernel namespaces. You also mention that proc shows every PID, but it this is not strictly true since PID namespaces were introduced in 2.6.24. When certain conditions are met, proc only shows resources associated with processes in the current PID namespace. Sep 23, 2013 at 7:05
  • 1
    The terminals accessed by CTRL+ALT+F1..F8 are not real terminals but "virtual consoles".
    – rpthms
    Feb 18, 2014 at 17:59
4

by default the mount command displays a list of media devices currently mounted on the system.There are four pieces of information the mount command provides:

  • The device location of the media
  • The mount point in the virtual directory where the media is mounted
  • The file-system type
  • The access status of the mounted media

as in your example output of mound command in the first row:

  • /dev/sda2 is the device location
  • / is the mount point where your media is mounted
  • ext4 the file system type
  • (rw) access status which is (read and write)

there may be many other options as in other rows of your example for the forth column which you can find in detail in this atricle: http://en.wikipedia.org/wiki/Fstab

2
  • ok I edited the answer :)
    – Maria
    Apr 8, 2015 at 5:24
  • That's much better.
    – Anthon
    Apr 8, 2015 at 5:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .