# smbmount in fstab?

## dementor720

This command works fine for me:

smbmount //seehhh7/d\$ /mnt/seehhh7 -o "username=admin/seehhh"

but how do I apply this to my fstab so that it does this when booting. What is the correct syntax for fstab to match above?

 + I need to specify password. Also preferable I would like all my users to be able to unmount the above.

----------

## nobspangle

maybe not the most secure way but

```
//seehhh7/d\$       /mnt/seehhh7        smbfs         username=admin/seehhh,password=mypass     0    0
```

----------

## fostix

Hi,

I put into fstab what was suggested.

I then tried the smbmount //seehhh7/d\& etc as suggested.

I get an error message that includes:

Can't find include file /etc/samba/smb.conf.

opts: username=admin/seehhh

mount.smbfs started (version 3.0.5)

resolve_lmhosts: Attempting lmhosts lookup for name seehhh<0x20>

name_resolve_bcast: Attempting broadcast lookup for name seehhh<0x20>

8108: Connection to seehhh failed

I have obviously missed something

Could someone tell me about this /etc/samba/smb.conf. file?

Where does it live and what needs to go into it?  

Should I add something in my /etc/hosts file for seehhhh?  If so what?

Thanks

fostix

MB connection failed

 :Sad:   :Sad:   :Sad:   :Question:   :Very Happy:   What to do to get the "MB connection" working?

----------

## jayc

Just do mount /mnt/seehhh7 as root, or reboot and it'll be mounted at startup.

----------

## fostix

Hi,

I have tried mounting as root several different ways getting different error messages that always end in failed to mount //seehhh7.  The one consistent part of the error message is:

Can't find include file /etc/samba/smb.conf.

I can't find much documentation on an include file.  My current guess is that this include file that I don't seem to have is the current problem.

Thanks for your help.

fostix

----------

## dementor720

smb.conf?

Are you sure that you have samba installed? The above file is where you configure things like domain and workgroup in samba.

emerge samba

----------

## nobspangle

try using the IP address of the seeh7 server instead of the name or put an entry in your /etc/hosts also you might want to 

```
touch /etc/samba/smb.conf
```

which will probably get rid of the smb.conf error

----------

## nobspangle

as I found out here smbmount relies on samba.

----------

## fostix

Thanks Guru and all,

I believe that samba is installed, but (in case - how do I know!) I emerged samba again.

I changed things in the fstab file to correspond with my real-life computers and:

```
mount -t smbfs //dimension4400/c /mnt/dimension4400
```

  and get the familiar error message:

root@asuslaptop rf # mount -t "smbfs //dimension4400/c /mnt/dimension4400

Can't find include file /etc/samba/smb.conf.

opts: rw

mount.smbfs started (version 3.0.5)

added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0

added interface ip=192.168.0.2 bcast=192.168.0.255 nmask=255.255.255.0

can't determine netmask for 192.168.0.5

can't determine netmask for 192.168.0.8

Connecting to 192.168.0.1 at port 445

Password:

Anonymous login successful

7134: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid share name)

SMB connection failed"

I can't find any information on this include file  /etc/samba/smb.conf.  (yes I have a /etc/samba/smb.conf file - without the trailing period) 

So I must be the only one who worries about an include file.  With our without it seems that I still can't connect to the W2K machine from my notebook runing Gentoo Linux  2.6.7-gentoo-r11.

touch /etc/samba/smb.conf made no difference. 

Any suggestions will be valued and tried   :Exclamation: 

Thank you   :Laughing: 

fostixLast edited by fostix on Tue Aug 31, 2004 6:12 pm; edited 1 time in total

----------

## dementor720

Is your C drive really shared? Check again. is it called C? Check again

this is the line I have in my /etc/ftstab. in smb.conf I have just specified my domain name in workgroup settings although im not sure that matters if you have the correct settings in fstab

//mymachine/d$ /mnt/mymachine smbfs username=admin/mydomain,password=bennyhill 0 0

the reason i have d$ is that it is a hidden share. in your case leave out the $ sign.

----------

## fostix

dementor720,

Thank you for your reply.  Yes my C drive is really shared.  It has a hand symbol under it and I can network it OK with the windows machines.  I have the correct drive name (after correcting it!).  I have removed the $ from the fstab file.  However the same mount attempt (with corrected fstab file) gives the same results:

 mount -t smbfs -o debug=4 //dimension4400/XPSC /mnt/dimension4400

gives the same error results:

"Can't find include file /etc/samba/smb.conf.

opts: rw

opts: debug=4

mount.smbfs started (version 3.0.5)

added interface ip=127.0.0.1 bcast=127.255.255.255 nmask=255.0.0.0

added interface ip=192.168.0.2 bcast=192.168.0.255 nmask=255.255.255.0

can't determine netmask for 192.168.0.5

can't determine netmask for 192.168.0.8

resolve_wins: Attempting wins lookup for name dimension4400<0x20>

wins_srv_is_dead: 127.0.0.1 is alive

resolve_wins: using WINS server 127.0.0.1 and tag '*'

nmb packet from 127.0.0.1(137) header: id=28027 opcode=Query(0) response=Yes

    header: flags: bcast=No rec_avail=Yes rec_des=Yes trunc=No auth=Yes

    header: rcode=3 qdcount=0 ancount=1 nscount=0 arcount=0

    answers: nmb_name=DIMENSION4400<20> rr_type=32 rr_class=1 ttl=0

Negative name query response, rcode 0x03: The name requested does not exist.

resolve_lmhosts: Attempting lmhosts lookup for name dimension4400<0x20>

getlmhostsent: lmhost entry: 127.0.0.1 localhost

name_resolve_bcast: Attempting broadcast lookup for name dimension4400<0x20>

nmb packet from 192.168.0.1(137) header: id=15945 opcode=Query(0) response=Yes

    header: flags: bcast=No rec_avail=No rec_des=Yes trunc=No auth=Yes

    header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0

    answers: nmb_name=DIMENSION4400<20> rr_type=32 rr_class=1 ttl=300000

    answers   0 char ....*(......   hex 00000A012A280000C0A80001

Got a positive name query response from 192.168.0.1 ( 10.1.42.40 192.168.0.1 )

Connecting to 192.168.0.1 at port 445

7159: session request ok

Serverzone is 25200

Password:

Anonymous login successful

7159: session setup ok

7159: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)

SMB connection failed"   :Sad: 

Looking at the error ERRDOS - access denied - is there something else I should do with the Win2K windows machine I am trying to network with?  If so what?  I can ping the windows machine OK.  It is trying to mount the shared directory that comes to grief.  :Sad: 

Thanks for your help   :Smile: 

fostix

----------

## Furtim

Hi fostix

I would look at your network setting first

/etc/hosts

127.0.0.1	localhost your_machine_name

192.168.0.2    your_machine_name

entry for dimension4400

/etc/samba/lmhosts

127.0.0.1 localhost

entry for dimension4400

Sample of ( only needed if you want to share on your Linux box )

/etc/samba/smb.conf

[global]

workgroup = HOME

netbios name = furtim-2

server string = Samba

security = user                      #user must be a unix & samba user (adduser name & smbpassed -a username)

password level = 8

encrypt passwords = yes

[Share]

comment = Shared Files

path = /mnt/share

browsable = yes

writable = yes                      

create mask = 744                   #files are owned by creator

directory mask = 755

force group = users

locking = yes

command to try

mount -t smbfs -o username=your_name,password=your_pass //dimension4400/XPSC /mnt/dimension4400

Make sure your share on the win2k box is the right name = XPSC  ?

Better to create folders and share them and make sure you have read/write privalages on what you share.

Hope this helps

----------

## fostix

 :Laughing:   Thank You Furtim,

I did what you suggested and it works  :Exclamation: 

Still get the error message that it can't find the include file - but that does not seem critical.

I had never put anything in the lmhosts file (except local host).  What could be the critical thing was putting a [Share] entry into /etc/samba/smb.conf with the details suggested.

So I am very pleased that it now works.  :Smile: 

Thanks again,

fostix

----------

## Gauss_Cleric

Is there a way to let users mount shares? I could mount them at boot time but  in my case they're probably down (it's a home network) so that won't work.

I have an entry in /etc/fstab for those shares so that I can simply 

```
mount /mnt/share
```

 it but only as root.

Looking in man smbmnt I found that "smbmnt can be installed setuid root so that users can mount their shares" but I don't know what this mean.

Any sugestions? Cheers!

----------

## lysergicacid

dont know if this helps anyone but maybe huh :

```

# /etc/fstab: static file system information.

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.10 2002/11/18 19:39:22 azarah Exp $

#

# noatime turns of atimes for increased performance (atimes normally aren't

# needed; notail increases performance of ReiserFS (at the expense of storage

# efficiency).  It's safe to drop the noatime options if you want and to

# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/hda1               /                reiserfs        noauto,noatime,defaults,notail                  1 2

/dev/fd0                /mnt/fd0         auto            user,noauto                                     0 0

/dev/hdc                /mnt/cdrom       iso9660         noauto,ro,user                                  0 0

/mnt/swap/swap.img      none             swap            sw                                              0 0

proc                    /proc            proc            defaults                                        0 0

tmpfs                   /dev/shm         tmpfs           defaults,noexec                                 0 0

//FILESERVER/Mp3       /mnt/mp3         smbfs           username=mythtv,password=pass,rw,defaults         0 0

//FILESERVER/Films     /mnt/media/films        smbfs   username=mythtv,password=pass,rw,defaults                 0 0

//FILESERVER/Films1    /mnt/media/films1       smbfs   username=mythtv,password=pass,rw,defaults                 0 0

//FILESERVER/Vcd       /mnt/media/vcd   smbfs           username=mythtv,password=pass,rw,defaults                 0 0

//FILESERVER/Tv        /mnt/media/tv    smbfs           username=mythtv,password=pass,rw,defaults                 0 0

```

----------

## lysergicacid

 *Gauss_Cleric wrote:*   

> Is there a way to let users mount shares? I could mount them at boot time but  in my case they're probably down (it's a home network) so that won't work.
> 
> I have an entry in /etc/fstab for those shares so that I can simply 
> 
> ```
> ...

 

an entry in fstab like 

```
/dev/hda4  /mnt/hda4 vfat  user,noauto,defaults,umask=022,uid=1000,gid=100
```

would alow users to mount shares , where gid = group id of users and uid = the users id number thats going to mount the shares, or u could set 

```
/dev/hda4  /mnt/hda4 reiserfs user,auto,noatime,noexec,notail,defaults
```

 and change permissions on the directory to match the user that u want to write to it (ie all users would be able to see it but only the user who u set the folder to belong to would be able to write to it, depending on if its a linux fs that is (win fs dont let u set owenship of folders as far as i know)

----------

