View previous topic :: View next topic |
Author |
Message |
Strowi l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17485625373f5a41530ec91.jpg)
Joined: 19 Aug 2003 Posts: 656 Location: Bonn
|
Posted: Wed Jan 25, 2006 8:18 am Post subject: dynamic smbmount? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
tuxmin l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/473518307438a03b302dca.jpg)
Joined: 24 Apr 2004 Posts: 838 Location: Heidelberg
|
Posted: Wed Jan 25, 2006 9:10 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Strowi l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17485625373f5a41530ec91.jpg)
Joined: 19 Aug 2003 Posts: 656 Location: Bonn
|
Posted: Wed Jan 25, 2006 9:54 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Strowi l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/17485625373f5a41530ec91.jpg)
Joined: 19 Aug 2003 Posts: 656 Location: Bonn
|
Posted: Wed Jan 25, 2006 11:11 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Kuhndog86 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/862352886424c4cb1ca46a.gif)
Joined: 20 Jul 2004 Posts: 271 Location: Minnesota
|
Posted: Thu Feb 09, 2006 7:49 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|