Samba – Fixing CIFS Mount Error(9): Bad File Descriptor

cifslinuxmountsambawindows

I had successful connections from my main workstation PC (which uses Fedora 29 Workstation) to my mother's laptop (Windows 7 HP) network share few times using mount.cifs, but since not too long it has become impossible for me to do it.

For example, using Nautilus, connecting to smb://192.168.0.2/Data asks for a credentials (although it should be stored permanently for this share already), and even when you enter a correct username and password, it does nothing but just prompts for how to login again.

Using mount -t cifs was also successful in the past but not anymore, since it returns an error as following:

[ruslan@sakuya ~]$ sudo mount -t cifs //192.168.0.2/Data .mount/samba -o username=ruslan,password=[mypassword],domain=WORKGROUP,iocharset=utf8,rw,file_mode=0777,dir_mode=0777
mount error(9): Bad file descriptor
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[ruslan@sakuya ~]$ sudo mount -t cifs //PATCHOULI/Data .mount/samba -o username=ruslan,password=[mypassword],domain=WORKGROUP,iocharset=utf8,rw,file_mode=0777,dir_mode=0777
mount error(9): Bad file descriptor
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[ruslan@sakuya ~]$ sudo mount -t cifs //192.168.0.2/Data .mount/samba
Password for ruslan@//192.168.0.2/Data:  **********
mount error(9): Bad file descriptor
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[ruslan@sakuya ~]$ sudo mount -t cifs //PATCHOULI/Data .mount/samba
Password for ruslan@//PATCHOULI/Data:  **********
mount error(9): Bad file descriptor
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

dmesg isn't also very helpful on its' side:

[ 4342.451104] 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.
[ 4342.455203] Status code returned 0xc0000008 STATUS_INVALID_HANDLE
[ 4342.455217] CIFS VFS: Send error in SessSetup = -9
[ 4342.455237] CIFS VFS: cifs_mount failed w/return code = -9

Specifying the PC name and/or removing any or all of options does not help in any way.

Best Answer

Edit: someone from the community has noticed that official update fixing the problem has been released; this link provides a solution:

Microsoft released the Update KB4487345 to fix the issue:

This update resolves the issue where local users who are part of the local “Administrators“ group may not be able to remotely access shares on Windows 7 SP1 and Windows Server 2008 R2 machines after installing the January 8th, 2019 security updates. This does not affect domain accounts in the local "Administrators" group.

So download and install the update by doing a double click on the msu file.