Link to home
Start Free TrialLog in
Avatar of bejhan
bejhan

asked on

Raspbian (Debian): How to mount all shares of an SMB server (rather than individually)

I am attempting to mount my SMB share on Raspbian.
The Windows machine shares many folders.
I attempted to simply mount its IP address, which does not work.
It seems I have to mount each share individually.

I know ES File Explorer on Android allows you to browse smb://[IP] and access each share from there.
I can browse this path on Raspbian but it indicates that a share is not mounted when I try to access it.
However, it occurs to me that ES File Explorer may be mounting shares on the fly.

Is there anyway to achieve my desired mounting?
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

That is kind of how it works yes, you need to mount them individually, now, there's a way to automate it, but let's first see if the mounting works.

To mount a share to a local folder you'll first need to create this folder, for example (you can mount it wherever you want though):

mkdir /mnt/windowsshare

Open in new window


Now let's see if you can mount the share with following command (it can be slightly different depending on the Linux kernel):

mount -t cifs //windowsbox/folder  /mnt/windowsshare -o username=username,password=password 

Open in new window


If this seems to work we can make this mount "permanent" by adjusting the /etc/fstab file with a line looking something like this:

 //windowsbox/folder /mnt/windowsshare  cifs username=username,password=password,iocharset=utf8,sec=ntlm  0  0

Open in new window


You can add a line for each share you want to mount during startup or running the mount command.
Avatar of bejhan
bejhan

ASKER

I actually have mounted a folder through /etc/fstab without trouble. I'm wanting to simply mount //windowsbox rather than each //windowsbox/folder, because there are many folders and such that I can access via smb://windowsbox. I suppose if that is not possible, I could mount each folder in /etc/fstab which would at least allow access via smb://windowsbox.
ASKER CERTIFIED SOLUTION
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bejhan

ASKER

I am using a GUI so I will give gvfs-backend a try.

I noticed Ubuntu actually has out-of-the-box support for Windows shares which is really convenient. I wonder if that is Ubuntu-specific or just some included package that I could utilize on other Linux distros.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bejhan

ASKER

I may just mount all my shares through /etc/fstab, the alternate solution does not seem worth the benefit.

The only issue I am having with this approach is that I must issue "mount -a" each time I reboot in order to see the mount contents through the file browser (they seem to be available via terminal automatically).

How can I solve this?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bejhan

ASKER

I have abandoned Rapsbian in favor of OpenELEC.
Thank you for all of your help though.