- How do I check where devices are mounted?
- 3 Answers 3
- 3 ways to list mount points in Linux
- what is mount point in Linux
- List mount points with df command in Linux
- List mount points with mount command in Linux
- List mount points with cat /proc/mounts command in Linux
- How to show mounted devices in Linux?
- Using /proc/mounts or /proc/self/mounts files or /etc/mtab
- ZIADI Mohamed Ali
- Latest posts by ZIADI Mohamed Ali (see all)
- 4 Commands to List Mounted File Systems in Linux
- 1. View Linux Mounted Filesystem Using /proc Filesystem
- 2. List Linux Mounted Filesystem Using df Command
- 3. Print Linux Mounted Filesystems Using findmnt Command
- 4. Show Mounted Linux Filesystem Using mount Command
How do I check where devices are mounted?
What is the command that lets me see what and where devices are mounted? I’m having trouble changing songs on my old iPod, and I have a feeling it’s because of the mount point.
3 Answers 3
There are at least three programs I know of that list device mount points:
- mount — mount a filesystem (used for general mount info too):
$ mount /dev/sda3 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) . /dev/mapper/lvmg-homelvm on /home type btrfs (rw,relatime,compress=lzo,space_cache) /dev/sda5 on /home/muru/arch type btrfs (rw,relatime,compress=lzo,space_cache) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev) systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 30832636 11993480 17249912 42% / none 4 0 4 0% /sys/fs/cgroup . /dev/sda5 31457280 3948600 25396496 14% /home/bro3886/arch
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 100M 0 part ├─sda2 8:2 0 58.5G 0 part ├─sda3 8:3 0 30G 0 part / ├─sda4 8:4 0 1K 0 part ├─sda5 8:5 0 30G 0 part ├─sda6 8:6 0 339.2G 0 part │ └─lvmg-homelvm (dm-0) 252:0 0 1.2T 0 lvm └─sda7 8:7 0 8G 0 part [SWAP] sdb 8:16 0 931.5G 0 disk └─sdb1 8:17 0 931.5G 0 part └─lvmg-homelvm (dm-0) 252:0 0 1.2T 0 lvm
Of these three, mount lists all the mountpoints, AFAICT. The others have their weaknesses.
- findmnt suggested by @webwurst is now my favourite tool for the job. It’s a Swiss Army knife when it comes to output control (newer versions can output in JSON too):
$ findmnt / TARGET SOURCE FSTYPE OPTIONS / /dev/sda1 ext4 rw,relatime,errors=remount-ro,data=ordered $ findmnt / -no source /dev/sda1 $ findmnt / --json < "filesystems": [ ] > $ findmnt / --df SOURCE FSTYPE SIZE USED AVAIL USE% TARGET /dev/sda1 ext4 40.2G 25.8G 12.5G 64% /
3 ways to list mount points in Linux
In Linux, there are three ways to list mount points: using the df command, using the mount command, and using the cat /proc/mounts command. In this blog post, we will discuss each of these commands in detail. We will also provide examples of how to use each command. By the end of this blog post, you will be able to list all of the mount points on your Linux system!
what is mount point in Linux
In Linux, a mount point is a directory where a filesystem is mounted. This means that the contents of the filesystem are stored in the mount point directory, and the filesystem can be accessed from there. For example, if you have a filesystem on your hard drive that you want to access from Linux, you would need to mount it on a mount point.
List mount points with df command in Linux
To list the mount points in Linux, we can use df command. This command can be used to display information about mounted filesystems. By default, df command will list all the mount points on your system. You can also specify the mount point of the filesystem that you want to check.
For example, if you wanted to check the amount of free space on the filesystem that is mounted at /, you would use the following command: df /
This command would output the following information:
Filesystem Size Used Avail Use% Mounted on
/dev/sda 100G 12G 88G 12% /
The df command can be also used to display information about how much disk space is free on a filesystem.
List mount points with mount command in Linux
The mount command is used to list all of the mounted filesystems on a system. To use the mount command, you need to specify the -l option. For example, if you wanted to list all of the mounted filesystems on your system, you would use the following command: mount -l
This command would output the following information:
/dev/sda on / type ext (rw,noatime)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /dev type devtmpfs (rw,noexec,nosuid)
List mount points with cat /proc/mounts command in Linux
The cat /proc/mounts command is used to list all of the mounted filesystems on a system. To use this command, you do not need to specify any options. For example, if you wanted to list all of the mounted filesystems on your system, you would use the following command: cat /proc/mounts
This command would output the following information:
/dev/sda / ext (rw,noatime)
proc /proc proc (rw,noexec,nosuid,nodev)
sysfs /sys sysfs (rw,noexec,nosuid,nodev)
You can combine this command with grep command together to get the info of the specific mount point info.
As you can see, all three of these commands provide different information about mounted filesystems. However, all three commands can be used to list all of the mount points on a Linux system.
Example:To list all the mount points on your system, you would use any of the following commands: df /, mount -l, or cat /proc/mounts.
By the end of this blog post, you will be able to list all of the mount points on your Linux system! Try using one of the commands discussed in this post today and see what mount points are available on your system.
How to show mounted devices in Linux?
mount have many exciting options (see man mount). In our case, we will only use -l which adds the labels in the mount output.
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) devtmpfs on /dev type devtmpfs (rw,nosuid,size=979900k,nr_inodes=244975,mode=755) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) configfs on /sys/kernel/config type configfs (rw,relatime) /dev/vda1 on / type xfs (rw,relatime,attr2,inode64,noquota) rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime) debugfs on /sys/kernel/debug type debugfs (rw,relatime) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct) mqueue on /dev/mqueue type mqueue (rw,relatime) nfsd on /proc/fs/nfsd type nfsd (rw,relatime) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime) tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=199984k,mode=700)
Using /proc/mounts or /proc/self/mounts files or /etc/mtab
root@server:~ # cat /proc/mounts
root@server:~ # cat /proc/self/mounts
rootfs / rootfs rw 0 0 sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 devtmpfs /dev devtmpfs rw,nosuid,size=979900k,nr_inodes=244975,mode=755 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0 cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct,cpu 0 0 configfs /sys/kernel/config configfs rw,relatime 0 0 /dev/vda1 / xfs rw,relatime,attr2,inode64,noquota 0 0 rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0 hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 nfsd /proc/fs/nfsd nfsd rw,relatime 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0 tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=199984k,mode=700 0 0
I hope that this blog helped you. Please visit our website for other interesting blogs and feel free to leave your feedbacks and thoughts. Till next time!
ZIADI Mohamed Ali
I am a hands-on, competent Linux system engineer with 9 years’ experience. I have a strong performance background in wide variety of professional Linux system support including monitoring, configuration, troubleshooting and maintenance. I have worked on numerous projects from concept to completion. A specialist in LAMP platforms, I take pride in administrating Linux systems and regularly refresh my skills to ensure I keep up with ongoing developments and new technologies.
Latest posts by ZIADI Mohamed Ali (see all)
- How to show mounted devices in Linux? — July 25, 2017
- How to use Positional parameters and special variables in Linux — June 28, 2017
- Linux: Connect to your WiFi network through CLI? — June 25, 2017
- How to find a file in Linux? — March 19, 2017
- Mysql: How to find table and database size? — January 9, 2017
4 Commands to List Mounted File Systems in Linux
The Linux operating system provides multiple filesystems, including ext4, xfs, tmpfs, securityfs, and many more. This guide demonstrates various ways to list all mounted file systems in a Linux system.
1. View Linux Mounted Filesystem Using /proc Filesystem
The /proc/mounts file is a file that displays the status of all filesystems that are currently mounted on the system. The file format closely resembles that of the /etc/fstab file. The file reports the status of mounted filesystems as recorded by the Linux kernel.
Thus, to view all the mounted filesystems, view the /proc/mounts file using the cat command as shown.
2. List Linux Mounted Filesystem Using df Command
The df command is mostly used to check disk space utilization on mounted file systems. It lists, among other statistics, total disk space and available disk space on each mounted filesystem.
When the -a option is included, the df command lists all the mounted filesystems.
3. Print Linux Mounted Filesystems Using findmnt Command
The findmnt command is yet another powerful command that displays all mounted filesystems on your Linux system in a tree-like format.
To print all the mounted filesystems, simply run the command without any arguments.
This prints the output in a tree-like format as shown.
You can pass the -D option which will print the output similar to the df -Th command
Pass the -t option followed by the filesystem type to print specific filesystems. For example, to view all the mounted EXT4 filesystems, run the command:
To view all EXT4 filesystems mounted in the /etc/fstab file, run the command:
4. Show Mounted Linux Filesystem Using mount Command
You can also use the mount command to list all mounted file systems. Without any arguments, it lists all the mounted filesystems.
Summing Up
In this guide, we have explored four ways that you can use to list all mounted file systems in a Linux system. Your views and feedback on this guide are welcome.