Score:0

CIFS mount error(2): No such file or directory

cn flag

I installed Ubuntu 20.04 desktop on a new computer yesterday, and today I am trying to connect to a Windows 10 share on my internal network (LAN) with CIFS. The Windows 10 machine has two drives, and it shares its D: drive as "D Share" with a space. Other Windows computers on this network regularly attach to this share, so I know it's active. I also verified that the machine is at 192.168.0.2.

I have tried many configurations of the share name, but all attempts return "mount error(2): No such file or directory" and dmesg returns:

CIFS:   VFS: BAD NETWORK NAME: \\192.168.0.2\D:
CIFS:   VFS: cifs_mount failed w/return code = -2

I have tried these:

sudo mount -t cifs -o username=James96,password=abcde //192.168.0.2/D: /mnt/smb_share
sudo mount -t cifs -o username=James96,password=abcde //192.168.0.2/D/ /mnt/smb_share
sudo mount -t cifs -o username=James96,password=abcde //192.168.0.2/D Share /mnt/smb_share (this one returns "bad usage" so it doesn't like the space).  
sudo mount -t cifs -o username=James96,password=abcde //192.168.0.2/$D Share /mnt/smb_share
sudo mount -t cifs -o username=James96,password=abcde //192.168.0.2/D_Share /mnt/smb_share

So my question is: how do I specify the share name where it's shared as D Share in Windows?

Other info:

$ uname -r 
5.13.0-30 generic
$ mount.cifs -V
version 6.9

Thanks for any help.

waltinator avatar
it flag
Does the `/mnt/smb_share` directory exist, before the `mount`?
RTC222 avatar
cn flag
Yes that folder exists. I created it yesterday.
cv flag
I can't see that you tried to escape space or use quotation mark. So this should work: `sudo mount -t cifs -o username=James96,password=abcde "//192.168.0.2/D Share" /mnt/smb_share` and `sudo mount -t cifs -o username=James96,password=abcde //192.168.0.2/D\ Share /mnt/smb_share`
RTC222 avatar
cn flag
Thanks for that comment. I will try it in quotes. I just solved the problem another way -- I created a share on folder on that drive, and the share name has no spaces in it. That worked. So the problem was the space and your answer should help.
RTC222 avatar
cn flag
@Mateusz -- yes, you're right. When I put it in quotes as you showed it works. Thanks.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.