Windows cifs share will not mount on startup

Description:

 

Hi All, I've got an issue that I know I must be overlooking the simple solution to.

I've setup a cifs share to mount to my RHEL 7.2 system using /etc/fstab, below is the entry in the fstab:

//192.168.20.10/Share /mnt/reportshare cifs vers=2.0,credentials=<custom credentials file path here> 0 0

I also added the following line to my /etc/samba/smb.conf file under the [global] sections:

min protocol = SMB2

When the system starts up I consistently get these two lines right at the end of my 'dmesg' output:

[ 32.220097] CIFS VFS: Error connecting to socket. Aborting operation.
[ 32.220320] CIFS VFS: cifs_mount failed w/return code = -115

when I try to troubleshoot with smbclient I get the following output to the listed command:

# smbclient //192.168.20.10/Share -U <username here>

OUTPUT:
protocol negotiation failed: NT_STATUS_CONNECTION_RESET

Finally, when I run "mount -a " as root after startup the Windows share mounts as expected from the /etc/fstab entry.

For the life of me I cannot find a reason why the share will not mount at startup. There has got to be something simple that I am overlooking - any help would be appreciated!

 

 

 

Ans 1: It may be that the mounts are done before the networking is up, maybe add _netdev to the mount options?

I did try that in earlier attempts but _netdev didn't change anything. I also found a few sources that claimed it only worked with nfs and doesn't help with cifs.

 

Ans 2:  have a look at adding noauto,x-systemd-automount to the fstab to convert it to an automount filesystem. The systemd-automount man page has a little bit of detail but a google search will probably be more useful.

That did it! I added noauto,x-systemd-automount to my fstab entry and the mount connected after bootup with no errors in the dmesg log! 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值