Mounting a smb share using fstab

Suppose I have a server at 10.1.1.5 with a samba share. In order to mount it automatically every time my machine boots up, I’ll need to have an entry in /etc/fstab:

//10.1.1.5/Volume_1 /mnt/box cifs credentials=/etc/cifspasswd 0 0

The credentials file contains:

username=leo
password=mypassword

The first time I ran mount -a, I got the following error:

root@server:~# mount -a
mount: wrong fs type, bad option, bad superblock on //box/Volume_1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

with dmesg showing:


CIFS VFS: No username specified
CIFS VFS: cifs_mount failed w/return code = -22

To resolve this, install cifs-utils

yum -y install cifs-utils

Leave a Reply

Your email address will not be published.