Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2005 04:06:23 -0800
From:      "Loren M. Lang" <lorenl@alzatex.com>
To:        FreeBSD Mailing list <freebsd-questions@freebsd.org>
Subject:   [lorenl@alzatex.com: Re: Mounting a samba share on boot?]
Message-ID:  <20050131120623.GA10752@alzatex.com>

next in thread | raw e-mail | index | archive | help
Sorry, forgot to hit group reply.

----- Forwarded message from "Loren M. Lang" <lorenl@alzatex.com> -----

Date: Mon, 31 Jan 2005 02:32:14 -0800
From: "Loren M. Lang" <lorenl@alzatex.com>
To: Mac Mason <mac@cs.hmc.edu>
Subject: Re: Mounting a samba share on boot?

On Mon, Jan 31, 2005 at 12:42:29AM -0800, Mac Mason wrote:
> Can anybody point me at some documenation for mounting a samba share at boot
> time? I'm used to the linux-style trick of adding it to fstab and pointing it
> at a credentials file, but am pretty sure that won't work in FreeBSD.

Actually, it does, but it's a little different.  I use smbfs mounted
automatically by fstab on fbsd all the time.  Setup the file
/etc/nsmb.conf as follows:

# First, define a workgroup.
[default]
workgroup=MYWORKGROUP
                                                                                
[SERVER:USER]
password=secret

replacing MYWORKGROUP, SERVER, USER, secret as neccessary.  Make sure
nsmb.conf is only readable by root.  Add the following line to fstab:

//user@server/share   /mnt/share       smbfs   rw              0       0

replacing user, server, share, and the local mount point as neccessary.
The permissions for files in the mounted fs will be owned by the user
and group of /mnt/share and files will have the same permissions as
/mnt/share, but directories will allow have execute permission
everywhere that they have read permission so I set /mnt/share with
permissions 644 even though it's a directory and set the owner and group
to my usual user.

Before mount:
$ ls -ld /mnt/share
drw-r--r--  1 user  users  16384 Dec 31  1969 /mnt/share

After mount:
b$ ls -l /mnt/proj
-rw-r--r--  1 user  users    1120810 May 14  2004 some-file
drwxr-xr-x  1 user  users      16384 Oct 24 23:35 a-directory

> 
> I'm running 5.3-RELEASE.
> 
> Thanks!
> 
>     --Mac
> 
> -- 
> Julian "Mac" Mason                            mac@cs.hmc.edu
> Computer Science '06                          (909)-607-3129
> Harvey Mudd College                      



-- 
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: B3B9 D669 69C9 09EC 1BCD  835A FAF3 7A46 E4A3 280C
 

----- End forwarded message -----

-- 
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: B3B9 D669 69C9 09EC 1BCD  835A FAF3 7A46 E4A3 280C
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050131120623.GA10752>