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?
LVL 1
bejhanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
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.
0
bejhanAuthor Commented:
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.
0
Zephyr ICTCloud ArchitectCommented:
Ah, I see ... Ok, it's more like you want to browse the Windows machine and access the folders like that? You might be able to do that using gvfs-backend, it contains smb-browse ... If that doesn't work you might have to look into other likewise Samba tools

Btw, are you using a GUI? Because the gvfs-backend might not work via cli ...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

bejhanAuthor Commented:
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.
0
Zephyr ICTCloud ArchitectCommented:
It could be (probably is) a package like gvfs-backend taking care of this ...
0
bejhanAuthor Commented:
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?
0
Zephyr ICTCloud ArchitectCommented:
Hmmm, you could try to not automount with /etc/fstab by adding "noauto" to the fstab line, like this:

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

Open in new window


And mounting it using "/etc/rc.local" by adding something like this:

mount /media/windowsshare
exit 0

Open in new window

0
bejhanAuthor Commented:
I have abandoned Rapsbian in favor of OpenELEC.
Thank you for all of your help though.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.