How to Fix “mount point does not exist” Error When Mounting CIFS/SMB Shares in Linux


2 views

When attempting to mount Windows shares on Linux servers using CIFS/SMB, one common error that sysadmins encounter is:

mount error: mount point /mnt/ntserver does not exist

This occurs specifically when the target directory for mounting doesn't exist in the filesystem. While the mounting command syntax appears correct, the underlying issue is more fundamental.

In Linux systems, a mount point must be:

  • An existing directory
  • Accessible to the user executing the mount command
  • Not currently in use by another mounted filesystem

The error message clearly indicates that the directory /mnt/ntserver hasn't been created prior to the mount operation.

Here's the complete corrected procedure:

# First create the mount point directory
sudo mkdir -p /mnt/ntserver

# Then execute the mount command with proper permissions
sudo mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver

For production environments, consider these enhanced approaches:

# Create mount point with proper permissions
sudo mkdir -p /mnt/ntserver
sudo chmod 755 /mnt/ntserver

# Mount with more secure credentials option
sudo mount -t cifs //ntserver/download -o credentials=/etc/cifs-credentials.file,uid=1000,gid=1000 /mnt/ntserver

Where /etc/cifs-credentials.file contains:

username=vivek
password=myPassword
domain=WORKGROUP

For persistent mounts across reboots, add to /etc/fstab:

//ntserver/download  /mnt/ntserver  cifs  credentials=/etc/cifs-credentials.file,uid=1000,gid=1000  0  0

If issues persist:

  • Verify directory creation with ls -ld /mnt/ntserver
  • Check filesystem permissions on the mount point
  • Test basic CIFS connectivity with smbclient -L //ntserver -U vivek

When attempting to mount a Windows SMB share on Linux servers using the command:

mount -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver

Most servers work fine, but two particular systems throw the error:

mount error: mount point /mnt/ntserver does not exist

A mount point in Linux must be an existing directory before you can mount any filesystem to it. The error occurs when:

  • The directory path doesn't exist
  • You lack permissions to access the directory
  • There's a typo in the path
  • The parent directory has restrictive permissions

First check if the directory exists:

ls -ld /mnt/ntserver

If it doesn't exist, create it with:

sudo mkdir -p /mnt/ntserver

The -p flag creates parent directories if needed.

Even if the directory exists, permission issues might prevent mounting:

sudo chown $USER:$USER /mnt/ntserver
sudo chmod 755 /mnt/ntserver

If you're using systemd, consider creating an automount unit:

[Unit]
Description=Automount Windows Share
After=network.target

[Mount]
What=//ntserver/download
Where=/mnt/ntserver
Options=username=vivek,password=myPassword,uid=1000,gid=1000
Type=cifs

[Install]
WantedBy=multi-user.target

For more verbose output during mounting:

sudo mount -v -t cifs //ntserver/download -o username=vivek,password=myPassword /mnt/ntserver

Check system logs for additional clues:

journalctl -xe
dmesg | tail -20

For persistent mounts, add to /etc/fstab:

//ntserver/download  /mnt/ntserver  cifs  username=vivek,password=myPassword,uid=1000,gid=1000  0  0

Then test with:

sudo mount -a