Can not auto mount a NAS using smb

Hello, I have running already an auto mount service. In fact it mounts on access a NAS with NFS, now I have another NAS that uses samba with user and password. So in my /etc/auto_master I have this:

Code:
#/media         -media          -nosuid
#/-             -noauto
/- auto_example

So in /etc/auto_example I have this

Code:
/mnt/server    -intr,nfsv3            1.1.1.1:/share
/mnt/server2  -fstype=smbfs      ://@NAS/share

And in ~/.nsmbrc

Code:
[SERVER:USER]
password=passxxx
[SERVER2:USER2]
password=pass2xxx

So it works perfect with NFS but it is not working with Samba.

Also it works if I mount it manually like this:

Code:
mount_smbfs -N -I 2.2.2.2 //@NAS/share/files /mnt/server2


When I try to ls it shows no files so is not working with auto mount. Can someone help me please.
 
Try using the IP address instead of NAS. The manual command you used connects directly to an IP address (-I 2.2.2.2). The reason it's not automounting may be due to name-resolving issues.
 
Try using the IP address instead of NAS. The manual command you used connects directly to an IP address (-I 2.2.2.2). The reason it's not automounting may be due to name-resolving issues.

I changed inside /etc/auto_example to

Code:
/mnt/server2  -fstype=smbfs      ://2.2.2.2/share

Not working also.
 
Is there anything in /var/log/messages? I would expect to see some errors, the exact error may shed some light into the cause. Also check the 'receiving' end; the Samba logs. Look for connections being initiated, or not.
 
Is there anything in /var/log/messages? I would expect to see some errors, the exact error may shed some light into the cause. Also check the 'receiving' end; the Samba logs. Look for connections being initiated, or not.

No, I have nothing about this inside the logs which is weird, it is like is doing nothing.
 
Try running the automountd(8) by hand and add the -d option. That should keep it on the foreground and produce some debug output. Then trigger the automount and watch what happens.
 
Try running the automountd(8) by hand and add the -d option. That should keep it on the foreground and produce some debug output. Then trigger the automount and watch what happens.

I first stop automountd(8) then did automountd -d and in another console I did an ls from the folder but nothing, so I tried with the other NAS that use NFS and it worked in the way I got messages from automountd(8)

So, it gives nothing with smbfs, it has to be something wrong.
 
Hello, I have running already an auto mount service. In fact it mounts on access a NAS with NFS, now I have another NAS that uses samba with user and password. So in my /etc/auto_master I have this:

Code:
#/media         -media          -nosuid
#/-             -noauto
/- auto_example

So in /etc/auto_example I have this

Code:
/mnt/server    -intr,nfsv3            1.1.1.1:/share
/mnt/server2  -fstype=smbfs      ://@NAS/share

And in ~/.nsmbrc

Code:
[SERVER:USER]
password=passxxx
[SERVER2:USER2]
password=pass2xxx

So it works perfect with NFS but it is not working with Samba.

Also it works if I mount it manually like this:

Code:
mount_smbfs -N -I 2.2.2.2 //@NAS/share/files /mnt/server2


When I try to ls it shows no files so is not working with auto mount. Can someone help me please.


Just for the records, I found the error here trying to do the same and I solved adding the user before the "@"
 
Back
Top