Filesystem Management

Unmount a filesystem

Price range: €15.11 through €19.85

Command:

bash
sudo umount /path/to/mount_point

Explanation:

  • sudo: Runs the command with superuser privileges, as unmounting a filesystem typically requires root access.
  • umount: The command used to unmount a filesystem from a mount point.
  • /path/to/mount_point: The directory where the filesystem is currently mounted. Replace this with the actual path of the mount point you wish to unmount (e.g., /mnt/data/media/usb).

Example:

To unmount the filesystem that is mounted at /mnt/data, you would use the following command:

bash
sudo umount /mnt/data

Result:

This command will unmount the filesystem from /mnt/data, making the data no longer accessible at that location until it is mounted again.


Additional Notes:

  • If the mount point is in use (e.g., a file within the filesystem is open or in use), you may receive a “device is busy” error. In such cases, you can use the lsof or fuser commands to check which processes are using the mount point:
    bash
    lsof /mnt/data

    or

    bash
    fuser -m /mnt/data
  • To force the unmounting (use cautiously), you can add the -f flag:
    bash
    sudo umount -f /mnt/data
Select options This product has multiple variants. The options may be chosen on the product page