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 am not real familiar with fstab yet, so I have a couple questions. When I use this command to mount devices:

sudo mount -t cifs -o username=admin // /mnt/share_name

With passwords: sudo="local user password" password="password for device"

How do I translate that into an fstab entry? So far, I have tried this in the fstab and mounting fails:

//  /mnt/share_name  cifs  default  0  0

This is where the question comes in. Where I have default, should there be something instead, indicating username=admin, etc?

share|improve this question
up vote 5 down vote accepted

You should have something along the lines of:

// /mnt/share_name cifs username=server_user,password=server_password,_netdev 0 0
^ Path to your share       ^ Mountpoint                  ^ Username           ^ Password      ^ See note A

Note A:
The _netdev options makes sure the mount is only attempted AFTER a network connection has been established.

share|improve this answer
cool, trying now - what is the _netdev piece? – nicorellius Dec 28 '10 at 17:42
@nocerellios see Note A in my answer. – BloodPhilia Dec 28 '10 at 18:04
+1 for mentioning the _netdev option; it's very important for automatically mounting network drives. – Zaz Dec 28 '10 at 18:04

The ordering of an FSTab file is: device name mount point fs-type options dump-freq pass-num; each item separated by whitespace.

For the example you gave, the FSTab entry would be:

// /mnt/share_name cifs username=admin,password=? 0 0

(obviously replacing ? with the correct password)

If you want to learn more about FSTab, check out the FSTab Wikipedia article.

share|improve this answer
Extra options can then be added such as the _netdev option suggested by BloodPhilia. – Zaz Dec 28 '10 at 18:03

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.