web-dev-qa-db-ja.com

マウントエラーで方言が指定されていません。autofs/ Fedora 26でvers = 1.0を設定する場合、Drobo FS

私たちは4.13.9カーネルとNISでFedora 26を使用しており、 デフォルトのCIFS/Sambaバージョンは現在3. である問題を認識しています。ただし、私たちは古いDrobo FSを使用しています。これは、サポートがSMBバージョン1.0でのみ機能することを示しています。Droboを_/etc/fstab_ブート時に失敗することがあるので、autofs/automountを使用します。実行するcronジョブがあり、_/etc/auto.cifs_を呼び出す必要があります。以下の構成ファイルの内容に注意してください。可能な限り_vers=1.0_考えてみてください。以下の_ypcat -k_コマンドの結果は、オプションがmountコマンドに渡されていないように見えることを示しています。設定ファイルがどこかにないのですか?_/etc_ mountまたはCIFSのすべての出現を検索しますが、コメント以外は返されません。おそらく、私には明らかではないが、これを読んでいる誰かのためのものである可能性があります。

_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 " \\\n\t /" $2, "://" key "/" $2 }
        END     { if (!first) print "\n"; else exit 1 }
        '
_

そしてここにあります:

_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 " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
        }
    END     { if (!first) print "\n"; else exit 1 }
    '
_

ただし、実行時:

_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
_

いくつかのデバッグautofsログは次のとおりです。

_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
_

fstabコンテンツの追加:

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
_
1
RobbieTheK

vers=1.0オプションを追加する場所を見つけました。プライマリNISサーバーには、各キャンパスの両方のDroboユニット用のファイルがいくつかあります。

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

しかし、私を逃れたもう1つのことは、上記のファイルに変更を加えた後にmake -C /var/ypを実行する必要があり、NISドメイン内の他のワークステーション/サーバーが変更を確認し始めたことです。

cifs-utilsのドキュメントへの変更、およびsetcifsaclの小さなバグ修正 も変更されました。

1
RobbieTheK