To list mounted disks on Linux, you can try these five methods:
- Quickly list mounted disks and their relevant information by executing the
mountcommand in a terminal.
- Gain insights into disk usage and file system information of mounted disks by running the
df -hcommand in a terminal.
- Explore mounted disks and their properties through the user-friendly interface of the GNOME Disks application.
- Obtain a comprehensive hierarchical view of block devices, including mounted disks and mount points, by executing the
lsblkcommand in a terminal.
- Examine the contents of the
/etc/fstabfile in a terminal to discover mounted disks and their mount points.
Optimize your disk management in Ubuntu with tips and tricks like Utilizing the -t option to filter by file system type, sort the output for easier identification, search with
grep for specific disk information, export to a file for future reference, and explore comprehensive details with the
lsblk command. Improve your efficiency and experience when listing mounted disks.
Explore the article below to learn different methods to list disks on Linux. Also, learn tips and tricks to list mounted disks.
Listing mounted disks on Linux is essential for system administrators and enthusiasts alike. You can effectively manage storage resources, troubleshoot issues, and optimize disk usage by knowing which disks are mounted, their file system types, and mount points. Whether you’re identifying available storage, checking disk utilization, or locating specific disks, understanding how to list mounted disks on Linux empowers you with crucial information about your system’s storage landscape. In this article, I will explore various methods, tips, and tricks to help you effortlessly list and navigate mounted disks in Linux.
How to List Mounted Disks on Linux
To list mounted disks on Linux, you have various methods:
mount command for a comprehensive view,
df command for disk usage details, GNOME Disks application for a graphical interface,
lsblk command for hierarchical information, and checking the
/etc/fstab file for persistent configurations.
1. mount Command
mount command is a versatile tool that allows you to list currently mounted disks on your Ubuntu system. This method is useful for gaining a comprehensive snapshot of the current disk configuration and identifying available storage resources. Follow these steps:
- Open a Terminal on your Ubuntu system.
- Type the following command and press Enter:
- This command will display a list of currently mounted disks, their mount points, file system types, and other relevant information.
2. df Command
df command provides valuable insights into disk usage and mounted disks on your Ubuntu system. This method is ideal for monitoring disk utilization, understanding storage capacities, and planning disk management strategies. To list mounted disks on Linux follow these steps:
- Open a Terminal window and enter the following command:
-hoption is used to display sizes in a human-readable format. This command will list mounted disks, their total size, used space, available space, and file system type.
3. GNOME Disks Application
The GNOME Disks application offers a user-friendly graphical interface for exploring disks and their properties.This method provides an intuitive and visually appealing way to interact with mounted disks, making it convenient for disk inspection and management tasks. Here is a step-by-step guide:
- Open the Activities overview.
- Type Disks in the search bar and click on the Disks application when it appears.
- In the Disks application, you will see a list of disks and partitions on the left-hand side. Click on a disk or partition to view its details, including the mount point.
4. lsblk Command
lsblk command in Ubuntu provides a straightforward and powerful way to list mounted disks on Linux and obtain detailed information about them. By executing this command in a Terminal, you can gain a hierarchical view of block devices, including mounted disks, their mount points, and additional details. Follow these steps:
- Once the Terminal is open, type the following command:
- Press Enter to execute the command.
- The Terminal will display a hierarchical view of all block devices, including the mounted disks. Examine the output to gather information about the mounted disks. You will see details such as device names, mount points, sizes, disk hierarchies, etc.
5. /etc/fstab File
/etc/fstab file contains essential information about disk mounting in Ubuntu. By examining the contents of this file using a Terminal, you can identify the mounted disks and their associated mount points. This method is useful for understanding the persistent disk configurations set in the
/etc/fstab file and gaining insights into the mounted disks during system boot-up. Here are the steps:
- Access the command window.
- Type the following command and press
Enterto view the
- This file contains information about the disks and their mount points. Look for lines starting with a UUID or device path followed by the mount point. These lines represent the mounted disks and their mount points.
5 Tips and Tricks for Listing Mounted Disks in Ubuntu
Using tips and tricks can help you to list mounted disks on Linux effectively. Whether you are a system administrator, a power user, or simply curious about your disk setup, these tips will enhance your experience and efficiency when working with mounted disks. Here five of them listed below:
- 💡 Utilize the -t Option with the mount Command: When using the
mountcommand to list mounted disks, you can employ the
-toption followed by the file system type (e.g., ext4, ntfs) to filter the output. This allows you to focus on specific types of disks, making it easier to locate and manage them. For example,
mount -t ext4will display only
ext4file system-based mounted disks.
- 📌 Sort the Output of the mount Command: To organize the output of the
mountcommand, add the
--sortoption followed by the desired sorting criteria. For instance, using
--sort=sourcewill sort the mounted disks based on their source device names, facilitating easier identification and navigation. This can be especially helpful when dealing with a large number of mounted disks.
- 🔍 Search for Specific Disk Information Using grep: To search for a particular disk or mount point within the output of the mount command, you can pipe the output to the grep command. For example, to find a disk mounted at
mount | grep /media/data. This allows for quick and targeted disk identification, especially when dealing with complex configurations.
- 📄 Export Disk Information to a File: If you need to save the output of the
mountcommand for future reference or analysis, you can redirect the output to a file. Use the > or >> operator to save the output to a new file or append it to an existing file, respectively. For instance,
mount > mounted_disks.txtwill save the output to a file named
mounted_disks.txt. This enables you to access and review the disk information at any time.
- 🕵️ Explore Disk Details with the lsblk Command: To obtain comprehensive information about the disks, partitions, and their relationships, use the
lsblkcommand. It provides a detailed overview, including mount points, sizes, and disk hierarchies. By combining it with other commands or options, you can extract specific details and gain a deeper understanding of your disk configuration. This command is particularly useful when you need a more extensive view of your disks and their properties.
Wrapping it Up
I have provided various methods to list mounted disks on Linux, including the
df command, and
lsblk command. I have also shared helpful tips and tricks, such as filtering options, sorting the output, and searching for specific disk information.
To further enhance your Linux skills, consider exploring related articles and topics, such as Advanced Disk Partitioning Techniques, Optimizing Disk Performance in Linux, and Understanding File Systems. By exploring into these articles, you’ll deepen your Linux expertise and gain valuable insights into advanced disk management techniques, optimizing system performance, and understanding file systems.
Frequently Asked Questions
How can I view additional details about a specific mounted drive?
To view additional details about a specific mounted drive, you can utilize the
blkid command followed by the device name or mount point. This command retrieves crucial information such as the universally unique identifier (UUID), file system type, and labels associated with the drive. For instance, running
blkid /dev/sda1 or
blkid /mnt/data will provide detailed information about the drive, including its unique identifier, file system type (e.g., ext4), and any assigned labels. This enables you to gather comprehensive details about specific mounted disks, assisting you in accurately identifying and managing them based on their attributes.
Can I list the mounted disks in a specific directory?
Certainly! You can easily list the mounted disks within a designated directory using the
findmnt command. By utilizing the
--directory option, followed by the path of the directory of interest, you can narrow down the results to only display the mounted disks within that specific directory. For example, executing
findmnt -D /mnt/data will present a concise list of the mounted disks in the
/mnt/data directory. This functionality allows you to precisely examine the mounted disks in targeted locations, providing a more focused view of the disk utilization within specific directories.
How can I identify the device name of a mounted drive?
To identify the device name of a mounted drive, you can utilize the
df command along with the
--print-type option. Running
df -T will display detailed information about mounted disks, including their device names, file system types, and mount points. By examining the output, you can easily identify the device names associated with the mounted disks on your Linux system. This information is particularly useful when performing disk-related operations or troubleshooting, as it allows you to accurately reference and target specific mounted disks based on their device names.
Is there a way to list mounted disks in a tabular format?
Yes, you can list the mounted disks in a tabular format using the
lsblk command along with the
--output option. You can create a well-structured tabular output by specifying the desired columns, such as NAME, SIZE, and MOUNTPOINT. For instance, executing
lsblk -o NAME, SIZE, MOUNTPOINT will provide a clear table containing the names of the mounted disks, their respective sizes, and their associated mount points. This tabular format enhances readability and allows easy comparison and analysis of the listed mounted disks’ essential attributes.
Can I list only the mounted network disks?
Absolutely! To specifically list the mounted network disks, you can utilize the
mount command with the
--types option, followed by the file system type used for network disks, such as NFS (Network File System). By executing
mount -t nfs, you will receive a concise list of the mounted network disks utilizing NFS. This functionality enables you to isolate and focus solely on network disks, providing a streamlined overview of your network-based disk configurations. This command allows you to efficiently manage and monitor network disks without the clutter of locally mounted disks.