• 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

umount: command not found

by admin

umount is the opposite of mount: it makes a disk partition unavailable. For instance, if you’ve mounted a CD-ROM disc, you can’t eject it until it’s umounted:

$ umount /mnt/cdrom

Always unmount removable media before ejecting it or you risk damage to its filesystem. To unmount all mounted devices:

# umount -a

Don’t unmount a filesystem that’s in use; in fact, the umount command will refuse to do so for safety reasons.

umount Command Options

Option Description
-a Unmounts all filesystems listed in fstab or Open Directory.
-A Unmounts all currently mounted filesystems, other than the root.
-f Attempts to force the unmount.
-h Unmounts all filesystems currently mounted from the specified server.
-t Restricts the use of the command to filesystems of the specified types presented in a comma-separated list, which may include hfs, ufs, afp, nfs, or others.
-v Enables verbose output.
mount_point The directory on which the filesystem is mounted.

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

umount: command not found

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

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

umount Command Examples

1. Unmount a filesystem, by passing the path to the source it is mounted from:

# umount path/to/device_file

2. Unmount a filesystem, by passing the path to the target where it is mounted:

# umount path/to/mounted_directory

3. Unmount all mounted filesystems (except the `proc` filesystem):

# umount -a

4. If you do not want to kill processes holding open files, try lazy unmounts:

# umount -l /mnt/export

Conclusion

umount command unmounts filesystem specified by directory. You may also specify the filesystem by device name. umount announces to the system that the removable file structure previously mounted on the specified directory is to be removed. Any pending I/O for the filesystem is completed, and the file structure is flagged as clean. A busy filesystem cannot be unmounted.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Make User Account Read-Only in CentOS/RHEL 7
  2. nsnake: command not found
  3. How to Configure a Fiber-Channel Over Ethernet (FCoE) Interface in CentOS/RHEL
  4. dget: command not found
  5. “shutdown” Command Examples in Linux
  6. aa-enforce: command not found
  7. pacman –database Command Examples in Arch Linux
  8. Maintaining Linux filesystems using “fsck” and “tune2fs”
  9. id: command not found
  10. namcap: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright