Networking Forums

Networking Forums > Computer Networking > Linux Networking > What is auto.net supposed to do?

Reply
Thread Tools Display Modes

What is auto.net supposed to do?

 
 
foxy123
Guest
Posts: n/a

 
      09-13-2005, 09:49 AM
I have got a desktop which is dual boot Windows/Ubuntu and laptop, which
is run on Ubuntu only. I am trying to set up autofs to automatically mount
the shares from desktop on laptop regardless how desktop is booted.

I thought that auto.net script should look up available shares and mount
them in /net. However, it does not happen. In my auto.master I've got the
following:

/net /etc/auto.net --timeout=60

auto.net file contains some sort of script... Any help?
 
Reply With Quote
 
 
 
 
Dr Balwinder Singh Dheeman
Guest
Posts: n/a

 
      09-14-2005, 03:43 AM
On 09/13/2005 03:19 PM, foxy123 wrote:
> I have got a desktop which is dual boot Windows/Ubuntu and laptop, which
> is run on Ubuntu only. I am trying to set up autofs to automatically mount
> the shares from desktop on laptop regardless how desktop is booted.
>
> I thought that auto.net script should look up available shares and mount
> them in /net. However, it does not happen. In my auto.master I've got the
> following:
>
> /net /etc/auto.net --timeout=60
>
> auto.net file contains some sort of script... Any help?


That auto.net script is only for NFS shares, and will not work for
Windows and, or Samba shares; based on this auto.net you may try my
auto.smb sript works for me:

------------8<------------
#!/bin/sh

# $Id: auto.net,v 1.5 2003/09/29 08:22:35 raven Exp $

# Look at what an host is sharing to determine what we can mount. This is
# very simple, but it appears to work surprisingly well.

key="$1"

# FIXME: Override a bug/feature in autofs; it's working for only me, but is
# genric enough to be usable by others
[ -z "$HOME" ] || HOME="/home/bsd"

# Get username from $HOME/.sambarc
usr=`awk -F= '/username/ {print $2}' $HOME/.sambarc`

# Add/edit other applicable smbfs/mount options here.
# Note: "nonstrict" is now set by default, remove it if you don't want it.
opts="-fstype=smbfs,credentials=$HOME/.sambarc,uid=$usr,gid=$usr,fmask=0664,dmask=0775,n onstrict"

# List samba/windows/lan manager shares available on target host (key).
LISTMOUNTS="/usr/bin/smbclient -A $HOME/.sambarc -L $key"

$LISTMOUNTS 2>/dev/null | LC_ALL=C sort +0 | \
awk -v key="$key" -v opts="$opts" -- '
BEGIN { ORS=""; first=1 }
{ if (first) { print opts; first=0 };
if ($2 == "Disk") {print " \\\n " "/mnt/" $1, "//" key "/" $1}}
END { if (!first) print "\n"; else exit 1 }
' | grep -v '\$'
------------8<------------

Create an /etc/auto.smb on your Ubuntu desktop and add the following
line to yout /etc/auto.master

/smb /etc/auto.smb --timeout=20 # or whatever

You will also need to create $HOME/.smabarc files on your Ubuntu
notebook containg the follows lines.

# .sambarc
username=UserNameOnYourUbuntuDesktop
password=SecretForAboveUser

Restart autofs service on your Ubuntu Notebook

invoke-rc.d autofs restart

and type in:

cd /smb/HostnameOfYourDesktop

Hope that helps!

--
Dr Balwinder Singh Dheeman Registered Linux User: #229709
CLLO (Chief Linux Learning Officer) Machines: #168573, 170593, 259192
Anu's Linux@HOME Distros: Ubuntu, Fedora, Knoppix
More: http://anu.homelinux.net/~bsd/ Visit: http://counter.li.org/
 
Reply With Quote
 
foxy123
Guest
Posts: n/a

 
      09-14-2005, 09:34 AM
On Wed, 14 Sep 2005 09:13:50 +0530, Dr Balwinder Singh Dheeman wrote:

> On 09/13/2005 03:19 PM, foxy123 wrote:
>> I have got a desktop which is dual boot Windows/Ubuntu and laptop, which
>> is run on Ubuntu only. I am trying to set up autofs to automatically mount
>> the shares from desktop on laptop regardless how desktop is booted.
>>
>> I thought that auto.net script should look up available shares and mount
>> them in /net. However, it does not happen. In my auto.master I've got the
>> following:
>>
>> /net /etc/auto.net --timeout=60
>>
>> auto.net file contains some sort of script... Any help?

>
> That auto.net script is only for NFS shares, and will not work for
> Windows and, or Samba shares; based on this auto.net you may try my
> auto.smb sript works for me:
>
> ------------8<------------
> #!/bin/sh
>
> # $Id: auto.net,v 1.5 2003/09/29 08:22:35 raven Exp $
>
> # Look at what an host is sharing to determine what we can mount. This is
> # very simple, but it appears to work surprisingly well.
>
> key="$1"
>
> # FIXME: Override a bug/feature in autofs; it's working for only me, but is
> # genric enough to be usable by others
> [ -z "$HOME" ] || HOME="/home/bsd"
>
> # Get username from $HOME/.sambarc
> usr=`awk -F= '/username/ {print $2}' $HOME/.sambarc`
>
> # Add/edit other applicable smbfs/mount options here.
> # Note: "nonstrict" is now set by default, remove it if you don't want it.
> opts="-fstype=smbfs,credentials=$HOME/.sambarc,uid=$usr,gid=$usr,fmask=0664,dmask=0775,n onstrict"
>
> # List samba/windows/lan manager shares available on target host (key).
> LISTMOUNTS="/usr/bin/smbclient -A $HOME/.sambarc -L $key"
>
> $LISTMOUNTS 2>/dev/null | LC_ALL=C sort +0 | \
> awk -v key="$key" -v opts="$opts" -- '
> BEGIN { ORS=""; first=1 }
> { if (first) { print opts; first=0 };
> if ($2 == "Disk") {print " \\\n " "/mnt/" $1, "//" key "/" $1}}
> END { if (!first) print "\n"; else exit 1 }
> ' | grep -v '\$'
> ------------8<------------
>
> Create an /etc/auto.smb on your Ubuntu desktop and add the following
> line to yout /etc/auto.master
>
> /smb /etc/auto.smb --timeout=20 # or whatever
>
> You will also need to create $HOME/.smabarc files on your Ubuntu
> notebook containg the follows lines.
>
> # .sambarc
> username=UserNameOnYourUbuntuDesktop
> password=SecretForAboveUser
>
> Restart autofs service on your Ubuntu Notebook
>
> invoke-rc.d autofs restart
>
> and type in:
>
> cd /smb/HostnameOfYourDesktop
>
> Hope that helps!


Thanks a lot. I will try to set up auto.smb then.

However, the thing is that auto.net does not mount my NFS shares.

I have edited /etc/exports:

/home 10.0.0.3(rw)

and /etc/hosts.allow:

portmap mountd nfsd statd lockd : 10.0.0.13 10.0.0.11 10.0.0.3
portmap : 10.0.0.13 10.0.0.3

and I can manually mount the shares, but I hoped that they will be mounted
automatically when available.
 
Reply With Quote
 
Dr Balwinder Singh Dheeman
Guest
Posts: n/a

 
      09-15-2005, 01:19 AM
On 09/14/2005 03:04 PM, foxy123 wrote:
> Thanks a lot. I will try to set up auto.smb then.


You're welcome!

> However, the thing is that auto.net does not mount my NFS shares.



Hmmm, may be that the script auto.net installed on your notebook is
buggy. Please post the output of following:

/etc/auto.net HostNameOfYourDesktop

> I have edited /etc/exports:
>
> /home 10.0.0.3(rw)
>
> and /etc/hosts.allow:
>
> portmap mountd nfsd statd lockd : 10.0.0.13 10.0.0.11 10.0.0.3
> portmap : 10.0.0.13 10.0.0.3
>
> and I can manually mount the shares, but I hoped that they will be mounted
> automatically when available.


The above settings look fine, and your auto.net should definitely work as
you already have tested these by manually mounting your NFS shares
and, or exported sub-directories from your desktop.

BTW, you have not mentioned versions of your Ubuntu and autofs; these
versions numbers could be quite handy while answering and, or resolving
problems.

--
Dr Balwinder Singh Dheeman Registered Linux User: #229709
CLLO (Chief Linux Learning Officer) Machines: #168573, 170593, 259192
Anu's Linux@HOME Distros: Ubuntu, Fedora, Knoppix
More: http://anu.homelinux.net/~bsd/ Visit: http://counter.li.org/
 
Reply With Quote
 
foxy123
Guest
Posts: n/a

 
      09-16-2005, 09:09 AM
On Thu, 15 Sep 2005 06:49:50 +0530, Dr Balwinder Singh Dheeman wrote:

> On 09/14/2005 03:04 PM, foxy123 wrote:
>> Thanks a lot. I will try to set up auto.smb then.

>
> You're welcome!
>
>> However, the thing is that auto.net does not mount my NFS shares.

>
>
> Hmmm, may be that the script auto.net installed on your notebook is
> buggy. Please post the output of following:
>
> /etc/auto.net HostNameOfYourDesktop
>
>> I have edited /etc/exports:
>>
>> /home 10.0.0.3(rw)
>>
>> and /etc/hosts.allow:
>>
>> portmap mountd nfsd statd lockd : 10.0.0.13 10.0.0.11 10.0.0.3
>> portmap : 10.0.0.13 10.0.0.3
>>
>> and I can manually mount the shares, but I hoped that they will be mounted
>> automatically when available.

>
> The above settings look fine, and your auto.net should definitely work as
> you already have tested these by manually mounting your NFS shares
> and, or exported sub-directories from your desktop.
>
> BTW, you have not mentioned versions of your Ubuntu and autofs; these
> versions numbers could be quite handy while answering and, or resolving
> problems.


Ubuntu 5.04 Hoary, autofs 4.1.3

$ /etc/auto.net 10.0.0.11
-fstype=nfs,hard,intr,nodev,nosuid,nonstrict,rsize= 8192,wsize=8192,async \
/home 10.0.0.11:/home \
/windows/D 10.0.0.11:/windows/D \
/windows/E 10.0.0.11:/windows/E

Thanks a lot for trying to help me...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it supposed to work that way? via-rhine + setiathome Johann Klammer Linux Networking 0 01-08-2012 09:46 PM
Auto Shipping Auto Shipping Scheduling:car moving auto transport linkswanted Wireless Internet 0 02-16-2008 01:40 AM
Are bridges supposed to be able to talk to each other? phil-news-nospam@ipal.net Wireless Internet 1 07-21-2006 05:41 PM
Line Attenuation etc - whats it supposed to be paulfoel Broadband 11 12-29-2005 08:41 AM
auto-crossover - auto-MDI/X capability of ethernet NIC ttsp Linux Networking 3 03-04-2004 03:33 AM



1 2 3 4 5 6 7 8 9 10 11