>               Example for me (X = Win PC, C = share name)
>               smbmount //X/C /share
> 
>               To unmount (my example)
>               smbumount -t smbfs /share
> 
> Is there a way this can be done automatically (even if the Windows PC is
> off)?

You can use mount -t smbfs, which will call smbmount in turn. This should
also work from /etc/fstab. You may have to have current versions of mount,
smbfs etc, I recall having trouble at various times because smbfs just kept
on changes. Man pages were (are?) severely out of date.

In general, you can not mount anything when the remote isn't up.

To get around that, wait with the mount until the remote is up. To automate
that, you want autofs. I use that (apart from the desktop icons on
konqueror) to mount CDs and floppies (also works if there is no X on the
machine). The mounting happens automatically when you access the mount
point. If it fails (e.g. remote not up) the mount point remains empty, try
again later. smbmount will prob have to be suid root for this.

I have autofs 3.7.1, and my config looks like this:

> cat /etc/auto.master
/misc   /etc/auto.misc

> cat /etc/auto.misc
cd              -fstype=iso9660,ro              :/dev/cdrom
floppy          -fstype=auto,sync,umask=0       :/dev/fd0
# The rw is necessary after ext2 or autofs picks up a bogus option d for mount.
# (SuSE 7.0)
floppy_ext2     -fstype=ext2,rw                 :/dev/fd0
appln           -fstype=smbfs,ro        ://mickeyserver/appln

I am not sure atm whether the smbfs entry works, the man page may be wrong
or I mave it wrong.

Of course the even cooler thing is to use sharity,
http://www.obdev.at/Products/Sharity.html
private home licenses are free. It even gives you a net neighbourhood
browser.

Volker

Reply via email to