WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: NFS Client  (Read 20388 times)

Offline arcturus

  • Newbie
  • *
  • Posts: 6
NFS Client
« on: August 26, 2012, 12:33:04 PM »
Forgive me for this but I feel I have to ask someone who knows more than me on this...

How do I install NFS client and mount a freakin nfs share in microcore? I installed nfs-utils but I can't get it to work.
The command "sudo mount -t nfs 192.168.1.193:/media /mnt/nfs" will just give me:
"mount: 192.168.1.193:/media failed, reason given by server: permission denied"
"mount: mounting 192.168.1.193:/media on /mnt/nfs failed: Bad file descriptor"

I have a Ubuntu server sharing some media files in my network and it works fine when I connect to it from my kubuntu desktop machine...

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: NFS Client
« Reply #1 on: August 26, 2012, 02:05:43 PM »
"Permission denied", I take you've checked your server's logs and settings, that your TC machine is allowed to connect?
The only barriers that can stop you are the ones you create yourself.

Offline arcturus

  • Newbie
  • *
  • Posts: 6
Re: NFS Client
« Reply #2 on: August 26, 2012, 03:42:22 PM »
I'm working with the idea that there is something wrong with the server configuration after all, even though it works flawlessly when I connect to it with my desktop pc... Forgive me for asking trivial things here but I'm new to microcore, and there are less google hits for my mc problems then when I have issues with ubuntu :)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: NFS Client
« Reply #3 on: August 26, 2012, 09:58:43 PM »
Did you read the nfs-utils info fire regarding filesystem-`uname-r` ?
Did you run /usr/local/etc/init.d/nfs-server start on the server and nf-client on the client?

Did you create a proper /etc/exports on the server?

Offline arcturus

  • Newbie
  • *
  • Posts: 6
Re: NFS Client
« Reply #4 on: August 27, 2012, 12:29:47 PM »
The way I read the info about 'uname-r' made me think it was only relevant if I wanted to run an nfs server... Are you telling me I need that for my client too?

The nfs server starts at boot and is connecting fine with my kubuntu desktop machine. Changing IP in /etc/exports seems to have no effect on my kubuntu machine though. It mounts my nfs share happily whatever IP I use. Shouldn't this IP describe the adress I want to share a directory to? (Yes, I did tell the nfs server I edited /etx/exports with "exportfs -ra").

Khrmmm...  :-[ I kind of missed starting the nfs client on my mc box... Kubuntu did that for me after installing the client so I guess I thought mc would do that too... Anyway that did not change anything. Still the same error when trying to mount the nfs share...


My /etc/exports on server side:

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_sub$
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/export         192.168.1.247/24(rw,fsid=0,insecure,no_subtree_check,async)
/export/media   192.168.1.247/24(rw,nohide,insecure,no_subtree_check,async)



Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: NFS Client
« Reply #5 on: August 27, 2012, 12:53:40 PM »
Not being sure on how you run it off your ubuntu server, maybe you need to define it in hosts.allow, i do.

But you also say in between the lines that you did not need to do that with the other machine. Its only for inet or tcp wrapped services.

« Last Edit: August 27, 2012, 12:56:42 PM by ananix »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: NFS Client
« Reply #6 on: August 27, 2012, 01:59:28 PM »
Your exports file is incorrect.
    192.168.1.247/24 and 192.168.1.247/24
are neither machine addresses nor network addresses.


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: NFS Client
« Reply #7 on: August 27, 2012, 07:53:10 PM »
Hi arcturus
If these are your exports:
Quote
/export         192.168.1.247/24(rw,fsid=0,insecure,no_subtree_check,async)
/export/media   192.168.1.247/24(rw,nohide,insecure,no_subtree_check,async)
Shouldn't your mount command look more like:
Code: [Select]
sudo mount -t nfs 192.168.1.193:/export/media /mnt/nfsinstead of:
Quote
sudo mount -t nfs 192.168.1.193:/media /mnt/nfs

Quote
192.168.1.247/24
I'm not sure what that does, it might resolve to sub addresses 247-255.
I think this is legal:
Code: [Select]
192.168.1.0/24

Offline arcturus

  • Newbie
  • *
  • Posts: 6
Re: NFS Client
« Reply #8 on: August 28, 2012, 01:49:18 PM »
Thanks! I'm in a hurry now. Will reply later. You have given me several relevant ideas that I'll have to try...

Offline arcturus

  • Newbie
  • *
  • Posts: 6
Re: NFS Client
« Reply #9 on: August 30, 2012, 01:15:26 PM »
Thank you all! I finally got it working tonight. I had made several mistakes:

1.) The nfs-client had to be started with "sudo". It reports OK without sudo but it won't start... "./nfs-client status" said "nfs-client not running".
2.) My /etc/exports was indeed incorrect. I had tried a lot of different things here and left an invalid IP.
3.) I edited "hosts.allow" on my server to allow connections by "portmap" and "rpc.mountd" from any
     machine on my network (don't know if this was really needed though).
4.) Kind of forgot the non-persistent nature of tc/mc - my mountpoint /mnt/nfs had vanished since i created it...  :-[

The strangest thing in all this is how my kubuntu destop machine would just mount my share without any errors...

Again many thanks! Yep! I'm a bit of a newbie but with your help I solved this. Now my network music player box is
one step closer to reality  :)

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: NFS Client
« Reply #10 on: August 30, 2012, 01:41:03 PM »
excuse me for asking stupid question but are you sure the two ubuntu machines are not sharing files through samba?

Im starting to get the picture that you unto know have been more of a user and i imagine one could share a folder on ubuntu server like in windows with right click and thats what you did and maybe ubuntu per default shares to cifs not having to ask "do you wanna share with default support in a windows enviroment?" and just do so.
And maybe something along the same lines happens when you used the client probably something like nautilius to even browse there (no nfs then, unless yp).

Happy you got it to work nfs still also seems complex to me after 12years of usage but it always proves me wrong.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: NFS Client
« Reply #11 on: August 30, 2012, 01:42:24 PM »
You need to edit /opt/bootlocal.sh.
Add
/usr/local/etc/init.d/nfs-client start

You can also create your mount points here, and mount your nfs shares.

No sudo is needed here, as it runs as root already.

Offline arcturus

  • Newbie
  • *
  • Posts: 6
Re: NFS Client
« Reply #12 on: August 30, 2012, 03:13:46 PM »
Already fixed the autostart of the nfs-client in bootlocal.sh, but thanks for the tip  :)

ananix: I'm pretty sure I'm not sharing over samba. Samba works really crappy for me as I can't get resonable write speeds to my file server. It's a slow 1.3GHz mobile celeron server but with gigabit ethernet and I'll only get like 10Mbyte/sec write speed over samba. Thats why I stopped using it for my PC and went with nfs instead. That'll give me like 60-70Mbytes/sec write speeds... I do have the media directory shared over samba too, but thats only used by my WD Live media player box. And no I did not mount my network drives with a right click. I never got that working... :)

Next up: USB soundcard and MPD.
Thanks again!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: NFS Client
« Reply #13 on: August 30, 2012, 05:27:59 PM »
Hi arcturus
Quote
It's a slow 1.3GHz mobile celeron server but with gigabit ethernet and I'll only get like 10Mbyte/sec write speed over samba.
I'm running a Samba server on hardware that is far less capable than yours, and relative to the speed of my
hardware, my results are far better. I achieve 4Mbyte download speeds using a 233Mhz Pentium MMX with a
100Mbit/Sec. network card. See:
http://forum.tinycorelinux.net/index.php/topic,12544.msg68122.html#msg68122
http://forum.tinycorelinux.net/index.php/topic,12276.msg66046.html#msg66046