Master the mount command: Linux 101
The mount command is one of the most critical commands for Linux beginners to learn, and once you get the hang of it, you’ll see that it’s super simple and straightforward. The mount command lets you attach file systems to places in your computer’s filesystem tree. This allows you to access them from the terminal and navigate through them as though they were folders in your hard drive. Use this guide on the mount command and Linux 101 to master this useful system-administration tool.
Things to Know About the mount Command
#1) The mount command’s main function is to make a file accessible from a directory on another device. #2) You can use it to make your smartphone accessible from your computer, or you can use it to make a CD accessible from your hard drive. #3) It requires two arguments, one for the source and one for the destination. #4) The mount tool allows you to fuse two devices together so that they appear as one system. For example, if you have an external USB flash drive, then it appears in the ‘Devices’ folder of your computer. If you want to see its contents just like they were any other part of your file system, then all you need to do is plug it into a USB port and run this command: mount -t vfat /dev/sdc1 /mnt.
The Basic Syntax
mount -t type device directory
-t type specifies what type of device you want to access. For example, if you wanted to access a USB drive, you would specify vfat.
-s specifies which file system to use and is interchangeable with -t. In most cases, it will not matter which option you choose. If there are specific requirements for your situation, consult the manual page for more information on how to use these options in combination. For example, if you need to automatically remount an NTFS filesystem during boot time, use this syntax: mount -t ntfs-3g umsdos /dev/hdb1 /mnt. Consult your operating system documentation for more details.
The Mount Command’s Location in UNIX-Based Systems
The mount command is located in the /sbin directory, which means it should be available to you on most UNIX-based systems. You can verify this by typing which mount into your terminal window and hitting enter. A long list of directories will appear, one of them will likely have a path similar to /sbin:/usr/local/sbin:/usr/local/share/man. If yours has a path that ends with mount (or another word), then you have found the mount command! We now know where the mount command is and how we use it. Let’s continue exploring what mount does. Mounting Volumes: The first thing the mount command does when you type it into your terminal window is check for any new or currently mounted volumes. When you do so, a list of all mounted volumes will appear in your screen. Type mount without any arguments if you want to see only those volumes that are currently mounted and not those which are not currently mounted.
How to Determine Whether your File System Type Supports Auto-Mount
The first step is to determine what type of file system you are using. The easiest way to do this is by looking at the output of mount without any flags. This will tell you what filesystem your device supports and if it supports auto-mounting. For example, if you are using an ext4 filesystem, then it should support auto-mounting. If it does not support auto-mounting, then there will be a message that says noauto. In this case, it’s up to you whether or not you want to enable auto-mounting on your computer.
Once you have determined that your filesystem supports auto-mounting.