Subject: Re: amd and smbfs
To: None <joel@carnat.net>
From: Hauke Fath <hf@spg.tu-darmstadt.de>
List: netbsd-users
Date: 04/28/2005 10:31:21
Joel CARNAT wrote:
> Hi,
> 
> I would like to mount my SMB shares automatically.

[...]

> # cat /etc/amd/smb
> /defaults      type:=host;rhost:=${key};fs:=${autodir}/${rhost}/root
> *              host==${key};type:=link;fs:=/
> host!=${key};opts:=ro,soft,intr,nodev,nosuid,noconn
> 
> I expected to "cd /mnt/smb/windows; ls" and see the SMB mount point.
> But this is a conf fro NFS and I don't find how to use smbfs instead of
> nfs.
> 
> Anyone would share his SMB map so I can adapt to my things ?

Amd does not do SMB.

What it offers, though, is a 'program' map type where you can provide 
instructions for mounting and unmounting filesystems.

That said... amd releases have had the annoying habit of 'sanitizing' 
paths, stripping any 'redundant' slashes in the process. This makes it 
pretty hard to provide a //server/share string to the SMB mount command.

The Amd 6.1 release candidate (available as snapshot, or from anoncvs, 
at www.am-utils.org) ) has an /etc/amd.conf variable 'normalize_slashes' 
that you set to 'no' to switch off path normalizing.

With this feature, a map entry for an SMB mount looks like

smbmnt	-type:=program;rhost:=smbserver;rfs:=smbshare;fs:=/.smbshare \
         os==netbsdelf2;\
         mount:="/sbin/mount mount -r -t smbfs -o-N,-I${rhost} 
//${rhost}/${rfs} ${fs}";\
         unmount:="/sbin/umount umount ${fs}"

(the 'mount' and 'unmount' commands are on one line, each.)
-- note the intermediate '/.smbshare' mount point.

Hopefully, Amd 6.1 will make it into NetBSD 3.

HTH,
	hauke

-- 
/~\  The ASCII Ribbon Campaign                    Hauke Fath
\ /    No HTML/RTF in email	        Institut für Nachrichtentechnik
  X     No Word docs in email	                  TU Darmstadt
/ \  Respect for open standards              Ruf +49-6151-16-3281