Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: gregg_a_g on July 31, 2011, 07:35:23 PM

Title: nfs-server
Post by: gregg_a_g on July 31, 2011, 07:35:23 PM
Recently got TC installed on a low-end mini-ITX.  Reading a lot and understand basic TCE/Install concepts. 

Installed (on-boot) filesystems-2.6.33.3-tinycore.tcz, nfs-utils

/etc/exports ------
      /mnt/sda1     *(rw,insecure,all_squash,anonuid=65534,anongid=65535)

/etc/hosts.allow -------------
       ALL: ALL

Started services --    portmap, nfs-server

exportfs produces
      /mnt/sda1      <world>

192.168.1.11 (is the TC box)
192.168.1.3 (is a Mint-Debian box)

On Mint-Debian box
mount -t nfs 192.168.1.11:/mnt/sda1 /media/MyBook  produces

mount.nfs access denied by server while mounting ...


If I setup the server on the Mint-Debian box (identical to steps above) and run the
nfs-client on the TC box everything works as expected. 

Just can't get the nfs-server working on the TC box (or I have another problem on the Mint-Debian).

Any ideas?  I really want to use the TC box as an NFS server, print/scan server (using net SANED
and CUPS).  I thought the NFS part would be easy since I have it working on a couple of other boxes.

Thanks in advance!

Title: Re: nfs-server
Post by: curaga on August 01, 2011, 02:36:34 AM
Anything in server logs? (you may need to start syslog for that)
Title: Re: nfs-server
Post by: Rich on August 01, 2011, 03:16:10 AM
Hi gregg_a_g
The error message suggests that the server is running but you are not authorized to access it.
Maybe a user/group permission problem?
Title: Re: nfs-server
Post by: curaga on August 01, 2011, 04:05:10 AM
Also, your group id looks wrong?
Title: Re: nfs-server
Post by: gregg_a_g on August 01, 2011, 08:11:02 AM
Thanks, everyone.  I'll try to get syslog installed this afternoon and look at the logs.  What groupid would you suggest?  I found a post suggesting these values (but I did try without "anonuid" or "anongid" options at all).

I thought there might be a permission problem, but with the "all_squash" option I thought that would take care of permissions.

I'll also try "grep root /etc/passwd" and "grep root /etc/group" to try and find the right uid and gid.
Title: Re: nfs-server
Post by: curaga on August 01, 2011, 09:21:58 AM
syslog is in the base, you just need a bootcode to start it (or you can start it manually).
Title: Re: nfs-server
Post by: gregg_a_g on August 01, 2011, 03:18:49 PM
Okay, I got syslog running.  dmesg doesn't show any new messages when I try to mount with the nfs-client on my mint box.  ??? scratching my head at this point.  Turns out 65534 is the uid for nobody, and 65534 is the gid for nogroup (I had 65535 before, but it didn't seem to make a difference).  I'm wondering if there is a way to run "rpcinfo"?  I didn't see any mention of it in the available apps, nor can I find it in the base so far.

I'll google some more!
Title: Re: nfs-server
Post by: Rich on August 01, 2011, 03:28:40 PM
Hi gregg_a_g
Rpcinfo is in  glibc_apps.tcz
Title: Re: nfs-server
Post by: curaga on August 02, 2011, 01:32:02 AM
Not dmesg, /var/log/*
Title: Re: nfs-server
Post by: gregg_a_g on August 03, 2011, 07:15:13 AM
I looked in /var/log/messages (only file besides autologin and wtmp) and see
various messages, but never anything when I try to mount from another machine.
In other words, I never see any "sign" that an attempt was made to mount. 

rpcinfo -p shows nfs (2,3 and 4) look like they're running...

I rebooted with "norestore, base" and then used tce-load to add
filesystems and nfs-utils.  Reset exports, etc.  Still not working.

hmmm...
Title: Re: nfs-server
Post by: gerald_clark on August 03, 2011, 09:11:45 AM
Did you run '/usr/local/etc/init.d/nfs-server start' ?
Title: Re: nfs-server
Post by: gregg_a_g on August 03, 2011, 09:48:11 AM
Sure.  I tried running /usr/local/etc/init.d/nfs-server start, "starting" the server from the
"services" icon on the wbar, etc.  The "green light" show up on the services window, and
if is do "ps -e | grep nfs" I see several nfsd daemons running.  So I'm pretty sure the
server is actually running.  I also see portmap, mount, stat etc.
Title: Re: nfs-server
Post by: gregg_a_g on August 03, 2011, 06:04:57 PM
More info.  I don't see any "messages" in /var/log/messages when I try to mount from my Mint-Debian box.  On the Mint-Debian box I get the error message "mount.nfsd ... connection refused.

However, I can do the following from the TC box:

sudo mkdir /mnt/hda1/testnfs
sudo mount /dev/sda1 /mnt/sda1 (this is an external usb drive)

sudo mount -t nfs 192.168.1.11:/mnt/sda1 /mnt/hda1/testnfs

This mount works!  I can see the nfs mount using "df".  Also, if I
"tail /var/log/messages" I can see "box daemon.notice mountd[2509] : authenticated mount request ....

SO, it looks like the nfsd is running okay, but for some reason the "mount request" from my Mint-Debian box is not making it to the TC box.

I'm perplexed because I setup ssh on the TC box and the Mint-Debian box and I can "ssh login" in both directions....

Is there some other "permission" I need to set on the TC box? 

Thanks again!  BTW, you guys are doing a great job.  This is a terrific distro!
Title: Re: nfs-server
Post by: gregg_a_g on August 05, 2011, 08:55:40 PM
 :-[  Success!

Well after looking over all the online documents, checking and double checking my configurations, etc.,
I decided to start with a clean slate. 

On the little mini-ITX box I copied /mnt/hda1/tce/optional to a USB stick.

On the Mint-Debian box, I booted with the TinyCore 3.7 CD.  After boot I used AppBrowser to install (using "local" and the USB stick") filesystems-2.6.33.3-tinycore and nfs-utils.  Started portmap and nfs-client from the "system tools / services" menu. 

mount -t nfs 192.168.1.11:/mnt/sda1 /mnt/nfs-client1 and allw worked as it should!  I could even see
the "daemon.notice mountd authenticated mount request" in the /var/log/messages from syslogd!

I guess my Mint-Debian box is broken  :-[ or I have something misconfigured on that side.  The error
message I was getting made it look like the TC server was "refusing the connection" but now I'm pretty
sure the "request" was never making it to the TC server.

Anyway, now I have 2 TC boxes running and plan to to a hard drive install on the box running
Mint-Debian.  This has been a great learning process.  The more I study the architecture of your
distro, I can see lots of advantages and lots of flexibility.  Now I'm off to SANED and CUPS!

Thanks again for your great work and your help!  :)
Title: Re: nfs-server
Post by: Rich on August 05, 2011, 09:02:10 PM
Hi gregg_a_g
Quote
I guess my Mint-Debian box is broken   or I have something misconfigured on that side.  The error
message I was getting made it look like the TC server was "refusing the connection" but now I'm pretty
sure the "request" was never making it to the TC server.
Actually the request was making it there, otherwise it would not be refused, it would time out. It was
refused because TC did not like the way Mint-Debian was asking.
Title: Re: nfs-server
Post by: AliC on November 07, 2011, 04:52:27 AM
Hi,
in TCE 4.0.2, kernel 3.0.3
I couldn't find exportfs.ko.gz file in modules for nfs-server.
nfs-server service is OK but I need the access for nfs from remote.

There is this modules in kernel 2.6.29.
("/usr/local/lib/modules/2.6.29.1-tinycore/kernel/fs/exportfs/exportfs.ko.gz" in filesystems-2.6.33.3-tinycore.tcz)

But there isn't the exportfs.ko in new filesystems-3.0.3.tinycore.tcz packet
What can I do for nfs-server.

Thanks All.
Ali
Title: Re: nfs-server
Post by: curaga on November 07, 2011, 09:29:52 AM
Quote
CONFIG_EXPORTFS=y

Title: Re: nfs-server
Post by: AliC on November 08, 2011, 09:21:18 AM
Yes, it's true.  There is exportfs  in the new kernel.
//distro.ibiblio.org/tinycorelinux/4.x/x86/release/src/kernel/config-3.0.3-tinycore

But there are some problem.
Services are working.

root@box:/home/tc# /usr/local/etc/init.d/nfs-server start
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
nodev   nfsd
/usr/local/sbin/rpc.statd is already running
2164
nfs-server utilities are started.

root@box:/home/tc# exportfs
/tmp            <world>
root@box:/home/tc#

Remote side;
root@box:/home/tc# mount -t nfs 10.0.0.9:/tmp   /tmp/aaa/
mount: RPC: Remote system error - Connection refused
mount: mounting 10.0.0.9:/tmp on /tmp/aaa/ failed: Bad file descriptor
root@box:/home/tc#

Server side;
root@box:/home/tc# /usr/local/etc/init.d/nfs-server stop
stopped /usr/local/sbin/rpc.mountd (pid 3602)
ERROR: Module exportfs does not exist in /proc/modules
root@box:/home/tc#

nfs-server don't work.
is any problem between old kernel&appl to new kernel&appl?
Same services are working in my other ubuntu platform.
I want to carry platform to TC from ubuntu.
Are you running nfs-server in TC v4.0.2 ?
Can you help me?

Thanks.
Title: Re: nfs-server
Post by: Jason W on November 08, 2011, 11:31:44 AM
I will aim to test the nfs-server functionality in TC 4.x tonight, as mine is still running TC 3.x.
Title: Re: nfs-server
Post by: curaga on November 08, 2011, 12:21:42 PM
I did run a NFS server on tc4 a few days back, and remember having to launch things manually, guess the startup script needs a check.
Title: Re: nfs-server
Post by: AliC on November 08, 2011, 01:02:10 PM
I mounted the nfs connection when the open another terminal in the server side.
in the same machine, it is OK.

But in the another machine (remote),
root@kumru:~# mount 10.0.0.10:/mnt/sda1 /mnt/hd
mount.nfs: access denied by server while mounting 10.0.0.10:/mnt/sda1

-----
And I tried something else,
Remote machine did a TC.
Another remote TC client is WORKING. No problem.

Ubuntu had a previously.
But ubuntu nfs-client gives this msg -> "mount.nfs: access denied by server while mounting"

is the ubuntu's nfs client different? (what about others distribution.)
There is something interesting, when writing "mount IP:" then TAB, nfs paths are completing.
Execute the mount command, it gives the access denied.

this is the last condition.
Thanks again.
Title: Re: nfs-server
Post by: Jason W on November 08, 2011, 08:53:43 PM
It appears that nfs-utils will need an upgrade, along with some new required dependencies for the nfsv4 stuff.  I plan to get to it soon.
Title: Re: nfs-server
Post by: AliC on November 09, 2011, 04:29:58 AM
There are compatibility issues, such as...
I will wait the upgrade for the test.
Thanks.
Title: Re: nfs-server
Post by: Rich on November 09, 2011, 08:27:55 AM
Hi AliC
It sounds like you are having the same problem as gregg_a_g, and based on the time frame, he
would have been running TC3.x, so I don't think it's 4.x specific. If you want to get your hands dirty
and get some insight as to what's going on, you could install  Wireshark  on the server, it can decode
NFS packets. You could then compare a successful mount to a failed one.
Title: Re: nfs-server
Post by: Rich on November 09, 2011, 09:36:46 AM
Hi AliC
Just a thought, but are you running a firewall on your Ubuntu machine? If so, try mounting with it
disabled and see if the error message goes away or changes.
Title: Re: nfs-server
Post by: AliC on November 09, 2011, 12:10:44 PM
Hi Rich,
I don't use a firewall on my machine. The internet modem has it.
And I am using lubuntu on server, cilent side is ubuntu.
On the other hand is already running in the same way. I want to change only the distro of server.
My goal is to make a better mini nfs server without monitor and keyboard, for mediaserver.
Wireshark is good idea for the test.
Thanks.
Title: Re: nfs-server
Post by: Jason W on November 09, 2011, 10:02:40 PM
There are several new dependencies that come with supporting nfs4, and I have built those tonight.  I aim  to build the updated nfs-utils and test in the coming days.  Hopefully by the end of the week or sooner it will be resolved.
Title: Re: nfs-server
Post by: Jason W on November 09, 2011, 10:55:43 PM
I can't believe I overlooked it, simply installing the filesystems-`uname -r`.tcz extension provides nfs server functionality.  It is even in the info file that I wrote way back when but forgot about.  installing that filesystems extension solves the issue.

There are a lot of new dependencies of nfs-utils in it's latest version to support nfsv4.  I was rewriting the /usr/local/etc/init.d scripts to accomodate the new changes and getting ready to build the updated nfs-utils package when I tried the filesystems extension.  For now I much prefer to stick with the old packages that work for general use and are much smaller with less dependencies.  Or at least this buys me some time to build and test a new nfs-utils package without being in a mad rush.  Install filesystems-`uname -r`.tcz and all should be well.

Oh, and there is not a 'startup script', but rather a /usr/local/etc/init.d script that is used to start or stop the service at the users control.  Nothing should have to be done manually, but let me know if otherwise.

Title: Re: nfs-server
Post by: gerald_clark on November 09, 2011, 11:40:15 PM
I am unable to mount a directory exported from tc.
The program 'exportfs' does not work properly. Note the peculiar error message with "test-client-(rw"

root@laptop:/home/tc# exportfs 192.168.0.0/24:/opt
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/opt".
  Assuming default behaviour ('no_subtree_check').
  NOTE: this default has changed since nfs-utils version 1.0.x

exportfs: /proc/fs/nfs/exports:1: unknown keyword "test-client-(rw"

Title: Re: nfs-server
Post by: Jason W on November 10, 2011, 12:18:39 AM
The "test-client-(rw" error you are seeing is one I have seen, until I set up my box correctly.  And the exportsfs error you are seeing is just a reminder that it is applying the default behavior ((Assuming default behaviour ('no_subtree_check').)) .   The test-client-(rw error seems to be harmless, though, and documented here:

https://bugs.gentoo.org/show_bug.cgi?id=353717

I have nfs server and client working across my TC 4.x machines.  Here is some of my relevant info:

/etc/exports:
Code: [Select]
/mnt/sdb1 192.168.0.*(rw,no_root_squash,fsid=32)

Empty /etc/hosts.allow

filesystems-3.0.3-tinycore.tcz installed

/usr/local/etc/init.d/nfs-server start

That is pretty much it, hope it provides some usefulness.  But I am seeing both client and server use of nfs-utils in TC 4.x.
Title: Re: nfs-server
Post by: gerald_clark on November 10, 2011, 01:01:51 AM
Thank you.  I just needed to add "-o vers=3" to my mount command.
Title: Re: nfs-server
Post by: Jason W on November 10, 2011, 07:54:13 AM
Yeah, I think that having both nfs3 and nfs4 in the kernel may be adding some details we did not have to consider before. 
Title: Re: nfs-server
Post by: curaga on November 10, 2011, 10:51:49 AM
Yeah, my terminology wasn't entirely correct. I also got that error, and it was solved by manually mounting the nfsd dir. The init.d script failed to mount it for some reason.
Title: Re: nfs-server
Post by: Jason W on November 10, 2011, 05:12:30 PM
My bad, I should have known what you meant by start script init.d and not tce.installed.  :)