Mounting CIFS shares in fstab
Mounting CIFS shares in fstab
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
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
Re: Mounting CIFS shares in fstab
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
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
Re: Mounting CIFS shares in fstab
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
Re: Mounting CIFS shares in fstab
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
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
Re: Mounting CIFS shares in fstab
try credentials=/etc/smbcredentials in fstab then
# cat /etc/smbcredentials
username=youruser
password=yourpass
# cat /etc/smbcredentials
username=youruser
password=yourpass
Re: Mounting CIFS shares in fstab
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
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
Re: Mounting CIFS shares in fstab
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?
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?
Re: Mounting CIFS shares in fstab
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
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
Re: Mounting CIFS shares in fstab
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.
//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.