How to List Mounted Drives on Linux

list mounted drive linux

In this article, I will show you the different ways to list mounted drives on Linux. We can use mount, cat, findmnt and df commands to list mounted device any Linux distribution like Ubuntu or Centos. In Linux, mount command mounts a storage device or filesystem, below commands will display all those mounts.

1) Using cat command

From the terminal run below cat command

$ cat /proc/mounts
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=101468k,mode=755 0 0
/dev/xvda1 / ext4 rw,relatime,discard,data=ordered 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
lxcfs /var/lib/lxcfs fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0
tmpfs /run/user/76547979 tmpfs rw,nosuid,nodev,relatime,size=101468k,mode=700,uid=76547979,gid=76546561 0 0
~$ cat /proc/self/mounts
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=101468k,mode=755 0 0
/dev/xvda1 / ext4 rw,relatime,discard,data=ordered 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
lxcfs /var/lib/lxcfs fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0
tmpfs /run/user/76547979 tmpfs rw,nosuid,nodev,relatime,size=101468k,mode=700,uid=76547979,gid=76546561 0 0

2) Using Mount Command

Let check mount command to list mount points.

Sample Outputs

~$ mount
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=101468k,mode=755)
/dev/xvda1 on / type ext4 (rw,relatime,discard,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
tmpfs on /run/user/76547979 type tmpfs (rw,nosuid,nodev,relatime,size=101468k,mode=700,uid=76547979,gid=76546561)

~$ mount -l
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=101468k,mode=755)
/dev/xvda1 on / type ext4 (rw,relatime,discard,data=ordered) [cloudimg-rootfs]
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
lxcfs on /var/lib/lxcfs type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
tmpfs on /run/user/76547979 type tmpfs (rw,nosuid,nodev,relatime,size=101468k,mode=700,uid=76547979,gid=76546561)

3) Using df command

We can the below df command to list mount points.

~$ df -aTh
Filesystem     Type         Size  Used Avail Use% Mounted on
sysfs          sysfs           0     0     0    - /sys
proc           proc            0     0     0    - /proc
udev           devtmpfs     488M     0  488M   0% /dev
devpts         devpts          0     0     0    - /dev/pts
tmpfs          tmpfs        100M   11M   89M  11% /run
/dev/xvda1     ext4         7.7G  3.1G  4.7G  40% /
securityfs     securityfs      0     0     0    - /sys/kernel/security
tmpfs          tmpfs        496M     0  496M   0% /dev/shm
tmpfs          tmpfs        5.0M     0  5.0M   0% /run/lock
tmpfs          tmpfs        496M     0  496M   0% /sys/fs/cgroup
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/systemd
pstore         pstore          0     0     0    - /sys/fs/pstore
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/pids
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/net_cls,net_prio
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/cpu,cpuacct
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/cpuset
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/freezer
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/hugetlb
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/blkio
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/memory
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/perf_event
cgroup         cgroup          0     0     0    - /sys/fs/cgroup/devices
systemd-1      -               -     -     -    - /proc/sys/fs/binfmt_misc
debugfs        debugfs         0     0     0    - /sys/kernel/debug
mqueue         mqueue          0     0     0    - /dev/mqueue
hugetlbfs      hugetlbfs       0     0     0    - /dev/hugepages
fusectl        fusectl         0     0     0    - /sys/fs/fuse/connections
lxcfs          fuse.lxcfs      0     0     0    - /var/lib/lxcfs
binfmt_misc    binfmt_misc     0     0     0    - /proc/sys/fs/binfmt_misc
tracefs        -               -     -     -    - /sys/kernel/debug/tracing
tmpfs          tmpfs        100M     0  100M   0% /run/user/76547979

You can use -t followed by filesystem type (say ext3, ext4, nfs) to display respective mount points. For examples below df command display all NFS mount points.

# df -HP -t nfs

4 ) Using findmnt

Findmnt is a powerful tool with lots of options to list mounted filesystems.

$ findmnt --raw
TARGET SOURCE FSTYPE OPTIONS
/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
/proc proc proc rw,nosuid,nodev,noexec,relatime
/dev udev devtmpfs rw,nosuid,relatime,size=499356k,nr_inodes=124839,mode=755
/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
/run tmpfs tmpfs rw,nosuid,noexec,relatime,size=101468k,mode=755
/ /dev/xvda1 ext4 rw,relatime,discard,data=ordered
/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
/dev/shm tmpfs tmpfs rw,nosuid,nodev
/run/lock tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k
/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids
/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct
/sys/kernel/debug debugfs debugfs rw,relatime
/dev/mqueue mqueue mqueue rw,relatime
/dev/hugepages hugetlbfs hugetlbfs rw,relatime
/sys/fs/fuse/connections fusectl fusectl rw,relatime
/var/lib/lxcfs lxcfs fuse.lxcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other
/proc/sys/fs/binfmt_misc binfmt_misc binfmt_misc rw,relatime
/sys/kernel/debug/tracing tracefs tracefs rw,relatime
/run/user/76547979 tmpfs tmpfs rw,nosuid,nodev,relatime,size=101468k,mode=700,uid=76547979,gid=76546561
$ findmnt -t ext4
TARGET SOURCE     FSTYPE OPTIONS
/      /dev/xvda1 ext4   rw,relatime,discard,data=ordered
$ findmnt
TARGET                                SOURCE      FSTYPE      OPTIONS
/                                     /dev/xvda1  ext4        rw,relatime,discard,data=ordered
├─/sys                                sysfs       sysfs       rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security              securityfs  securityfs  rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup                    tmpfs       tmpfs       ro,nosuid,nodev,noexec,mode=755
│ │ ├─/sys/fs/cgroup/systemd          cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
│ │ ├─/sys/fs/cgroup/pids             cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,pids
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
│ │ ├─/sys/fs/cgroup/cpu,cpuacct      cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
│ │ ├─/sys/fs/cgroup/cpuset           cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,cpuset
│ │ ├─/sys/fs/cgroup/freezer          cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,freezer
│ │ ├─/sys/fs/cgroup/hugetlb          cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,hugetlb
│ │ ├─/sys/fs/cgroup/blkio            cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,blkio
│ │ ├─/sys/fs/cgroup/memory           cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,memory
│ │ ├─/sys/fs/cgroup/perf_event       cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,perf_event
│ │ └─/sys/fs/cgroup/devices          cgroup      cgroup      rw,nosuid,nodev,noexec,relatime,devices
│ ├─/sys/fs/pstore                    pstore      pstore      rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/debug                 debugfs     debugfs     rw,relatime
│ │ └─/sys/kernel/debug/tracing       tracefs     tracefs     rw,relatime
│ └─/sys/fs/fuse/connections          fusectl     fusectl     rw,relatime
├─/proc                               proc        proc        rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc          systemd-1   autofs      rw,relatime,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct
│   └─/proc/sys/fs/binfmt_misc        binfmt_misc binfmt_misc rw,relatime
├─/dev                                udev        devtmpfs    rw,nosuid,relatime,size=499356k,nr_inodes=124839,mode=755
│ ├─/dev/pts                          devpts      devpts      rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/shm                          tmpfs       tmpfs       rw,nosuid,nodev
│ ├─/dev/mqueue                       mqueue      mqueue      rw,relatime
│ └─/dev/hugepages                    hugetlbfs   hugetlbfs   rw,relatime
├─/run                                tmpfs       tmpfs       rw,nosuid,noexec,relatime,size=101468k,mode=755
│ ├─/run/lock                         tmpfs       tmpfs       rw,nosuid,nodev,noexec,relatime,size=5120k
│ └─/run/user/76547979                tmpfs       tmpfs       rw,nosuid,nodev,relatime,size=101468k,mode=700,uid=76547979,gid=76546561
└─/var/lib/lxcfs                      lxcfs       fuse.lxcfs  rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other

In this article, we learned commands to list mounted drives or filesystems on Linux. Hope you enjoyed reading this article. Kindly share your thoughts.

Read Also:

Bobbin Zachariah 1:33 pm

Comments

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.