Tuesday, March 8, 2016

The More I Try to Share Files Between Windows 10 and Linux

The more I wonder if Linux is a practical joke that got out of control.  This claims to tell how to do so.  I am using Debian.  In the File Manager under Network, I can see Clunker (the antique HP), DEBIAN and TOSHIBA and Windows Network.  Where trouble starts is:

sudo mount.cifs \\TOSHIBA\\clayton /home/clayton/Desktop/toshiba-share -o user=clayton
mount error: could not resolve address for toshiba: Unknown error

I ried all lower case because that seems to be the hostname on the Toshiba, all upper case, and Toshiba.  None work.  Suggestions?

5 comments:

Kyle Haight said...

Presumably the Linux machine is trying to convert the TOSHIBA string into an IP address via domain name resolution, and it isn't working because the lookup isn't picking up the correct domain name. Rather than try to sort that out, my recommendation would be to just get the IP address the Toshiba is using and put it into the mount command directly. Hopefully that will prevent the name resolution attempt and you'll be able to move on to the next bizarre error.

StormCchaser said...

Linux is a far stronger and cleaner OS than Windows. The difficulty in file sharing is due to the very stupid way Windows does it.

But... Linux is harder to use. I rarely use it, but I almost never use Windows. I use OS X, Apple's Unix variant.

C. Petro said...

Kyle likely has the right of this one--unless mount.cifs needs...

Nope.

Try setting this:

ip=arg
sets the destination IP address. This option is set automatically if the server name portion of the requested UNC name can be resolved so rarely needs to be specified by the user.

in the mount commandline. Read the man page (http://linux.die.net/man/8/mount.cifs) for more assistance.

Frankly I always had bad luck with windows and Windows shares.

SJ said...

I was about to ask if you'd put the hostname into /etc/hosts.

Then I remembered: Samba/CIFS doesn't automatically refer to that file, unless you tell it to.

There's a reference to "name resolve order" here.

http://serverfault.com/questions/609365/cifs-mount-in-fstab-succeeds-on-ip-fails-on-hostname-written-in-etc-hosts

Jay Kominek said...

the windows file sharing protocols are a terrible joke. you can easily get into weird situations between two windows machines, too, some i don't think it is even possible to resolve.

you frequently end up needing to tell mount both the name the target computer thinks it has, and a name that'll convert to the relevant ip address. if they're not the same, get ready for weirdness.

the ip= business from other folks should have you on the right track. (-o user=clayton,ip=192.168.xxx.xxx)