Mounting CIFS shares in fstab

Issues related to applications and software problems and general support
Post Reply
ek123
Posts: 15
Joined: 2019/10/22 15:25:54

Mounting CIFS shares in fstab

Post by ek123 » 2019/11/04 20:15:13

I've got 2 boxes running centos8, one providing samba shares to local network. These shares are accessible from windows machines without password prompting. Also, I can mount them without issue using the following syntax and I am not prompted for a password.

mount.cifs //ipaddress/share /mnt/share -o guest

However, when I attempt to mount through fstab I am unable to get the share connected; either I am prompted for password and hit enter to move on (that will work) or I am not prompted and the mount fails with

mount error(115): Operation now in progress
Refer to mount.cifs(8) manual page.

I have been digging around trying to find an option to make this work and I am stuck. Any ideas would be appreciated.

These are the 3 entries in my fstab as I've been tweaking and attempting other solutions which all behave similarly.

[stor]
path = /mnt/stor1
writable = yes
browsable = yes
guest ok = yes
guest only = no
create mode = 0777
directory mode = 0777

[stor2]
path = /mnt/stor2
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777

[stor3]
path = /mnt/stor3
writable = yes
browsable = yes
read only = no
guest ok = yes

Thanks in advance

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Mounting CIFS shares in fstab

Post by TrevorH » 2019/11/04 20:18:20

Show us the fstab entry.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ek123
Posts: 15
Joined: 2019/10/22 15:25:54

Re: Mounting CIFS shares in fstab

Post by ek123 » 2019/11/04 22:07:51

Love when you mess around with something for so long that you typo something simple and are blind to it until you go back later. I got it figure out, I had a misplaced \ in the share path. smh :roll:

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Mounting CIFS shares in fstab

Post by TrevorH » 2019/11/04 22:21:00

Using mount -a to mount it after adding it to fstab is usually a good way to tell as you get to see the error messages.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: Mounting CIFS shares in fstab

Post by BShT » 2019/11/05 12:20:02

try credentials=/etc/smbcredentials in fstab then

# cat /etc/smbcredentials
username=youruser
password=yourpass

ek123
Posts: 15
Joined: 2019/10/22 15:25:54

Re: Mounting CIFS shares in fstab

Post by ek123 » 2019/11/05 14:39:43

Well, I thought it was corrected with the path change and was able to mount everything but after a restart I'm seeing the error again.

fstab entries (I've tried many variations on these, but these are current)
//192.168.254.25/plex /mnt/plex/storage cifs vers=1.0,user=guest,password= 0 0
//192.168.254.25/plex2 /mnt/plex/storage2 cifs user=guest,password= 0 0

Error seen upon mount attempt
mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

dmesg
[ 1010.144200] CIFS VFS: Error connecting to socket. Aborting operation.
[ 1010.144210] CIFS VFS: cifs_mount failed w/return code = -115
[ 1010.146774] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
[ 1020.383355] CIFS VFS: Error connecting to socket. Aborting operation.
[ 1020.383366] CIFS VFS: cifs_mount failed w/return code = -115

I added vers=1.0 to the first entry based off of the dmesg output but I'm still seeing both fail to mount. I've read specifying the version should help, but didn't have any luck with that so far but I'm probably just missing something.

I've not tried to use a credentials file, attempting to use these as anonymous shares. Should I need the credentials file?

**update**
$ sudo mount -t cifs -o username=guest,password= //192.168.254.25/plex /mnt/plex/storage
mount error(115): Operation now in progress
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
$ smbclient -L 192.168.254.25
Connection to 192.168.254.25 failed (Error NT_STATUS_IO_TIMEOUT)

smb.conf
[global]
workgroup = ELYSIUM
security = user
log level = 1
passdb backend = tdbsam

printing = cups
printcap name = cups
load printers = yes
cups options = raw

unix charset = UTF-8
dos charset = CP932
map to guest = Bad User
username map = /etc/samba/smbusers
guest account = nobody

[plex]
path = /mnt/plex-storage
writable = yes
browsable = yes
guest ok = yes
guest only = no
create mode = 0777
directory mode = 0777

[plex2]
path = /mnt/plex-storage2
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777

ek123
Posts: 15
Joined: 2019/10/22 15:25:54

Re: Mounting CIFS shares in fstab

Post by ek123 » 2019/11/05 15:22:51

Update, again.

Looking into the -115 error pointed to connection issue, I was using IP and connection between servers looked good. Can connect to shares via "Other Locations" smb option in file browser.

What I did as a test was disable firewalld and then could connect to the share with either of the following
$ sudo mount /mnt/plex/storage
or
$ sudo mount -t cifs -o username=guest,password=,vers=3.0 //192.168.254.25/plex /mnt/plex/storage

So, firewall is not allowing access to SMB shares through mounting but I can access through smb in file browser? Can someone explain this, or is it coincidental that this is working right now?

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Mounting CIFS shares in fstab

Post by TrevorH » 2019/11/05 17:48:41

Perhaps it's just trying to access the network before it's available. Did you post that fstab entry yet?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

ek123
Posts: 15
Joined: 2019/10/22 15:25:54

Re: Mounting CIFS shares in fstab

Post by ek123 » 2019/11/05 21:10:44

I think I might have it working now, after my last update I poked around the firewall settings a bit and I often have a VPN running - the changes I was trying to make on the firewall do not appear to be persisting after disconnect/reconnect of vpn. So, I can get the shares to connect and then after restart they fail again.

//192.168.254.25/plex /mnt/plex/storage cifs vers=3.0,user=guest,password= 0 0
//192.168.254.25/plex2 /mnt/plex/storage2 cifs vers=3.0,user=guest,password= 0 0

I'll update once I get to looking further into the firewall bit.

Post Reply