Linux show mounted devices

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% / 

Источник

Читайте также:  Dot in linux permissions

How to show mounted devices in Linux?

df

The Linux Juggernaut

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.

Читайте также:  Linux icon for apps

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 Ways to Show all Drives (Mounted and Unmounted) on Linux

Show Linux Drives

The drives on any system can either be mounted or unmounted. The mounted drives are the ones that are ready to be accessed at any time whereas the data residing on the unmounted drives can only be accessed after these drives are mounted. In the proceeding section of this article, we want to share with you the different methods of displaying all available drives on Linux.

Display all Drives on Linux

To display all of your drives on a Linux system, you can perform any of the following four methods:

Method # 1: Using the “fdisk” Command

The “fdisk” command can be used to display the drives in Linux in the manner shown below:

List drives with fdisk

The output produced by this command is shown in the following image:

List of drives

Method # 2: Using the “blkid” Command:

The “blkid” command can be used to display available drives in Linux in the manner shown below:

use blkid command

The output produced by this command is shown in the following image:

List of drives from blkid command

Method # 3: Using the “lsblk” Command:

The “lsblk” command can be used to display the system drives in Linux in the manner shown below:

lsblk command

The output produced by this command is shown in the following image:

Result of lsbls command

Method # 4: Using the “parted” Command:

The “parted” command can be used to display the disk partitions in Linux in the manner shown below:

Parted command

The output produced by this command is shown in the following image:

List of drives as shown by parted command

Conclusion

By picking out any of the four methods shared in this article, you can conveniently find out all the mounted and unmounted drives on your Ubuntu system. Once you have this information, you can always mount a drive out of these whenever you wish to access its contents.

Читайте также:  Linux диски разделы файловая система

About This Site

Vitux.com aims to become a Linux compendium with lots of unique and up to date tutorials.

Latest Tutorials

Источник

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.

View Currently Mounted Linux Filesystems

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.

List Mounted Linux 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.

Print Mounted Linux Filesystems

You can pass the -D option which will print the output similar to the df -Th command

List Linux File System with Disk Usage

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:

List Ext4 Mounted File System

To view all EXT4 filesystems mounted in the /etc/fstab file, run the command:

Check Linux Ext4 Mounted File System

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.

Show Mounted Linux 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.

Источник

Оцените статью
Adblock
detector