mount: command not found

mount: command not found

The mount command loads a file system to a specified directory so that it can be accessible to users and applications. You must specify the device to mount as well as the desired mount point.

Syntax

The syntax of the mount command is:

# mount [options] {device name} {mount point}

mount Options

You can specify various mount options for a file system. These options are typically included in the fstab file rather than as command-line arguments.

Option Used To
auto Specify that the device has to be mounted automatically.
noauto Specify that the device should not be mounted automatically
nouser Specify that only the root user can mount a device or a file system.
user Specify that all users can mount a device or a file system.
exec Allow binaries in a file system to be executed.
noexec Prevent binaries in a file system from being executed.
ro Mount a file system as read-only.
rw Mount a file system with read and write permissions.
sync Specify that input and output operations in a file system should be done synchronously.
async Specify that input and output operations in a file system should be done asynchronously.

If you encounter below error while running the mount command:

mount: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
OS X brew install plan9port
Debian apt-get install mount
Ubuntu apt-get install mount
Arch Linux pacman -S plan9port
Kali Linux apt-get install mount
CentOS yum install util-linux-ng
Fedora dnf install singularity
Raspbian apt-get install mount

Mount Command Examples

1. To mount a file system:

# mount /dev/sda /support 

2. To specify the file system type:

# mount -t nfs 192.168.100.22:/home /home 

3. To mount all the file systems from “/etc/fstab”:

# mount -a 

4. To do the fake mounting:

# mount -f /dev/sda /support
# mount --fake /dev/sda /support 

5. To add the labels to the mount points;

# mount -l mymount /support ***** 

6. To mount without writting into “/etc/mnttab”:

# mount -n /dev/sda /support
# mount --no-mtab /dev/sda /support 

7. To avoid canonicalize paths:

# mount --no-canonicalize /dev/sdb /support 

8. To ignore ignore mount options not supported by file system type:

# mount -s /dev/sdb /support 

9. To mount a file system as read only:

# mount -r /dev/sdb /support
# mount --read-only /dev/sdb /support 

10. To Mount the filesystem read/write:

# mount -w /dev/sdb /support
# mount --rw /dev/sdb /support 

11. To mount the file system of specified label:

# mount -L mymount 

12. To mount the partition that has the specified uuid:

# mount -U uuid  

13. To mount the file system with specified options:

# mount -o noatime,nouser /dev/sdb /support
# mount --options noatime,nouser /dev/sdb /support 

14. To get the help:

# mount -h 

15. To get the version info:

# mount -V 

Notes

By default, the mount command displays a list of media devices currently mounted on the system. However, the newer version of the kernel mounts lots of virtual filesystems for management purposes, besides your standard storage devices. This can make the default output of the mount command very cluttered and confusing. If you know the filesystem type used for your drive partitions, you can filter that out using

$ mount -t ext4

The mount command provides four pieces of information:

  • The device filename of the media
  • The mount point in the virtual directory where the media is mounted
  • The filesystem type
  • The access status of the mounted media
Related Post