Fstab entry for cifs

Can anyone give me an fstab entry for using cifs?

I can mount from the command line but my fstab entry doesn't work.

//192.168.1.1/Share /mnt/Share cifs username=user,password=mypass 0 0
or possibly
//192.168.1.1/Share /mnt/Share cifs uid=0,gid=0,username=user,password=mypass 0 0

I haven't actually tried them on OpenWRT, but I figured it's better than getting no answer.

I tried adding a line to /etc/config/fstab

//192.168.2.247/Teratwo /mnt/Teratwo cifs user=###,password=###,uid=223,gid=223,forceuid,forcegid

But when I do "block mount" I get the error:

block: unable to load configuration (fstab: Parse error (invalid command) at line 9, byte 0)
block: no usable configuration

The manual mount command works fine:

mount -t cifs //192.168.2.247/Teratwo /mnt/Teratwo -o user=###,password=####,uid=$(id -u transmission),gid=$(id -g transmission)

The syntax for /etc/config/fstab is not the same as for /etc/fstab.

This will definitely not work in /etc/config/fstab! You must add this line to /etc/fstab.

2 Likes

Thanks. I removed that line from /etc/config/fstab and added it to /etc/fstab but it's still not showing up after I mount -a or block mount

Try this way:

Otherwise use /etc/rc.local.

1 Like

I put the mount command in /etc/rc.local. The link you have is a little too much for my expertise / desires. Thanks

Any error messages after these commands?

The mount command reads /etc/fstab (not /etc/config/fstab). For the syntax of /etc/fstab see man fstab.

The block command reads /etc/config/fstab (not /etc/fstab).

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.