Click to See Complete Forum and Search --> : Samba automount error


ezoooo
07-03-2002, 12:18 AM
Some strange error, can not figure out what is wrong.

Below is my fstab file.
As you can see I have line to automatically mount share of W2K server.

[root@linux72 root]# less /etc/fstab
LABEL=/ / ext3 defaults 1 1
/dev/hda1 /C vfat defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/cdrom1 /mnt/cdrom1 iso9660 noauto,owner,kudzu,ro 0 0
//w2k-server/LinuxShare /mnt/ntwrk/public smbfs credentials=/home/ezoooo/.smbpasswd,uid=500,gid=500 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0

However it doesn't mount it. If I issue command mount -a I have error (see below):

[root@linux72 root]# mount -a
execvp of smbmnt failed. Error was No such file or directory.smbmnt failed: 1

Meantime, when I issue smbmount command I have no problem. It is mounted and I can see it.
[root@linux72 root]# smbmount //w2k-server/LinuxShare /mnt/ntwrk/public/ -o credentials=/home/ezoooo/.smbpasswd

[root@linux72 root]# ls /mnt/ntwrk/public/
conf18-1.doc
conf18-3-1.doc
DIAGNOSIS.txt
Document.rtf
Dump1.doc
---------output cut------------

I tried to find it on Google, but there was no clear answer, so I kinda lost.

MarcRochkind
07-03-2002, 12:52 AM
Looks like smbmnt is not the path that mount is using, although smbmount can find it. First experiment would be to find it and add that directory to root's path. Then retry mount. If that works, that is part of your answer.

I am not sure what is going on during bootup, however. This may be a different problem entirely.

ezoooo
07-03-2002, 01:20 AM
Well, I checked it already.

Both smbmount and smbmnt located in /usr/sbin folder and it is in the PATH

Because I logged on as root I have all permissions to mount, but.....:confused:

It is something else.

cowanrl
07-03-2002, 04:53 AM
Can you tell if it's trying to mount the Samba share before networking is being brought up? That can be a problem with mounting Samba shares in /etc/fstab.
I'm mounting Samba shares with /etc/fstab using RH 7.3 but it seems to take care of being sure that the network is up and running before it attempts to perform the mount.

jaygee432
07-03-2002, 10:13 AM
I suggest you might come out ahead to abandon the idea of automounting samba by an entry in fstab. You can use samba just as easily by using a script that starts smbd and nmbd during booting. It's probably already there, just waiting to be uncommented in a file something like /etc/inetd.conf. It's been a long time since I knew just where that was in RH, you would have to look at your docs.

ezoooo
07-03-2002, 11:13 AM
Can you tell if it's trying to mount the Samba share before networking is being brought up?

I don't think it is an issue here, because output I presented was a screenshot of my terminal (with my comments inserted).
Booting process was completed already and network was up.

So it is clear that smbmount command worked immediately after mount -a failed.

What I'm trying to figure out which file in ...No such file... is missing or can not be found.
Is there any way to activate some kind of debug, so I can see all steps of mounting process?

Thanks

ezoooo
07-03-2002, 11:26 AM
I suggest you might come out ahead to abandon the idea of automounting samba by an entry in fstab

Well, of course I can abandon this idea, but being newbie in Linux I am trying to understand why other people can do it but I can't.
Any inconsistencies in behavior of OS are not acceptable.
Admiration of Linux should be based on stability and manageability, but not on constant challenge of resolving problems.
Everything I learn I must understand (not just memorize). I don't like surprises on production network that can bring downtime.

Good administrator should have answers for most questions

Thanks

cowanrl
07-03-2002, 02:27 PM
I'm using Red Hat 7.3 here with Samba version 2.2.3a. I'm mounting a Samba share on a Red Hat 7.2 box and a share on an NT 4 server from my fstab file. The commands in my fstab file are identical to yours except for the server/sharename and mountpoint. I don't have a Win2k machine available to test on to see if there are any specific problems with it. I would make sure you are using the latest version of Samba when using it with Win2k though.

I tried adjusting permissions on the mountpoint directories and it didn't change anything. Both mounts suceeded.

There are a few log files that may give you some clues as to what's going on. /var/log/messages will tell you for sure if networking is coming up before your Samba shares are mounted. An excerpt from my /var/log/messages looks like this:

Jul 3 13:37:11 dads-linux fsck: /boot: clean, 46/12048 files, 14927/48163 blocks
Jul 3 13:37:11 dads-linux fsck: /home: clean, 2583/5275648 files, 215468/10538632 blocks
Jul 3 13:37:11 dads-linux rc.sysinit: Checking filesystems succeeded
Jul 3 13:37:12 dads-linux rc.sysinit: Mounting local filesystems: succeeded
Jul 3 13:37:12 dads-linux rc.sysinit: Enabling local filesystem quotas: succeeded
Jul 3 13:37:12 dads-linux rc.sysinit: Enabling swap space: succeeded
Jul 3 13:37:15 dads-linux init: Entering runlevel: 3
Jul 3 13:37:16 dads-linux kudzu: Updating /etc/fstab succeeded
Jul 3 13:37:22 dads-linux kudzu: succeeded
Jul 3 13:37:22 dads-linux sysctl: net.ipv4.ip_forward = 0
Jul 3 13:37:22 dads-linux sysctl: net.ipv4.conf.default.rp_filter = 1
Jul 3 13:37:22 dads-linux sysctl: kernel.sysrq = 0
Jul 3 13:37:22 dads-linux sysctl: kernel.core_uses_pid = 1
Jul 3 13:37:22 dads-linux network: Setting network parameters: succeeded
Jul 3 13:37:22 dads-linux network: Bringing up loopback interface: succeeded
Jul 3 13:37:23 dads-linux ifup: Determining IP information for eth0...
Jul 3 13:37:23 dads-linux ifup: done.
Jul 3 13:37:23 dads-linux network: Bringing up interface eth0: succeeded
Jul 3 13:37:28 dads-linux netfs: Mounting SMB filesystems: succeeded
Jul 3 13:37:28 dads-linux netfs: Mounting other filesystems: succeeded
:f

You can see that the network interfaces came up before the SMB filesystems were mounted.

Another log file you should have is /var/log/smbmount.log. Mine contains a record of everytime a share was mounted. Take a look at it and see if there are any error messages in there.

Another thing I've read about that can cause problems automounting Samba shares is if the share isn't explicitly unmounted when the system is shutdown. It can cause problems mapping the share again the next time the system boots up. Try to umount the Samba share before you restart the system.

Other than that, I don't have an answer as to why yours won't work at boot up.

ezoooo
07-03-2002, 03:24 PM
Thank you cowanrl.
I know /var/log/messages file and I scrolled through it, but I don't remember exactly if network starts before or after SMB.

Is there any way to change that sequense?

I'm at work and Linux box is at home, so I will look tonight.
Meantime if you know the answer for above question, please reply.

Thank you for support.

jumpedintothefire
07-03-2002, 03:40 PM
so you pulled that from:

http://linuxnewbie.org/forum/showthread.php?s=&threadid=42967

Well you have it working outside ftab no problems, that is good.
I have not used a credential file, but I don't think it should be to hard to figure out.

Lets take the password file out of the picure, in fstab first try:

//w2k-server/LinuxShare /mnt/ntwrk/public smbfs username=xxx,password=xxx 0 0

then try mounting it with mount -a -v (v for verbose)
That should work.

next try it with a simple combo with the password file:

//w2k-server/LinuxShare /mnt/ntwrk/public smbfs credentials=/home/ezoooo/.smbpasswd 0 0

Because I logged on as root I have all permissions to mount, but.....

If that fails, what are the permissions set to on that .smbpasswd file?

ezoooo
07-03-2002, 04:07 PM
Lets take the password file out of the picture, in fstab first try:

//w2k-server/LinuxShare /mnt/ntwrk/public smbfs username=xxx,password=xxx 0 0

..........

next try it with a simple combo with the password file:

//w2k-server/LinuxShare /mnt/ntwrk/public smbfs credentials=/home/ezoooo/.smbpasswd 0 0


I already tried both options, don't work either.

Also look at my original message in this thread:



when I issue smbmount command I have no problem

Command performs very similar operation and DOES work.
Only mounting from fstab failed.
This btw should eliminate network start sequence issue


Thanks

jumpedintothefire
07-03-2002, 04:31 PM
Is there any way to change that sequense?

Yes, chkconfig sets the sequence, the lower the number the sooner it starts, see man chkconfig. There may be gui tools with your distro, that will change the run level for you, just remember the lower the number the sooner it starts.

But that is not the problem, on bootup mount is called by rc.sysinit, then control is turned over to chkconfig, but it should only mounts local filesystems. RedHat 7.2 and later has a netfs file (see the output posted by cowanrl) in /etc/rc.d/init.d that mounts the network filesystems after the network is up. What distro are you using??
What version of mount and samba are installed?

You could just run the mount command from rc.local, if all else fails.

ezoooo
07-03-2002, 04:41 PM
I'll take a look tonight and post a result.

Thank you guys

ezoooo
07-03-2002, 10:26 PM
Guys, I got it!!! Everithing works.
The problem was surprisingly based on totally different thing than everybody thought.

I checked all options advised me in this thread, nothing was wrong.
mount -a -v did not work telling me that -v is invalid option.
I inspected /var/log/messages and found that network come up before SMB started. So that was not an issue.
So I start to think what can prevent mount to start (remembering about PATH).
mount is located in /bin. I assumed that mount can not find smbmnt in /bin, so I added 2 symlinks:

ln -s /usr/sbin/smbmnt /bin/smbmnt and
ln -s /usr/sbin/smbmount /bin/smbmount.

Wow, I found that mount -a start to work.
I reboot and .....NO PROBLEMS!!!. Automount works!!!

So now I can place this very valuable info to my knowledge base.

Thank you all. I am happy camper!:D

cowanrl
07-03-2002, 10:50 PM
In Red Hat 7.2&3 there are 2 links in the /sbin directory that point to /usr/bin/smbmount. They are named mount.smb and mount.smbfs. They are probably accomplishing the same thing the links you created are doing. I guess each distro is different.

ezoooo
07-03-2002, 11:34 PM
I am running RH7.3.
Symlinks that cowanrl mentioned are in /sbin, but mount is in/bin folder. So that is probably the reason why mount could not find smbmnt .
It is quite strange btw, because /usr/sbin /usr/bin /bin and /sbin are all in the PATH

Anyway. It works

cowanrl
07-05-2002, 01:51 PM
I have discovered one problem that may crop up. I just downloaded the latest version of Samba(2.2.5-1) as an RPM package from Samba.org. I removed the version that came with Red Hat 7.3(2.2.3a) and installed the new one. There's one major difference in the install that is going to cause some guys fits(the ones who haven't seen this thread)

I tried to use smbmount as a normal user and I got the same error message that ezooo was getting. I did some checking and under previous versions of Samba(at least on Red Hat) smbmount, smbmnt and smbumount were installed in /usr/bin. With the rpm package I downloaded from Samba.org, smbmount, smbmnt and smbumount are installed in /usr/sbin

Even after using the command "chmod u+s /usr/sbin/smbmnt" so that normal users can mount shares, I got the same error message the ezoooo got. Since /usr/sbin is not in the normal users path, smbmount couldn't find smbmnt. My fix was pretty much the same as what ezoooo did. I put the soft links in /usr/bin instead of /bin. It accomplishes the same thing since they are both in normal users paths by default.

Thank goodness I had already been to school on ezooo. It would have driven me crazy trying to solve this problem without having been involved in this thread.

ezoooo
07-05-2002, 02:27 PM
I removed the version that came with Red Hat 7.3(2.2.3a) and installed the new one
Did you check if SWAT works?
I had Samba-2.2.4 and could not start SWAT with error in browser:
Connection to 127.0.0.1 is broken
Whatever I did I could not start it. Finally (as experiment) I uninstall v2.2.4 (1 rpm packet has all components) and install v2.2.3a-6 (4 packages) from distro. I also checked /etc/services for line swat 901/tcp. It was not there, so I added it. Next step I ran netstat -an |grep 901 to make sure that port 901 has LISTEN state. Checked /etc/xinitd/swat and changed disable = yes to disable = no. Changed smb status to on with chkconfig --level 2 smb on (and also levels 3, 4, 5). Reboot.

SWAT start working.

Tonight I'll inspect location of all files in distro 2.2.3a-6 and try to reinstall 2.2.4 back. At least I know that problem is not kernel related and hidden somewhere in samba distro.

I'll post a result.

cowanrl
07-05-2002, 04:47 PM
I had just logged in to LNO to see if I can find help with SWAT. I normally don't use it, I just manually edit the smb.conf file. However, there are a lot of questions on this site about it so I figured I learn how to use it.
After installing 2.2.5-1, I can't get SWAT to start. I'll try your suggestions to see if it starts. I know there was a post on this site not too long ago about SWAT, I'm gonna search and see if I can find it.

cowanrl
07-05-2002, 06:34 PM
Well, I figured out what was keeping SWAT from working but I'm not sure why.
Everything acted like SWAT should be working so I changed the "only from" line in /etc/xinetd.d/swat from localhost(the default) to the IP address of another computer on my network. Lo and behold, when I tried to access SWAT from that, machine, it let me in and everything worked!
So, I changed it to the IP address of the machine SWAT is running on and accessed it from that machine and that worked. I then changed it to 127.0.0.1 and I was able to access it too, even using http://localhost:901.

For some reason, when you use "only allow = localhost" it doesn't work, even if /etc/hosts has the proper entry for it.

jumpedintothefire
07-05-2002, 07:11 PM
from man xinetd.conf:


only_from determines the remote hosts to which the
particular service is available. Its
value is a list of IP addresses which can
be specified in any combination of the
following ways:

see the man page for all the details.


On a side note /etc/hosts.deny and /etc/hosts.allow seem to have no effect on xinetd services. Maybe only_from has replaced /etc/hosts.allow and /etc/hosts.deny for access control for xinetd services. Can anyone confirm that this should (not?) happen?

cowanrl
07-05-2002, 11:12 PM
I didn't create the original /etc/xinetd.d/swat file, it was placed there by the installation routine.
I ASSumed that only_from = localhost should be correct. Live and learn I guess.

ezoooo
07-06-2002, 02:58 AM
Differences between samba v2.2.3a-6, 2.2.4-2 and 2.2.5-1
I did not compare documents and manuals files, because it is not really important.
So below are differences:
V2.2.3a-6 has files that are missing in v2.2.4-2. Blue lines are the most important difference
/etc/rc.d/init.d/winbind (this file is missing in 2.2.4-2, but exists in 2.2.5-1)
/etc/sysconfig/samba
/etc/X11/applnk/System/swat.desktop
/etc/xinetd.d/swat
/lib/libnss_winbind.so.2
/lib/security/pam_smbpass.so
/usr/bin/smbadduser
/usr/bin/smbmnt
/usr/bin/smbmount
/usr/bin/smbumount
/usr/include/libsmbclient.h
/usr/lib/libsmbclient.a

4-2 has files that don’t exist in 3a-6, blue files moved to different folder
/etc/samba/samba.stack
/etc/samba/samba.xinetd
/usr/sbin/smbmnt (these 3 files are in the same location in v2.2.5-1)
/usr/sbin/smbmount
/usr/sbin/smbumount
/var/run/samba

Besides that folder codepages with all files inside moved from /usr/share/samba/codepages (v.3a-6) to /etc/codepages (v2.2.4-2)

5-1 has some new files comparing to 4-2:
/etc/rc.d/init.d/winbind
/etc/samba/recycle.conf
/etc/samba/samba-block.conf
/lib/security/pam_smbpass.so
/usr/include/libsmbclient.h
/usr/lib/libsmbclient.a
/usr/lib/libsmbclient.so
/usr/lib/samba/vfs/audit.so
/usr/lib/samba/vfs/block.so
/usr/lib/samba/vfs/recycle.so

I uninstall v2.2.3a-6 and install v2.2.5-1. After reinstallation I tried SWAT, but it did not work from first attempt, however it started after second one.
I still don’t know why I could not start it with v2.2.4-2.

I think this research is finished. Everything works. I can see and access Linux box from W2K Server and vice versa.

Btw, I left only_from = localhost in /etc/xinetd.d/swat as is and it works

Thanks

jumpedintothefire
07-06-2002, 10:44 AM
Sounds like 2.2.4-2 had some problems parsing the /etc/hosts file to resolve localhost properly

just a thought......

ezoooo
07-07-2002, 07:19 PM
Well, guys
After all seems to be successful actions, I found again that my SWAT doesn't work.
Nothing changed!!! but I again can not start SWAT with error in browser: Connection to 127.0.0.1 is broken

Something is wrong and it drives me nuts.
It seems to me that there is a bug somewhere, but I can NOT find it.

Samba itself works fine.
Port 901 is in LISTEN state
SWAT is enabled, Status is on
mapping from localhost to IP address works
WINS works

I also found that file /var/log/secure has whole bunch of entries that are just repetitions of all my attempts to start SWAT such as:
------------
Jul 7 16:43:53 linux72 xinetd[722]: START: swat pid=1199 from=127.0.0.1
Jul 7 16:43:53 linux72 xinetd[1199]: FAIL: swat address from=127.0.0.1
Jul 7 16:58:03 linux72 xinetd[722]: START: swat pid=1631 from=127.0.0.1
Jul 7 16:58:03 linux72 xinetd[1631]: FAIL: swat address from=127.0.0.1
---------
Does anybody know how to debug that process?
It is not critical to start SWAT to make Samba work, but I want to understand internal kitchen.

Thanks

jumpedintothefire
07-07-2002, 08:32 PM
Does the problem go away if you restrart xinetd?

Try what cowanrl did, replace localhost with 127.0.0.1, maybe there is a reverse dns lookup taking place and failing.....

So what version of samba is loaded now??

ezoooo
07-07-2002, 11:22 PM
So what version of samba is loaded now??
I use latest 2.2.5-1.
So let's continue our SWAT research.
So far everything is weird. I start to play with swat file and added two lines (red)

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
# to configure your Samba server. To use SWAT, \
# connect to port 901 with your favorite web browser.
service swat
{
port = 901
socket_type = stream
wait = no
only_from = localhost
only_from = 127.0.0.1
only_from = linux72 #this is a NetBIOS name
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = no
}

I restart smb and xnetd services and found that SWAT works, but now it start without asking me to logon as root. Usually it asked user name and password even if I was root.
I removed only_from = linux72 line, restarted services and ..... found that SWAT doesn't start.
I restored only_from = linux72 line ....works again... no logon.
So what a heck is it? Perhaps it is already good reason to ask Samba team?

Well I think I'll email them this thread.

Thanks

jumpedintothefire
07-08-2002, 12:33 AM
Maybe the browser is caching the login info???

Found this:

http://lists.samba.org/pipermail/samba/2002-June/075147.html

ezoooo
07-08-2002, 11:31 AM
Maybe the browser is caching the login info???

Found this:

http://lists.samba.org/pipermail/sa...une/075147.html
Thank you for link. It is actually gives a lot of information.
What is strange, that NOBODY out of Samba team even tried to pass changes to users. Man pages are old and not updated at all!