• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mountpoint: command not found

by Deepika

“mountpoint” is a command-line utility used in Linux and Unix-like systems to test if a directory is a mountpoint, i.e. if it is the location where a filesystem is mounted. A mountpoint is a directory on the file system where a storage device or a remote file system is mounted. When a storage device or a remote file system is mounted, its files and directories are made available at the mountpoint, and can be accessed just like any other files and directories on the file system.

The “mountpoint” command is used to test if a directory is a mountpoint by checking if it is the root of a mounted file system. If the directory is a mountpoint, the “mountpoint” command returns an exit status of 0, and returns an exit status of non-zero otherwise.

For example, you can use the “mountpoint” command to test if the directory “/mnt/data” is a mountpoint, by running the following command:

# mountpoint /mnt/data

If “/mnt/data” is a mountpoint, the command will return an exit status of 0, and you can access the files and directories of the mounted file system at “/mnt/data”. If “/mnt/data” is not a mountpoint, the command will return an exit status of non-zero, and you will not be able to access the files and directories of a mounted file system at “/mnt/data”.

The “mountpoint” command is useful for shell scripts and other programs that need to determine if a directory is a mountpoint, and to take appropriate actions based on this information.

If you encounter the below error while running the command mountpoint:

mountpoint: command not found

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

Distribution Command
Debian apt-get install util-linux
Ubuntu apt-get install util-linux
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install util-linux
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install util-linux

mountpoint Command Examples

1. Check if a directory is a mountpoint:

# mountpoint path/to/directory

2. Check if a directory is a mountpoint without showing any output:

# mountpoint -q path/to/directory

3. Show major/minor numbers of a mountpoint’s filesystem:

# mountpoint --fs-devno path/to/directory

Filed Under: Linux

Some more articles you might also be interested in …

  1. light: command not found
  2. How to make CentOS/RHEL 7 FIPS 140-2 compliant
  3. How to install packages using dnf in CentOS/RHEL 8
  4. Image optimization with webp
  5. CentOS / RHEL : How to migrate storage (LVM) with pvmove Command
  6. PAM password complexity and pam_cracklib credit system in CentOS/RHEL
  7. CentOS / RHEL : How to change password hashing algorithm
  8. How to Clone Linux disk partition over network using dd
  9. faillock: command not found
  10. btrfs rescue Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright