How to Check Mounted Drives with mount
The mount command in Linux is a fundamental utility used to attach filesystems to the system’s directory structure. It can also be used to check the currently mounted drives and their configurations. This tutorial will guide you through using the mount command effectively.
1. Viewing Mounted Drives
To view all currently mounted filesystems, simply run:
mount
This command will output a list of all filesystems mounted along with their mount points and options. The output typically looks like this:
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
/dev/sdb1 on /mnt/data type ext4 (rw)
2. Understanding the Output
The output provides several crucial pieces of information:
- Device: The filesystem device (e.g.,
/dev/sda1). - Mount Point: The directory in which the filesystem is mounted (e.g.,
/,/mnt/data). - Type: The type of filesystem (e.g.,
ext4,ntfs). - Options: Mount options such as
rw(read-write) orro(read-only).
3. Checking Mounted Filesystems with df
While the mount command provides essential information, you can also use the df command to display disk space usage along with mounted filesystems:
df -h
This will show human-readable sizes of used and available space for all mounted filesystems.
4. Additional Information from /etc/mtab
You can also view mounted filesystem information in the /etc/mtab file, which shows the current mount table used by the system:
cat /etc/mtab
This file contains similar information to the mount command but is sometimes more suited for scripts.
5. Conclusion
By following this tutorial, you have learned how to check mounted drives in Linux using the mount command. Understanding how to view and manage mounted filesystems is essential for effective system administration and troubleshooting. Continue to explore other filesystem commands to improve your Linux skills!
