Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can mount a share with this command:

sudo mount -o username=user,password=pass // /mnt/share

And in my fstab I have this line:

// /mnt/share cifs credentials=/path/to/credentials 0 0

and mount -a won't mount it. I have tried this with samba installed but currently it isn't. Same error:

mount: wrong fs type, bad option, bad superblock on //
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail  or so

I have also tried with nfs to no avail.

My question is, if I can't get it working with samba is there a way to do it in fstab without a <type> like cifs?

Any help is appreciated, either in the direction of fixing the samba issue or not using it and mounting via fstab without it.

EDIT - So although strangeman didn't give me the exact answer I was looking for, I am more than happy because the fstab is actually working now. But why doesn't the credentials=/path/to/credential_file work? Is there something weird with this option in fstab that I don't know about? I guess I could ask a new question too. Thanks for any help.

share|improve this question
up vote 2 down vote accepted

You need add "-o username=user,password=pass"

//  /mnt/dir  cifs  noauto,noperm,guest,iocharset=utf8  0   0


//  /mnt/dir  cifs  noauto,noperm,username=user,password=pass,iocharset=utf8  0   0
share|improve this answer
That's already in my credentials file (see above). Plus, I also tried that and it gave the same error. – nicorellius Jan 25 '12 at 0:56
Hm... What say "dmesg | tail"? – strangeman Jan 25 '12 at 0:59
[178319.972284] CIFS VFS: cifs_mount failed w/return code = -13 – nicorellius Feb 10 '12 at 21:41
So your method worked. Not sure why it didn't before, but after some restarts and rewriting lines, it's working. Thanks. Now to get the credentials file to work ;--) – nicorellius Feb 10 '12 at 21:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.