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 //192.168.1.134/share_name /mnt/share_nameWith 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:
//192.168.1.134/share_name /mnt/share_name cifs default 0 0This is where the question comes in. Where I have default, should there be something instead, indicating username=admin, etc?
2 Answers
You should have something along the lines of:
//192.168.1.134/share_name /mnt/share_name cifs username=server_user,password=server_password,_netdev 0 0
^ Path to your share ^ Mountpoint ^ Username ^ Password ^ See note ANote A:
The _netdev options makes sure the mount is only attempted AFTER a network connection has been established.
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:
//192.168.1.134/share_name /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.
1