- Linux command to list file systems available for mounting?
- 3 Answers 3
- 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 to list disks, partitions and filesystems in Linux? [duplicate]
- 3 Answers 3
- Example
Linux command to list file systems available for mounting?
What terminal command will return data that includes the file systems that are currently available for mounting on my system? Specifically, I am using Ubuntu 15.04, though I would prefer an answer that is valid for all *nix users. NOTES: I don’t want to know what IS mounted, I want to know what is available. I don’t want to check the type of file system (ext2, ext4, ntsf, etc.), I want to know which file systems are available to be mounted (sda2, fd1, etc.).
Do you mean which filesystems (e.g, ext4, xfs, tmpfs) are available, or what disk devices which potentially contain filesystems (e.g, sdb1, sdd3) are available?
@duskwuff No, I do not mean file system TYPES (ext4, etc.), I mean file systems (which are formatted to a type). Please see CompTIA for clarification of the terms.
What you are describing sounds like storage devices, not file systems. If CompTIA uses the phrase «file systems» to describe this, I’m sorry, but they are wrong.
3 Answers 3
On Ubuntu you can use to show discs:
or to check all partitions on your system
sudo blkid -o list | grep "not mounted"
or if you just want the device:
sudo blkid -o list | grep "not mounted" | awk ''
Just to point out, since you edited, the command sudo blkid -o list | grep «not mounted» is the one that was correct.
Regarding the question «command will return data that includes the file systems that are currently available for mounting on my system».
Granted from the powerful PROC file system, the available (or, static + dynamically installed) file systems in a running Linux could be found by:
In my linux 3.10.0, the result is:
$cat /proc/filesystems nodev sysfs nodev rootfs nodev ramfs nodev bdev nodev proc nodev cgroup nodev cpuset nodev tmpfs nodev devtmpfs nodev debugfs nodev securityfs nodev sockfs nodev dax nodev bpf nodev pipefs nodev configfs nodev devpts nodev hugetlbfs nodev autofs nodev pstore .
This is the meta-data, the «mount» command will find and use.
Then, with below command, it lists all the mounted file systems.
$cat /proc/mounts /dev/sda1 /boot xfs rw,relatime,attr2,inode64,noquota 0 0 . cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
The third field of each line, like xfs or cgroup, is the «file system», which is just mentioned in previous command.
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.
How to list disks, partitions and filesystems in Linux? [duplicate]
In Windows, if you type LIST DISK using DiskPart in a command prompt it lists all physical storage devices, plus their size, format, etc. What is the equivalent of this in Linux?
3 Answers 3
There are many tools for that, for example fdisk -l or parted -l , but probably the most handy is lsblk (aka list block devices):
Example
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 238.5G 0 disk ├─sda1 8:1 0 200M 0 part /boot/efi ├─sda2 8:2 0 500M 0 part /boot └─sda3 8:3 0 237.8G 0 part ├─fedora-root 253:0 0 50G 0 lvm / ├─fedora-swap 253:1 0 2G 0 lvm [SWAP] └─fedora-home 253:2 0 185.9G 0 lvm
It has many additional options, for example to show filesystems, labels, etc. As always man lsblk is your friend.
@Dor it is worth explaining what additional options do, if you are recommending their use. -f or —fs shows the information about filesystems, such as format, crypto, raid member, etc. It is somewhat slower than the default though.
You’ll like this : you can do sudo lsblk —scsi and this shows the disk types including name(sda,sdb. ), scsi addr, type,vendor, model, rev, .. it’s easy to find which is which when you want to physically locate the disk.
Another way to quickly see the filesystems is the command df. On my machine (Finnish localization) it shows like this:
ptakala@athlon:/mnt$ df Tiedostojärjestelmä 1K-lohkot Käyt Vapaana Käy% Liitospiste /dev/root 38317204 19601752 16762352 54% / devtmpfs 4063816 0 4063816 0% /dev tmpfs 4097592 81988 4015604 3% /dev/shm tmpfs 4097592 10120 4087472 1% /run tmpfs 5120 8 5112 1% /run/lock tmpfs 4097592 0 4097592 0% /sys/fs/cgroup /dev/sda9 535267140 287403688 220666804 57% /work /dev/sda7 288239836 201635356 71956016 74% /home tmpfs 819520 4 819516 1% /run/user/113 tmpfs 819520 8 819512 1% /run/user/1000 /dev/sda1 39070048 37083304 1986744 95% /mnt/sda1 /dev/sda10 22662140 14032580 8629560 62% /mnt/sda10 /dev/sda5 29280176 20578032 8702144 71% /mnt/sda5
It won’t show the file system type, but usually that is non-essential, and you see by one eyedrop everything needed.
ptakala@athlon:/mnt$ df -h Tiedostojärjestelmä Koko Käyt Vapaa Käy% Liitospiste /dev/root 37G 19G 16G 54% / devtmpfs 3,9G 0 3,9G 0% /dev tmpfs 4,0G 89M 3,9G 3% /dev/shm tmpfs 4,0G 9,9M 3,9G 1% /run tmpfs 5,0M 8,0K 5,0M 1% /run/lock tmpfs 4,0G 0 4,0G 0% /sys/fs/cgroup /dev/sda9 511G 275G 211G 57% /work /dev/sda7 275G 193G 69G 74% /home tmpfs 801M 4,0K 801M 1% /run/user/113 tmpfs 801M 8,0K 801M 1% /run/user/1000 /dev/sda1 38G 36G 1,9G 95% /mnt/sda1 /dev/sda10 22G 14G 8,3G 62% /mnt/sda10 /dev/sda5 28G 20G 8,3G 71% /mnt/sda5