Today we’ll have a nice and simple article, simply because we can, about how to list mounted partitions in Linux. Like so many of these articles, we’re going to need an open terminal. On the other hand, we’ll just be exploring a couple of tools to help us along the way.
Your disk drives, be they solid state or hard disk drives, will be separated into partitions. It can get confusing until you realize that the outputs from these commands won’t always just represent what I’ll call physical partitions. Sometimes, there are virtual partitions – sometimes with their fun file systems.
You may have everything from mounted temporary partitions to software designed to run in its own mounted partition space. When you run these bellow commands, you’ll learn that there are all sorts of mounted partitions. This is completely normal. It’s also pretty easy to weed out the physical partitions.
Why would you want to do this? Well, I’m having a goofy error when I boot one of my computers and I need to narrow it down to which disk it is that’s giving me the error. Once I take the time to do that, I can move on to troubleshooting the problem and finding a solution for the problem.
The tools we’ll be using are ‘findmnt’ and ‘df’. They’re described as the following:
finding:
findmnt – find a filesystem
df:
df – report file system disk space usage
As you can see from the description, both of those have something to do with getting information about a file system. That makes them good tools for the job.
NOTE: There are multiple ways to list mounted partitions. You have GUI and CLI-based tools available to you. One of the goals surrounding this whole project is not just to make people more familiar with Linux but also to help them get comfortable working within the terminal. You’ll be just fine!
List Mounted Partitions:
As I mentioned above, we’ll be using a terminal for this. I do not mind which terminal you’re using but you can usually open the default terminal by pressing
With your terminal now open, you can try the following command:
1 | findmnt |
The output from that command will list your mounted partitions. It’s a lot of text, but most folks are probably only interested in the start of the line. The output of the findmnt command may look a little something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | $ findmnt TARGET SOURCE FSTYPE OPTIONS / /dev/sda5 ext4 rw,relatime,errors=remount-ro ├─/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,inode64 │ │ ├─/sys/fs/cgroup/unified cgroup2 cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate │ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd │ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio │ │ ├─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio │ │ ├─/sys/fs/cgroup/rdma cgroup cgroup rw,nosuid,nodev,noexec,relatime,rdma │ │ ├─/sys/fs/cgroup/misc cgroup cgroup rw,nosuid,nodev,noexec,relatime,misc │ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct │ │ ├─/sys/fs/cgroup/pids cgroup cgroup rw,nosuid,nodev,noexec,relatime,pids │ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory │ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices │ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb │ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event │ │ ├─/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/pstore pstore pstore rw,nosuid,nodev,noexec,relatime │ ├─/sys/fs/bpf bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 │ ├─/sys/kernel/debug debugfs debugfs rw,nosuid,nodev,noexec,relatime │ ├─/sys/kernel/tracing tracefs tracefs rw,nosuid,nodev,noexec,relatime │ ├─/sys/fs/fuse/connections fusectl fusectl rw,nosuid,nodev,noexec,relatime │ └─/sys/kernel/config configfs configfs rw,nosuid,nodev,noexec,relatime ├─/proc proc proc rw,nosuid,nodev,noexec,relatime │ ├─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ │ │ └─/proc/sys/fs/binfmt_misc binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime │ └─/proc/fs/nfsd nfsd nfsd rw,relatime ├─/dev udev devtmpfs rw,nosuid,noexec,relatime,size=8067516k,nr_inodes=2016879,mode=755,in │ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 │ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev,inode64 │ ├─/dev/mqueue mqueue mqueue rw,nosuid,nodev,noexec,relatime │ └─/dev/hugepages hugetlbfs hugetlbfs rw,relatime,pagesize=2M ├─/run tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=1627348k,mode=755,inode64 │ ├─/run/lock tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,inode64 │ ├─/run/rpc_pipefs sunrpc rpc_pipefs rw,relatime │ └─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatime,size=1627348k,mode=700,uid=1000,gid=1000,ino │ ├─/run/user/1000/gvfs gvfsd-fuse fuse.gvfsd-f rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 │ └─/run/user/1000/doc portal fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 ├─/media/kgiii/FLASH DRIVE /dev/sdb1 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,code ├─/media/kgiii/elements1 /dev/sdc1 ext4 rw,nosuid,nodev,relatime ├─/media/kgiii/elements2 /dev/sdc2 ext4 rw,nosuid,nodev,relatime ├─/media/kgiii/elements3 /dev/sdc3 ext4 rw,nosuid,nodev,relatime ├─/media/kgiii/elements4 /dev/sdc4 ext4 rw,nosuid,nodev,relatime └─/var/tmp/flatpak-cache-53JL81/org.gnome.Platform-PFW871 revokefs-fuse fuse.revokef rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 |
The next command you’re going to want to try will be the ‘df’ command. We’ll be using a few flags. It’s not very complicated, though it may look like it. The command is a simple ‘df’ command and looks like this:
1 | df -aTh |
We use the -a
flag for ‘all’. Then we use the -T
flag because that means type. Finally, we use the -h
flag because that means the output will be “human readable” (or more easily read by us mortals.) The output of which looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | $ df -aTh df: /run/user/1000/doc: Operation not permitted Filesystem Type Size Used Avail Use% Mounted on sysfs sysfs 0 0 0 - /sys proc proc 0 0 0 - /proc udev devtmpfs 7.7G 0 7.7G 0% /dev devpts devpts 0 0 0 - /dev/pts tmpfs tmpfs 1.6G 28M 1.6G 2% /run /dev/sda5 ext4 468G 322G 123G 73% / securityfs securityfs 0 0 0 - /sys/kernel/security tmpfs tmpfs 7.8G 247M 7.6G 4% /dev/shm tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup cgroup2 cgroup2 0 0 0 - /sys/fs/cgroup/unified cgroup cgroup 0 0 0 - /sys/fs/cgroup/systemd pstore pstore 0 0 0 - /sys/fs/pstore bpf bpf 0 0 0 - /sys/fs/bpf cgroup cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio cgroup cgroup 0 0 0 - /sys/fs/cgroup/blkio cgroup cgroup 0 0 0 - /sys/fs/cgroup/rdma cgroup cgroup 0 0 0 - /sys/fs/cgroup/misc cgroup cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct cgroup cgroup 0 0 0 - /sys/fs/cgroup/pids cgroup cgroup 0 0 0 - /sys/fs/cgroup/memory cgroup cgroup 0 0 0 - /sys/fs/cgroup/devices cgroup cgroup 0 0 0 - /sys/fs/cgroup/hugetlb cgroup cgroup 0 0 0 - /sys/fs/cgroup/perf_event cgroup cgroup 0 0 0 - /sys/fs/cgroup/cpuset cgroup cgroup 0 0 0 - /sys/fs/cgroup/freezer systemd-1 - - - - - /proc/sys/fs/binfmt_misc mqueue mqueue 0 0 0 - /dev/mqueue hugetlbfs hugetlbfs 0 0 0 - /dev/hugepages debugfs debugfs 0 0 0 - /sys/kernel/debug tracefs tracefs 0 0 0 - /sys/kernel/tracing sunrpc rpc_pipefs 0 0 0 - /run/rpc_pipefs nfsd nfsd 0 0 0 - /proc/fs/nfsd fusectl fusectl 0 0 0 - /sys/fs/fuse/connections configfs configfs 0 0 0 - /sys/kernel/config binfmt_misc binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc tmpfs tmpfs 1.6G 48K 1.6G 1% /run/user/1000 gvfsd-fuse fuse.gvfsd-fuse 0 0 0 - /run/user/1000/gvfs /dev/sdb1 vfat 15G 14G 929M 94% /media/kgiii/FLASH DRIVE revokefs-fuse fuse.revokefs-fuse 468G 322G 123G 73% /var/tmp/flatpak-cache-53JL81/org.gnome.Platform-PFW871 /dev/sdc1 ext4 975G 904G 21G 98% /media/kgiii/elements1 /dev/sdc2 ext4 969G 401G 519G 44% /media/kgiii/elements2 /dev/sdc3 ext4 961G 626G 286G 69% /media/kgiii/elements3 /dev/sdc4 ext4 761G 566G 157G 79% /media/kgiii/elements4 |
No matter which of those commands you use, it will make your terminal list mounted partitions. If you need to know which partitions are mounted, these are the tools you can start with. They’re easy enough to work with.
Closure:
Well, it’s a bit late in the evening. I almost forgot that there was an article due tomorrow. This happens when I get a lot of responses (elsewhere) on the wrong day. My brain just doesn’t click. I should probably set an automated notification to let me know which days require articles, but I haven’t failed yet. In fact, you get an interesting article about how you can list mounted partitions.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.