Windows to Mint, how to mount share [SOLVED]

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
SC23

Windows to Mint, how to mount share [SOLVED]

Post by SC23 »

Ok I have to call for help as I have been pounding the terminal for over an hour now and it is making me a liiitle crazy.
I have a windows box with some shares.. lets call him WindowsBox. I have an SMB shortcut in my dolphin file manager (KDE 17.0) to smb://WindowsBox/E/
That works fine, no probs.

I would like to mount that as a local drive so I can easily stream music and vids from it since VLC wont do it, and every other media player wants to cache so much of it that it is unusable.. also because now it has become a quest.. something I know can be done but I havent fed the terminal the right peanuts yet.

So far I have or have installed cifs-utils, nfs, and just about every other util that has anything to do with shares and sharing.

I have tried various versions of:
mount -t smbfs -o username=win_name,password=win_pass //WindowsBox/myShare /mount_point

and it always replies cant find WindowsBox or bad UNC

However..
smbclient -L WindowsBox
spits out a list of my WindowsBox shares.

I have also created the folder /media/servershare on the MintBox and pointed at that in various iterations as well.. and when I type that name wrong, it lets me know it cant find it, so it is finding the target path as well.

So to wrap up.. I have a working Windows share I can access on my Mint machine via SMB and I would like to mount it.. whats the magic incantation to make this happen?

Thanks,
SC
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Mint, how to mount share

Post by altair4 »

Lordy, I really don't know what compels me to post in KDE related topics since I find it a very frustrating DE but ......

*** I'm guessing you can't ping the Windows machine by name can you?

Code: Select all

ping WindowsBox
*** You should have received a "mount: unknown filesystem type 'smbfs'" when you ran this command:
mount -t smbfs -o username=win_name,password=win_pass //WindowsBox/myShare /mount_point
It should have looked like this:
mount -t cifs -o username=win_name,password=win_pass //WindowsBox/myShare /mount_point
But if you can't ping by name then you would get this error:
mount error: could not resolve address for WindowsBox: Unknown error
*** Look, my advice to you or anyone else that has to deal with legacy operating systems ( i.e., Windows ) in their own home lans is to at least consider giving all your machines ( or at a minimum your Windows machines ) static ip addresses. Most routers can do this so you don't have to do it in the OS itself. Then your mount command becomes something like this:
mount -t cifs -o username=win_name,password=win_pass //192.168.0.101/myShare /mount_point

This is the easiest and most efficient way to handle Windows in the LAN.

*** If you don't want to do that then consider using smb4K.
It uses the same process ( smbclient ) that dolphin uses to find the host but then mounts it to something you can use in your applications. It mounts it to:
/home/your-user-name/smb4k/WindowsBox/myShare
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SC23

Re: Windows to Mint, how to mount share

Post by SC23 »

altair4 wrote: *** Look, my advice to you or anyone else that has to deal with legacy operating systems ( i.e., Windows ) in their own home lans is to at least consider giving all your machines ( or at a minimum your Windows machines ) static ip addresses. Most routers can do this so you don't have to do it in the OS itself. Then your mount command becomes something like this:
mount -t cifs -o username=win_name,password=win_pass //192.168.0.101/myShare /mount_point

This is the easiest and most efficient way to handle Windows in the LAN.
THIS....this is the sauce I was looking for... I did try the ip in various iterations, but I guess I never hit the right combo. High Five and 1000 internet points for you. Spend them wisely :)

Thank you Thank you Thank you Thank you
SC
SC23

Re: Windows to Mint, how to mount share [SOLVED]

Post by SC23 »

I wanted to finish up this thread with the inevitable "I want it to mount on boot".

Here is what I added to my fstab file in /etc and worked for me. Your mileage may vary, and I am just one click above noob, so take it as you will.

Code: Select all

//192.168.1.100/E /home/charlie/Public/servershare/ cifs uid=1000,gid=1000,username=YourWindowsUsername,password=YourWindowsPassword
note thats all on one line and an empty line at the bottom of fstab is necessary.

Where
//192.168.1.100/E is the ip/Sharename on the Windows Box. Change to your ip and Sharename

/home/charlie/Public/servershare/ is the path to a folder you create. I tried in /media but it was a pain about permissions, so I just made one under my profile

uid=1000,gid=1000
This is your uid and gid, you can get this in terminal by typing "id" without the quotes

This is probably not the best way to do this, but it worked and Im happy so Im passing it along.
SC23

Re: Windows to Mint, how to mount share [SOLVED]

Post by SC23 »

This is an update for those who stumble across this. I have noticed that shutting down has become quite lengthy and after stumbling across another post it points to this mounting solution. I have decided to take the good with the bad and keep my mounted drive and when I shut down I press escape, watch the activity, and when it is setting there doing nothing doing a hard shutdown. I'm not recommending this.. You can make your own decisions. Just passing on my experiences.
deleted

Re: Windows to Mint, how to mount share [SOLVED]

Post by deleted »

FWIW, I generally mount Windows shares with the filemanager of choice (like Dolphin/Thunar/Caja/Nautilus) and bookmark it.
That way I don't have to mess with /etc/fstab or the command line.
-Hinto
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Mint, how to mount share [SOLVED]

Post by altair4 »

SC23 wrote:This is an update for those who stumble across this. I have noticed that shutting down has become quite lengthy and after stumbling across another post it points to this mounting solution. I have decided to take the good with the bad and keep my mounted drive and when I shut down I press escape, watch the activity, and when it is setting there doing nothing doing a hard shutdown. I'm not recommending this.. You can make your own decisions. Just passing on my experiences.
There are historically two problems inherent in the fstab method of mounting shares: At boot up and at shutdown.

*** The one at boot up is caused when the instructions in fstab are executed before the internal network is up so there is noting to mount. I usually fix this by creating a script that does a "mount -a" and placed it in /etc/network/if-up.d since any script there is only executed after the network is up.

*** The one at shut down happens when the network is shut down before the remote share is unmounted so the system keeps looking for the remote share to unmount. Never had your problem so I never tested out the idea of creating another script and adding it to /etc/network/if-down.d with something like "umount /home/charlie/Public/servershare" in it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 20
Level 20
Posts: 11427
Joined: Tue Feb 03, 2009 10:27 am

Re: Windows to Mint, how to mount share [SOLVED]

Post by altair4 »

altair4 wrote:*** The one at shut down happens when the network is shut down before the remote share is unmounted so the system keeps looking for the remote share to unmount. Never had your problem so I never tested out the idea of creating another script and adding it to /etc/network/if-down.d with something like "umount /home/charlie/Public/servershare" in it.
I tried an experiment on a Mint KDE I have as a VBox guest:

First I created an automount in fstab of a share on another box and verified that it did in fact mount at boot time:
//192.168.0.100/downloads /home/altiar/Test cifs guest,uid=1000 0 0
Then I created the umount script:

*** Created a umount script called: /etc/network/if-down.d/smbumount
*** With this content:

Code: Select all

#!/bin/sh
umount /home/altair/Test
*** Made the file executable:

Code: Select all

sudo chmod +x /etc/network/if-down.d/smbumount
*** Then shut down

Disclaimers :wink:

[1] I booted and shutdown a couple of times to see if something would go wrong and nothing did but I wouldn't call that a real test.
[2] Remember that I never had this issue so I'm not sure the script would have any affect on your symptom. When I shut down without the script it shuts down without incident anyway.
[3] All I can tell you is it doesn't seem to break anything having that script there - on my system - but not being a frequent KDE user I'm not sure if there are subtle differences in how KDE acts because of it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
SC23

Re: Windows to Mint, how to mount share [SOLVED]

Post by SC23 »

Awesome info Altair. I didn't know just about everything in your posts. Thank you for current and future use!

SC
Locked

Return to “Networking”