No dialect specified on mount error, where to set vers=1.0 with autofs/Fedora 26, Drobo FS Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Come Celebrate our 10 Year Anniversary!Mount CIFS share with autofsHow to set permissions for a CIFS mount with autofs?mount error(13): Permission denied with windows shareHow do I mount a home catalog using cifs and autofs with Active Directory authentication on CentOS7?Mount Error 13 with Ubuntu 16.04 and Azure (Same Region)
Why didn't Eitri join the fight?
For a new assistant professor in CS, how to build/manage a publication pipeline
First console to have temporary backward compatibility
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
Is there such thing as an Availability Group failover trigger?
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
Do wooden building fires get hotter than 600°C?
Generate an RGB colour grid
Trademark violation for app?
8 Prisoners wearing hats
What's the meaning of "fortified infraction restraint"?
Maximum summed powersets with non-adjacent items
What is this building called? (It was built in 2002)
Crossing US/Canada Border for less than 24 hours
How do I make this wiring inside cabinet safer? (Pic)
How to down pick a chord with skipped strings?
An adverb for when you're not exaggerating
What do you call the main part of a joke?
Should I use a zero-interest credit card for a large one-time purchase?
Is there any way for the UK Prime Minister to make a motion directly dependent on Government confidence?
Amount of permutations on an NxNxN Rubik's Cube
Extracting terms with certain heads in a function
How to tell that you are a giant?
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
No dialect specified on mount error, where to set vers=1.0 with autofs/Fedora 26, Drobo FS
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Come Celebrate our 10 Year Anniversary!Mount CIFS share with autofsHow to set permissions for a CIFS mount with autofs?mount error(13): Permission denied with windows shareHow do I mount a home catalog using cifs and autofs with Active Directory authentication on CentOS7?Mount Error 13 with Ubuntu 16.04 and Azure (Same Region)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
We are using Fedora 26 with the 4.13.9 kernel and NIS, and I'm aware of the issue where the default CIFS/Samba version is now 3.0. However we use an older Drobo FS which their support says only works with SMB version 1.0. We do not put the Drobo in /etc/fstab
as it will fail on boot some times so we use autofs/automount. We have a cron job that runs and should be calling /etc/auto.cifs
and note the contents of the config files below. I added vers=1.0
every where I could think of. The below results of the ypcat -k
command shows the option does not appear to be passed to the mount
command. Am I missing a config file some where? I've grepped all of /etc
to find all occurrences of mount
or CIFS but nothing except comments come back. Perhaps I'm missing something that isn't obvious to me but might be for someone reading this...
cat /etc/auto.cifs
#!/bin/bash
# Automount config file for drobo network storage device
#
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
# which requires password authentification. The file should contain
# exactly two lines:
# username=user
# password=*****
# Please don't use blank spaces to separate the equal sign from the
# user account name or password.
credfile="/etc/auto.smb.$key"
# Note: Use cifs instead of smbfs:
mountopts="-fstype=cifs,vers=1.0,file_mode=0600,dir_mode=0700,uid=root,gid=root,wsize=8192"
smbclientopts="-m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
mountopts=$mountopts"vers=1.0,credentials=$credfile"
smbclientopts="-A "$credfile
else
smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log
| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
BEGIN ORS=""; first=1
/Disk/ if (first) print opts; first=0 ;
gsub(/ /, "\ ", $2);
sub(/$/, "\$", $2);
print " \nt /" $2, "://" key "/" $2
END if (!first) print "n"; else exit 1
'
And here's:
cat /etc/auto.smb
#!/bin/bash
# This file must be executable to work! chmod 755!
# Automagically mount CIFS shares in the network, similar to
# what autofs -hosts does for NFS.
# Put a line like the following in /etc/auto.master:
# /cifs /etc/auto.smb --timeout=300
# You'll be able to access Windows and Samba shares in your network
# under /cifs/host.domain/share
# "smbclient -L" is used to obtain a list of shares from the given host.
# In some environments, this requires valid credentials.
# This script knows 2 methods to obtain credentials:
# 1) if a credentials file (see mount.cifs(8)) is present
# under /etc/creds/$key, use it.
# 2) Otherwise, try to find a usable kerberos credentials cache
# for the uid of the user that was first to trigger the mount
# and use that.
# If both methods fail, the script will try to obtain the list
# of shares anonymously.
get_krb5_cache()
cache=
uid=$UID
for x in $(ls -d /run/user/$uid/krb5cc_* 2>/dev/null); do
if [ -d "$x" ] && klist -s DIR:"$x"; then
cache=DIR:$x
return
fi
done
if [ -f /tmp/krb5cc_$uid ] && klist -s /tmp/krb5cc_$uid; then
cache=/tmp/krb5cc_$uid
return
fi
key="$1"
opts="-fstype=cifs -m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
creds=/etc/creds/$key
if [ -f "$creds" ]; then
opts="$opts"',vers=1.0,uid=$UID,gid=$GID,credentials='"$creds"
smbopts="-A $creds"
else
get_krb5_cache
if [ -n "$cache" ]; then
opts="$opts"',vers=1.0,multiuser,cruid=$UID,sec=krb5i'
smbopts="-k"
export KRB5CCNAME=$cache
else
opts="$opts"',vers=1.0,guest'
smbopts="-N"
fi
fi
$SMBCLIENT $smbopts -gL "$key" 2>/dev/null| awk -v "key=$key" -v "opts=$opts" -F '|' -- '
BEGIN ORS=""; first=1
/Disk/
if (first)
print opts; first=0
dir = $2
loc = $2
# Enclose mount dir and location in quotes
# Double quote "$" in location as it is special
gsub(/$$/, "\$", loc);
gsub(/&/,"\\&",loc)
print " \nt "/" dir """, ""://" key "/" loc """
END if (!first) print "n"; else exit 1
'
However when running:
ypcat -k auto.cifs
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
[ -x $SMBCLIENT ] || exit 1
credfile="/etc/auto.smb.$key"
do
done
else
fi
for P in /bin /sbin /usr/bin /usr/sbin
if [ -e "$credfile" ]
key="$1"
mountopts="fstype=cifs,file_mode=0600,dir_mode=0700,uid=root,gid=root"
smbclientopts=""
then
Here are some debug autofs logs:
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 508, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: attempting to mount entry /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): looking up drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): drobo-down -> -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): dequote("://drobo-up/drobo-down") -> ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up, loc=://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: sun_mount: parse(sun): mounting root /drobo-up, mountpoint drobo-down, what //drobo-up/drobo-down, fstype cifs, options rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: do_mount: //drobo-up/drobo-down /drobo-up/drobo-down type cifs options rw,user,suid,credentials=/etc/auto.smb.drobo-up using module generic
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mkdir_path /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mount -t cifs -o rw,user,suid,credentials=/etc/auto.smb.drobo-up //drobo-up/drobo-down /drobo-up/drobo-down
Oct 31 16:12:20 workstation kernel: 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.
Oct 31 16:12:20 workstation automount[5234]: >> mount error(112): Host is down
Oct 31 16:12:20 workstation automount[5234]: >> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Oct 31 16:12:20 workstation kernel: CIFS VFS: cifs_mount failed w/return code = -112
Oct 31 16:12:20 workstation automount[5234]: mount(generic): failed to mount //drobo-up/drobo-down (type cifs) on /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 508
Oct 31 16:12:20 workstation automount[5234]: failed to mount /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 509, name drobo-down, request pid 10182
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 509
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 510, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 510
adding fstab contents:
cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Aug 16 10:22:50 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
# /dev/mapper/vg_server-LogVol00 / ext4 defaults 1 1 UUID=01bbe54b-06d4-4537-aa87-9c9618996000 /boot ext4 defaults 1 2 /dev/mapper/vg_server-LogVol02 /home ext4 defaults 1 2 /dev/mapper/vg_server-LogVol03 /usr/local ext4 defaults 1 2 /dev/mapper/vg_server-LogVol01 swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
samba cifs
add a comment |
We are using Fedora 26 with the 4.13.9 kernel and NIS, and I'm aware of the issue where the default CIFS/Samba version is now 3.0. However we use an older Drobo FS which their support says only works with SMB version 1.0. We do not put the Drobo in /etc/fstab
as it will fail on boot some times so we use autofs/automount. We have a cron job that runs and should be calling /etc/auto.cifs
and note the contents of the config files below. I added vers=1.0
every where I could think of. The below results of the ypcat -k
command shows the option does not appear to be passed to the mount
command. Am I missing a config file some where? I've grepped all of /etc
to find all occurrences of mount
or CIFS but nothing except comments come back. Perhaps I'm missing something that isn't obvious to me but might be for someone reading this...
cat /etc/auto.cifs
#!/bin/bash
# Automount config file for drobo network storage device
#
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
# which requires password authentification. The file should contain
# exactly two lines:
# username=user
# password=*****
# Please don't use blank spaces to separate the equal sign from the
# user account name or password.
credfile="/etc/auto.smb.$key"
# Note: Use cifs instead of smbfs:
mountopts="-fstype=cifs,vers=1.0,file_mode=0600,dir_mode=0700,uid=root,gid=root,wsize=8192"
smbclientopts="-m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
mountopts=$mountopts"vers=1.0,credentials=$credfile"
smbclientopts="-A "$credfile
else
smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log
| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
BEGIN ORS=""; first=1
/Disk/ if (first) print opts; first=0 ;
gsub(/ /, "\ ", $2);
sub(/$/, "\$", $2);
print " \nt /" $2, "://" key "/" $2
END if (!first) print "n"; else exit 1
'
And here's:
cat /etc/auto.smb
#!/bin/bash
# This file must be executable to work! chmod 755!
# Automagically mount CIFS shares in the network, similar to
# what autofs -hosts does for NFS.
# Put a line like the following in /etc/auto.master:
# /cifs /etc/auto.smb --timeout=300
# You'll be able to access Windows and Samba shares in your network
# under /cifs/host.domain/share
# "smbclient -L" is used to obtain a list of shares from the given host.
# In some environments, this requires valid credentials.
# This script knows 2 methods to obtain credentials:
# 1) if a credentials file (see mount.cifs(8)) is present
# under /etc/creds/$key, use it.
# 2) Otherwise, try to find a usable kerberos credentials cache
# for the uid of the user that was first to trigger the mount
# and use that.
# If both methods fail, the script will try to obtain the list
# of shares anonymously.
get_krb5_cache()
cache=
uid=$UID
for x in $(ls -d /run/user/$uid/krb5cc_* 2>/dev/null); do
if [ -d "$x" ] && klist -s DIR:"$x"; then
cache=DIR:$x
return
fi
done
if [ -f /tmp/krb5cc_$uid ] && klist -s /tmp/krb5cc_$uid; then
cache=/tmp/krb5cc_$uid
return
fi
key="$1"
opts="-fstype=cifs -m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
creds=/etc/creds/$key
if [ -f "$creds" ]; then
opts="$opts"',vers=1.0,uid=$UID,gid=$GID,credentials='"$creds"
smbopts="-A $creds"
else
get_krb5_cache
if [ -n "$cache" ]; then
opts="$opts"',vers=1.0,multiuser,cruid=$UID,sec=krb5i'
smbopts="-k"
export KRB5CCNAME=$cache
else
opts="$opts"',vers=1.0,guest'
smbopts="-N"
fi
fi
$SMBCLIENT $smbopts -gL "$key" 2>/dev/null| awk -v "key=$key" -v "opts=$opts" -F '|' -- '
BEGIN ORS=""; first=1
/Disk/
if (first)
print opts; first=0
dir = $2
loc = $2
# Enclose mount dir and location in quotes
# Double quote "$" in location as it is special
gsub(/$$/, "\$", loc);
gsub(/&/,"\\&",loc)
print " \nt "/" dir """, ""://" key "/" loc """
END if (!first) print "n"; else exit 1
'
However when running:
ypcat -k auto.cifs
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
[ -x $SMBCLIENT ] || exit 1
credfile="/etc/auto.smb.$key"
do
done
else
fi
for P in /bin /sbin /usr/bin /usr/sbin
if [ -e "$credfile" ]
key="$1"
mountopts="fstype=cifs,file_mode=0600,dir_mode=0700,uid=root,gid=root"
smbclientopts=""
then
Here are some debug autofs logs:
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 508, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: attempting to mount entry /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): looking up drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): drobo-down -> -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): dequote("://drobo-up/drobo-down") -> ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up, loc=://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: sun_mount: parse(sun): mounting root /drobo-up, mountpoint drobo-down, what //drobo-up/drobo-down, fstype cifs, options rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: do_mount: //drobo-up/drobo-down /drobo-up/drobo-down type cifs options rw,user,suid,credentials=/etc/auto.smb.drobo-up using module generic
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mkdir_path /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mount -t cifs -o rw,user,suid,credentials=/etc/auto.smb.drobo-up //drobo-up/drobo-down /drobo-up/drobo-down
Oct 31 16:12:20 workstation kernel: 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.
Oct 31 16:12:20 workstation automount[5234]: >> mount error(112): Host is down
Oct 31 16:12:20 workstation automount[5234]: >> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Oct 31 16:12:20 workstation kernel: CIFS VFS: cifs_mount failed w/return code = -112
Oct 31 16:12:20 workstation automount[5234]: mount(generic): failed to mount //drobo-up/drobo-down (type cifs) on /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 508
Oct 31 16:12:20 workstation automount[5234]: failed to mount /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 509, name drobo-down, request pid 10182
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 509
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 510, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 510
adding fstab contents:
cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Aug 16 10:22:50 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
# /dev/mapper/vg_server-LogVol00 / ext4 defaults 1 1 UUID=01bbe54b-06d4-4537-aa87-9c9618996000 /boot ext4 defaults 1 2 /dev/mapper/vg_server-LogVol02 /home ext4 defaults 1 2 /dev/mapper/vg_server-LogVol03 /usr/local ext4 defaults 1 2 /dev/mapper/vg_server-LogVol01 swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
samba cifs
add a comment |
We are using Fedora 26 with the 4.13.9 kernel and NIS, and I'm aware of the issue where the default CIFS/Samba version is now 3.0. However we use an older Drobo FS which their support says only works with SMB version 1.0. We do not put the Drobo in /etc/fstab
as it will fail on boot some times so we use autofs/automount. We have a cron job that runs and should be calling /etc/auto.cifs
and note the contents of the config files below. I added vers=1.0
every where I could think of. The below results of the ypcat -k
command shows the option does not appear to be passed to the mount
command. Am I missing a config file some where? I've grepped all of /etc
to find all occurrences of mount
or CIFS but nothing except comments come back. Perhaps I'm missing something that isn't obvious to me but might be for someone reading this...
cat /etc/auto.cifs
#!/bin/bash
# Automount config file for drobo network storage device
#
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
# which requires password authentification. The file should contain
# exactly two lines:
# username=user
# password=*****
# Please don't use blank spaces to separate the equal sign from the
# user account name or password.
credfile="/etc/auto.smb.$key"
# Note: Use cifs instead of smbfs:
mountopts="-fstype=cifs,vers=1.0,file_mode=0600,dir_mode=0700,uid=root,gid=root,wsize=8192"
smbclientopts="-m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
mountopts=$mountopts"vers=1.0,credentials=$credfile"
smbclientopts="-A "$credfile
else
smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log
| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
BEGIN ORS=""; first=1
/Disk/ if (first) print opts; first=0 ;
gsub(/ /, "\ ", $2);
sub(/$/, "\$", $2);
print " \nt /" $2, "://" key "/" $2
END if (!first) print "n"; else exit 1
'
And here's:
cat /etc/auto.smb
#!/bin/bash
# This file must be executable to work! chmod 755!
# Automagically mount CIFS shares in the network, similar to
# what autofs -hosts does for NFS.
# Put a line like the following in /etc/auto.master:
# /cifs /etc/auto.smb --timeout=300
# You'll be able to access Windows and Samba shares in your network
# under /cifs/host.domain/share
# "smbclient -L" is used to obtain a list of shares from the given host.
# In some environments, this requires valid credentials.
# This script knows 2 methods to obtain credentials:
# 1) if a credentials file (see mount.cifs(8)) is present
# under /etc/creds/$key, use it.
# 2) Otherwise, try to find a usable kerberos credentials cache
# for the uid of the user that was first to trigger the mount
# and use that.
# If both methods fail, the script will try to obtain the list
# of shares anonymously.
get_krb5_cache()
cache=
uid=$UID
for x in $(ls -d /run/user/$uid/krb5cc_* 2>/dev/null); do
if [ -d "$x" ] && klist -s DIR:"$x"; then
cache=DIR:$x
return
fi
done
if [ -f /tmp/krb5cc_$uid ] && klist -s /tmp/krb5cc_$uid; then
cache=/tmp/krb5cc_$uid
return
fi
key="$1"
opts="-fstype=cifs -m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
creds=/etc/creds/$key
if [ -f "$creds" ]; then
opts="$opts"',vers=1.0,uid=$UID,gid=$GID,credentials='"$creds"
smbopts="-A $creds"
else
get_krb5_cache
if [ -n "$cache" ]; then
opts="$opts"',vers=1.0,multiuser,cruid=$UID,sec=krb5i'
smbopts="-k"
export KRB5CCNAME=$cache
else
opts="$opts"',vers=1.0,guest'
smbopts="-N"
fi
fi
$SMBCLIENT $smbopts -gL "$key" 2>/dev/null| awk -v "key=$key" -v "opts=$opts" -F '|' -- '
BEGIN ORS=""; first=1
/Disk/
if (first)
print opts; first=0
dir = $2
loc = $2
# Enclose mount dir and location in quotes
# Double quote "$" in location as it is special
gsub(/$$/, "\$", loc);
gsub(/&/,"\\&",loc)
print " \nt "/" dir """, ""://" key "/" loc """
END if (!first) print "n"; else exit 1
'
However when running:
ypcat -k auto.cifs
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
[ -x $SMBCLIENT ] || exit 1
credfile="/etc/auto.smb.$key"
do
done
else
fi
for P in /bin /sbin /usr/bin /usr/sbin
if [ -e "$credfile" ]
key="$1"
mountopts="fstype=cifs,file_mode=0600,dir_mode=0700,uid=root,gid=root"
smbclientopts=""
then
Here are some debug autofs logs:
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 508, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: attempting to mount entry /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): looking up drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): drobo-down -> -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): dequote("://drobo-up/drobo-down") -> ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up, loc=://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: sun_mount: parse(sun): mounting root /drobo-up, mountpoint drobo-down, what //drobo-up/drobo-down, fstype cifs, options rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: do_mount: //drobo-up/drobo-down /drobo-up/drobo-down type cifs options rw,user,suid,credentials=/etc/auto.smb.drobo-up using module generic
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mkdir_path /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mount -t cifs -o rw,user,suid,credentials=/etc/auto.smb.drobo-up //drobo-up/drobo-down /drobo-up/drobo-down
Oct 31 16:12:20 workstation kernel: 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.
Oct 31 16:12:20 workstation automount[5234]: >> mount error(112): Host is down
Oct 31 16:12:20 workstation automount[5234]: >> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Oct 31 16:12:20 workstation kernel: CIFS VFS: cifs_mount failed w/return code = -112
Oct 31 16:12:20 workstation automount[5234]: mount(generic): failed to mount //drobo-up/drobo-down (type cifs) on /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 508
Oct 31 16:12:20 workstation automount[5234]: failed to mount /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 509, name drobo-down, request pid 10182
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 509
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 510, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 510
adding fstab contents:
cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Aug 16 10:22:50 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
# /dev/mapper/vg_server-LogVol00 / ext4 defaults 1 1 UUID=01bbe54b-06d4-4537-aa87-9c9618996000 /boot ext4 defaults 1 2 /dev/mapper/vg_server-LogVol02 /home ext4 defaults 1 2 /dev/mapper/vg_server-LogVol03 /usr/local ext4 defaults 1 2 /dev/mapper/vg_server-LogVol01 swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
samba cifs
We are using Fedora 26 with the 4.13.9 kernel and NIS, and I'm aware of the issue where the default CIFS/Samba version is now 3.0. However we use an older Drobo FS which their support says only works with SMB version 1.0. We do not put the Drobo in /etc/fstab
as it will fail on boot some times so we use autofs/automount. We have a cron job that runs and should be calling /etc/auto.cifs
and note the contents of the config files below. I added vers=1.0
every where I could think of. The below results of the ypcat -k
command shows the option does not appear to be passed to the mount
command. Am I missing a config file some where? I've grepped all of /etc
to find all occurrences of mount
or CIFS but nothing except comments come back. Perhaps I'm missing something that isn't obvious to me but might be for someone reading this...
cat /etc/auto.cifs
#!/bin/bash
# Automount config file for drobo network storage device
#
# This file must be executable to work! chmod 755!
key="$1"
# Note: create a cred file for each windows/Samba-Server in your network
# which requires password authentification. The file should contain
# exactly two lines:
# username=user
# password=*****
# Please don't use blank spaces to separate the equal sign from the
# user account name or password.
credfile="/etc/auto.smb.$key"
# Note: Use cifs instead of smbfs:
mountopts="-fstype=cifs,vers=1.0,file_mode=0600,dir_mode=0700,uid=root,gid=root,wsize=8192"
smbclientopts="-m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
if [ -e "$credfile" ]
then
mountopts=$mountopts"vers=1.0,credentials=$credfile"
smbclientopts="-A "$credfile
else
smbclientopts="-N"
fi
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log
| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
BEGIN ORS=""; first=1
/Disk/ if (first) print opts; first=0 ;
gsub(/ /, "\ ", $2);
sub(/$/, "\$", $2);
print " \nt /" $2, "://" key "/" $2
END if (!first) print "n"; else exit 1
'
And here's:
cat /etc/auto.smb
#!/bin/bash
# This file must be executable to work! chmod 755!
# Automagically mount CIFS shares in the network, similar to
# what autofs -hosts does for NFS.
# Put a line like the following in /etc/auto.master:
# /cifs /etc/auto.smb --timeout=300
# You'll be able to access Windows and Samba shares in your network
# under /cifs/host.domain/share
# "smbclient -L" is used to obtain a list of shares from the given host.
# In some environments, this requires valid credentials.
# This script knows 2 methods to obtain credentials:
# 1) if a credentials file (see mount.cifs(8)) is present
# under /etc/creds/$key, use it.
# 2) Otherwise, try to find a usable kerberos credentials cache
# for the uid of the user that was first to trigger the mount
# and use that.
# If both methods fail, the script will try to obtain the list
# of shares anonymously.
get_krb5_cache()
cache=
uid=$UID
for x in $(ls -d /run/user/$uid/krb5cc_* 2>/dev/null); do
if [ -d "$x" ] && klist -s DIR:"$x"; then
cache=DIR:$x
return
fi
done
if [ -f /tmp/krb5cc_$uid ] && klist -s /tmp/krb5cc_$uid; then
cache=/tmp/krb5cc_$uid
return
fi
key="$1"
opts="-fstype=cifs -m SMB1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
fi
done
[ -x $SMBCLIENT ] || exit 1
creds=/etc/creds/$key
if [ -f "$creds" ]; then
opts="$opts"',vers=1.0,uid=$UID,gid=$GID,credentials='"$creds"
smbopts="-A $creds"
else
get_krb5_cache
if [ -n "$cache" ]; then
opts="$opts"',vers=1.0,multiuser,cruid=$UID,sec=krb5i'
smbopts="-k"
export KRB5CCNAME=$cache
else
opts="$opts"',vers=1.0,guest'
smbopts="-N"
fi
fi
$SMBCLIENT $smbopts -gL "$key" 2>/dev/null| awk -v "key=$key" -v "opts=$opts" -F '|' -- '
BEGIN ORS=""; first=1
/Disk/
if (first)
print opts; first=0
dir = $2
loc = $2
# Enclose mount dir and location in quotes
# Double quote "$" in location as it is special
gsub(/$$/, "\$", loc);
gsub(/&/,"\\&",loc)
print " \nt "/" dir """, ""://" key "/" loc """
END if (!first) print "n"; else exit 1
'
However when running:
ypcat -k auto.cifs
$SMBCLIENT $smbclientopts -gL $key 2>>/var/log/autofs.log | awk -v key="$key" -v opts="$mountopts" -F'|' -- '
[ -x $SMBCLIENT ] || exit 1
credfile="/etc/auto.smb.$key"
do
done
else
fi
for P in /bin /sbin /usr/bin /usr/sbin
if [ -e "$credfile" ]
key="$1"
mountopts="fstype=cifs,file_mode=0600,dir_mode=0700,uid=root,gid=root"
smbclientopts=""
then
Here are some debug autofs logs:
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 508, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: attempting to mount entry /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): looking up drobo-down
Oct 31 16:12:20 workstation automount[5234]: lookup_mount: lookup(yp): drobo-down -> -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): gathered options: fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): dequote("://drobo-up/drobo-down") -> ://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,user,suid,credentials=/etc/auto.smb.drobo-up, loc=://drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: sun_mount: parse(sun): mounting root /drobo-up, mountpoint drobo-down, what //drobo-up/drobo-down, fstype cifs, options rw,user,suid,credentials=/etc/auto.smb.drobo-up
Oct 31 16:12:20 workstation automount[5234]: do_mount: //drobo-up/drobo-down /drobo-up/drobo-down type cifs options rw,user,suid,credentials=/etc/auto.smb.drobo-up using module generic
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mkdir_path /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: mount_mount: mount(generic): calling mount -t cifs -o rw,user,suid,credentials=/etc/auto.smb.drobo-up //drobo-up/drobo-down /drobo-up/drobo-down
Oct 31 16:12:20 workstation kernel: 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.
Oct 31 16:12:20 workstation automount[5234]: >> mount error(112): Host is down
Oct 31 16:12:20 workstation automount[5234]: >> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Oct 31 16:12:20 workstation kernel: CIFS VFS: cifs_mount failed w/return code = -112
Oct 31 16:12:20 workstation automount[5234]: mount(generic): failed to mount //drobo-up/drobo-down (type cifs) on /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 508
Oct 31 16:12:20 workstation automount[5234]: failed to mount /drobo-up/drobo-down
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 509, name drobo-down, request pid 10182
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 509
Oct 31 16:12:20 workstation automount[5234]: handle_packet: type = 3
Oct 31 16:12:20 workstation automount[5234]: handle_packet_missing_indirect: token 510, name drobo-down, request pid 10165
Oct 31 16:12:20 workstation automount[5234]: dev_ioctl_send_fail: token = 510
adding fstab contents:
cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Aug 16 10:22:50 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
# /dev/mapper/vg_server-LogVol00 / ext4 defaults 1 1 UUID=01bbe54b-06d4-4537-aa87-9c9618996000 /boot ext4 defaults 1 2 /dev/mapper/vg_server-LogVol02 /home ext4 defaults 1 2 /dev/mapper/vg_server-LogVol03 /usr/local ext4 defaults 1 2 /dev/mapper/vg_server-LogVol01 swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0
samba cifs
samba cifs
edited Oct 31 '17 at 20:29
RobbieTheK
asked Oct 31 '17 at 20:23
RobbieTheKRobbieTheK
113111
113111
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I found where to add the vers=1.0
option. On the primary NIS server we have a couple files for both Drobo units for each campus:
cat /etc/auto.drobo-uptown
drobo-downtown -fstype=cifs,vers=1.0,rw,user,suid,credentials=/etc/auto.smb.drobo-uptown ://drobo-uptown/drobo-downtown
But the other thing that escaped me was I had to run make -C /var/yp
after making a change to the above file, and then the other workstations/servers in the NIS domain starting seeing the change.
Also a change was made in cifs-utils to documentation, and a small bugfix in setcifsacl.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f881260%2fno-dialect-specified-on-mount-error-where-to-set-vers-1-0-with-autofs-fedora-26%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found where to add the vers=1.0
option. On the primary NIS server we have a couple files for both Drobo units for each campus:
cat /etc/auto.drobo-uptown
drobo-downtown -fstype=cifs,vers=1.0,rw,user,suid,credentials=/etc/auto.smb.drobo-uptown ://drobo-uptown/drobo-downtown
But the other thing that escaped me was I had to run make -C /var/yp
after making a change to the above file, and then the other workstations/servers in the NIS domain starting seeing the change.
Also a change was made in cifs-utils to documentation, and a small bugfix in setcifsacl.
add a comment |
I found where to add the vers=1.0
option. On the primary NIS server we have a couple files for both Drobo units for each campus:
cat /etc/auto.drobo-uptown
drobo-downtown -fstype=cifs,vers=1.0,rw,user,suid,credentials=/etc/auto.smb.drobo-uptown ://drobo-uptown/drobo-downtown
But the other thing that escaped me was I had to run make -C /var/yp
after making a change to the above file, and then the other workstations/servers in the NIS domain starting seeing the change.
Also a change was made in cifs-utils to documentation, and a small bugfix in setcifsacl.
add a comment |
I found where to add the vers=1.0
option. On the primary NIS server we have a couple files for both Drobo units for each campus:
cat /etc/auto.drobo-uptown
drobo-downtown -fstype=cifs,vers=1.0,rw,user,suid,credentials=/etc/auto.smb.drobo-uptown ://drobo-uptown/drobo-downtown
But the other thing that escaped me was I had to run make -C /var/yp
after making a change to the above file, and then the other workstations/servers in the NIS domain starting seeing the change.
Also a change was made in cifs-utils to documentation, and a small bugfix in setcifsacl.
I found where to add the vers=1.0
option. On the primary NIS server we have a couple files for both Drobo units for each campus:
cat /etc/auto.drobo-uptown
drobo-downtown -fstype=cifs,vers=1.0,rw,user,suid,credentials=/etc/auto.smb.drobo-uptown ://drobo-uptown/drobo-downtown
But the other thing that escaped me was I had to run make -C /var/yp
after making a change to the above file, and then the other workstations/servers in the NIS domain starting seeing the change.
Also a change was made in cifs-utils to documentation, and a small bugfix in setcifsacl.
answered Nov 10 '17 at 14:34
RobbieTheKRobbieTheK
113111
113111
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f881260%2fno-dialect-specified-on-mount-error-where-to-set-vers-1-0-with-autofs-fedora-26%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown