How do you force a CIFS connection to unmount

前端 未结 11 1946
借酒劲吻你
借酒劲吻你 2021-01-29 17:32

I have a CIFS share mounted on a Linux machine. The CIFS server is down, or the internet connection is down, and anything that touches the CIFS mount now takes several minutes

11条回答
  •  暖寄归人
    2021-01-29 18:27

    I had this issue for a day until I found the real resolution. Instead of trying to force unmount an smb share that is hung, mount the share with the "soft" option. If a process attempts to connect to the share that is not available it will stop trying after a certain amount of time.

    soft Make the mount soft. Fail file system calls after a number of seconds.

    mount -t smbfs -o soft //username@server/share /users/username/smb/share
    
    stat /users/username/smb/share/file
    stat: /users/username/smb/share/file: stat: Operation timed out
    

    May not be a real answer to your question but it is a solution to the problem

提交回复
热议问题