Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dynamic smbmount?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Strowi
l33t
l33t


Joined: 19 Aug 2003
Posts: 656
Location: Bonn

PostPosted: Wed Jan 25, 2006 8:18 am    Post subject: dynamic smbmount? Reply with quote

hi,

i have a small home-network. Now i would like to dynamially mount a share from a client on the server, when the client booted the shared folder should be mounted, and when the client is powered off the share should be unmounted. Is there an option in samba or any other way to do this in workgroups (i know, there is sth. like that for domains...)?
_________________
--
Linux & such ...
http://blog.hasnoname.de
Back to top
View user's profile Send private message
tuxmin
l33t
l33t


Joined: 24 Apr 2004
Posts: 838
Location: Heidelberg

PostPosted: Wed Jan 25, 2006 9:10 am    Post subject: Reply with quote

Well, simply put it in your /etc/fstab. Try something like this

Code:

//server/share       /net/windows  cifs user=someuser,cred=/root/.cifs-credentials,rw,uid=somelocaluser,gid=somelocalgroup 0 0


Put the user and password in /root/.cifs-credentials
Code:

username=someuser
password=somepasswd

Make sure this file is readable only by root!
_________________
ALT-F4
Back to top
View user's profile Send private message
Strowi
l33t
l33t


Joined: 19 Aug 2003
Posts: 656
Location: Bonn

PostPosted: Wed Jan 25, 2006 9:54 am    Post subject: Reply with quote

hi,

thx for the reply.
I already tried adding it to /etc/fstab, but that's not the problem.. oh, wait a sec... your using cifs, never looked into it before, on a quick look it seems to be based on smb-potocol, so it should natively work with windows clients i guess.
I will give it a shot.

THX!
_________________
--
Linux & such ...
http://blog.hasnoname.de
Back to top
View user's profile Send private message
Strowi
l33t
l33t


Joined: 19 Aug 2003
Posts: 656
Location: Bonn

PostPosted: Wed Jan 25, 2006 11:11 am    Post subject: Reply with quote

hi,

couldn't check if it is accessible after client-reboot. But one problem is: If i try to mount the share (with --force) hile the client is down, i get only the error :" no route to host"
_________________
--
Linux & such ...
http://blog.hasnoname.de
Back to top
View user's profile Send private message
Kuhndog86
Apprentice
Apprentice


Joined: 20 Jul 2004
Posts: 271
Location: Minnesota

PostPosted: Thu Feb 09, 2006 7:49 pm    Post subject: Reply with quote

I use submount to accomplish this.
Code:

emerge submount
echo "subfs" >> /etc/modules.autoload.d/kernel-2.6
modprobe subfs


Then, add this line to your fstab:
Code:

//server/share       /net/windows  subfs  fs=cifs,program=/sbin/net.submountd,interval=5,user=someuser,cred=/root/.cifs-credentials,rw,uid=somelocaluser,gid=somelocalgroup 0 0


This will mount the directory whenever you cd into it (assuming the remote machine is online) and umount it whenever you leave it. If the remote machine is offline it will say somthing like "no medium found" or somesuch when you cd into it.

Edit: CIFS is the new implimentation of SMB used on win2k and later windoze machines
Good luck!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum