Linux Administrator

How To Show Mounted Devices In Linux Operating System

mounted-devices-in-linux-800x430
mm
Written by Santosh Prasad

To list the mounted devices in Linux system, you can use any one of the following command to see mounted devices under Linux Operating System.

1. df command – It show file system disk space usage.
2. mount command – It show all mounted file systems.
3. /proc/mounts or /proc/self/mounts file – Show all mounted file systems.

Examples

Open the terminal and login into your Linux machine using ssh and type the following command:

Using df Command

Use the df command to show the mounted devices on the Linux system. df command report file system disk space usage. Popular options are given below:

  • df -a :- All file systems
  • df -h :- Print the output in human readable format (e.g., 1K 230M 2G)
  • df -T :- Print the file system type
# df -haT
Filesystem     Type         Size  Used Avail Use% Mounted on
proc           proc            0     0     0    - /proc
sysfs          sysfs           0     0     0    - /sys
devtmpfs       devtmpfs     488M   56K  488M   1% /dev
devpts         devpts          0     0     0    - /dev/pts
tmpfs          tmpfs        498M     0  498M   0% /dev/shm
/dev/xvda1     ext4         7.8G  2.6G  5.2G  33% /
none           binfmt_misc     0     0     0    - /proc/sys/fs/binfmt_misc

Using mount Command

You can use mount command to show the mounted device. There are lots of option ( see man mount) with mount command. In my case, I will only use -l option which adds the labels in the mount output:

# mount
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=498776k,nr_inodes=124694,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
/dev/xvda1 on / type ext4 (rw,noatime,data=ordered)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)

OR

# mount -l
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=498776k,nr_inodes=124694,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
/dev/xvda1 on / type ext4 (rw,noatime,data=ordered) [/]
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)

Using /proc/mounts or /proc/self/mounts Files

Follow the below command:

# cat /proc/mounts
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devtmpfs /dev devtmpfs rw,relatime,size=498776k,nr_inodes=124694,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/xvda1 / ext4 rw,noatime,data=ordered 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0

OR

# cat /proc/self/mounts
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
devtmpfs /dev devtmpfs rw,relatime,size=498776k,nr_inodes=124694,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/xvda1 / ext4 rw,noatime,data=ordered 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0

I hope this article will help you to show the mounted devices on Linux Operating Systems.

Thanks:)

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment