Implementing kernel mode NFS file sharing on Puppy

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

Implementing kernel mode NFS file sharing on Puppy

#1 Post by mikeb »

This is a simple!! guide to setting up NFS file sharing on puppy using the kernel mode drivers.
Tested on puppy 4.12, 4.12 retro, 2.12 and 2.02..no additional dependancies should be required.
It is a manual process that requires a little familiarity with the linux and puppy file system so not suitable as a pet package but perhaps in the future a simple gui setup could be made along the lines of the one for pcurlftpfs included with puppy.

There are 2 parts ...the kernel modules and the software to run NFS.
If you are running puppy 2.xx you already have the modules (assuming zdrv is present in some cases)...skip part 1.
Puppy 3 may have the modules, new puppies are going to include as before.

1) For puppy 4.xx download and extract the appropriate archive to '/'.(the 2.6.25.16 modules are now a pet :) )
Then run 'depmod' in a terminal to register the added modules.
note...the retro modules are from an earlier puppy but load and run ok if the modprobe -f option is used.

2) Download and extract to '/' the 'common' archive.

3) Decide what you wish to share and add to or edit /etc/exports
for example

Code: Select all

/mnt/hda2 192.168.1.3(rw,no_root_squash,no_subtree_check,sync) 
will share /mnt/hda2 with read/write permissions..ie full root access..probably ok for a home network but for something more cautious read up on other options .
http://nfs.sourceforge.net/nfs-howto/ar01s03.html is a good clear resource.
note...files within the unionfs cannot be shared..at least not with puppie's present kernel but 'home' can..use /initrd/mnt/dev_save.
To add machines just add an entry with its ip , space inbetween.
To grant access you must add machines to /etc/hosts.allow. A simple entry could be

Code: Select all

ALL: 192.168.1.3 , 192.168.1.4
comma spaced and carriage return at the end.
Don't forget to include the server machine if you wish to test as a client on it.

4) Open a terminal to load the modules and start the server....these commands can be added to /etc/rc.d/rc.local for automatic running at boot time.
For the server

Code: Select all

modprobe nfsd
For the client

Code: Select all

modprobe nfs
If all ok you will see the modules by running 'lsmod'
Then ....
for the server (and client)

Code: Select all

/etc/rc.d/rc.nfsd
if only a client machine run

Code: Select all

/etc/rc.d/rc.portmap
You should see some startup messages with no errors.Check in htop or top for running services or run

Code: Select all

rpcinfo -p localhost
to give a list of services ...use machine ip for remote check.

5) Mount your shared files from the client using something like

Code: Select all

mount-FULL -t nfs 192.168.1.2:/mnt/hda2 /root/shares
in this case we are mounting the shared /mnt/hda2 to a folder 'shares' created previously in /root to a server at 192.168.1.2
note that the busybox mount cannot handle NFS
The above could be done at start up or in a script.

Code: Select all

umount-FULL 192.168.1.2:/mnt/hda2
to unmount (or use rox)

You can set up an NFS server on windows
winnfsd
http://sourceforge.net/projects/winnfsd
freeware and simple...drawback is will only share ntfs drives as it relies on the owner/group info it comes with (took me a while to sus that one).

haneWIN
http://www.hanewin.net/nfs-e.htm
Very easy to setup with control panel applet..only had to add the share .runs as a service automatically...will share any partition type.
Drawback shareware...but from the documentation it will keep running after the 30 days so for home use....This appears to be the case.

For either mounting is similar..note that syntax for mounting say d:\ from 192.168.1.2 is 192.168.1.2:\d (no trailing slash and case matters) otherwise the same rules apply.

mike

edit----now have proper modules for the retro 2.6.21.7 kernel :)
Attachments
nfs_common.tar.gz
Common files for nfs .. install for any puppy
(152.78 KiB) Downloaded 1973 times
Last edited by mikeb on Thu 14 Jan 2010, 01:29, edited 1 time in total.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#2 Post by Béèm »

Not suitable for woof then?
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#3 Post by mikeb »

Ok here are some updates courtesy of Patriot :0

I have posted them separately as the start up scripts are only in my common package above so these could be added afterwards if the update is needed. As far as I know this has nfs 4 support which I believe can handle mixed types of filesystem shares amongst other this so may be useful to some

mike
Attachments
nfs-utils-1.2.1-i486.pet
Common tools with nfs4 support
(188.45 KiB) Downloaded 1473 times
Last edited by mikeb on Thu 14 Jan 2010, 01:33, edited 1 time in total.

User avatar
DC
Posts: 360
Joined: Sun 30 Apr 2006, 15:07
Location: Maidenhead, England

#4 Post by DC »

Hi Mike,
Thanks very much, Works very well.
I tried it between two copies of Puppy 4.21
Alough it might be obvious that a mounted remote drive works the same as a local drive it still feels like applied magic :shock:
all normal fuctions seem to work i.e command prompt, pfind etc

And my next problem
I could not get it to run under SMP Puppy 4.20 as a client
Did you complie the nfs modules for 2.6.25.16 ?
If you did could I get a copies to try compling them for SMP.

Thanks again

DC

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#5 Post by mikeb »

Oh good.

No tempestuous did...thee efficient star.

Are the nfs modules definately not there ie can you modprobe nfs/nfsd ?

Otherwise whoever compiled that kernel would be the one to approach...I did try one of the smp versions recently and remember seeing the modules...
puppy-k26291smp-4.2.iso
(said he..cannot mount the sfs from here to double check :cry: )

mike

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#6 Post by mikeb »

Ok Beem I give in..where do I get woof from?

mike

User avatar
Patriot
Posts: 733
Joined: Thu 15 Jan 2009, 19:04

#7 Post by Patriot »

Hmmm .....

I have a need for NFS server recently for whacking some old routers and your super simple guide here has helped save me a bunch of time .....

Anyway, I'm still on k2.6.21.7 mostly ... A whole bunch of modules are missing (not just the nfs ones. BTW, I just noticed there's an ext4 DEV module in there ... maybe I'll take a peek at it one of these days to see if ext4 can be backported) ... I was able to pinpoint all the required modules (based on your super simple guide here) and compile them quickly ... I've also done the latest nfs-utils-1.2.1 (Nov'09) which seems to have removed a few binaries ... Give me a holler if you'd like try these new ones .....

Thanks to your super simple guide here I could get the NFS server up and running in minimum time ..... though honestly, I'm more comfortable with samba shares ... :)


Rgds

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#8 Post by mikeb »

Oh kool.....well I do like the simplicity of NFS.
I just got the NFS client working from windows via microsofts own UNIX package. Although its huge you can selectively install just the client or client and server of which the core is a handful of small binaries...I could make a reduced set of just whats needed and reg files but MS might object :D . The control applet is larger and does not work if Internet Explorer is removed (but mshta is a major security hole anyway) but everything can be setup via the cmd console anyway.) It runs as a service and connected itself without any fiddling! I'm still trying to understand their authentication mechanism but can map a network drive anonymously read only which gives transparent explorer access and streaming media...something which ftp netdrive could not. Indeed again its simpler than samba and pretty much unknown to hackers and such.
Basically free file networking linux to linux to windows :)
I use internet/ipp printing for that side.

The modules for 2.6.21 where hijacked from puppy 2.17 and have to be loaded by -f. If you have a proper set would you mind uploading them here to complete the set. I believe newer puppies now include the full set again. And the updated utilities perhaps :)

I'm not sure what the rush is with ext4 since it has no significant benefits to normal systems for some time to come but hey...

Thanks for your input and glad my distructions worked :)

mike

User avatar
DC
Posts: 360
Joined: Sun 30 Apr 2006, 15:07
Location: Maidenhead, England

#9 Post by DC »

As requested for the above
these are howto's I wrote for myself to remind me when doing a new install.
this is for kernal 2.6.25.16. (puppy 4.2, 4.21 etc)
obviously change things to suit

First the server;

# install
NFS-modules-k2.6.25.16.pet

# then the command (to register modules)
depmod

# extract to /
nfs_common.tar.gz

# make a file
/etc/exports
# containing - /root (what's shared) 192.60.26.9(rw...) (client allowed share)
/root 192.60.26.9(rw,no_root_squash,no_subtree_check,sync)

# edit
/etc/host.allow
# adding (dont forget comma spaced and carriage return)
ALL: 192.60.26.9 , 192.60.26.10

# add these to /etc/rc.d/rc.local
modprobe nfsd
/etc/rc.d/rc.nfsd start


# to check if nfs is running
rpcinfo -p localhost


And the client;

# make a dir on client
/mnt/dc_server

# install
NFS-modules-k2.6.25.16.pet

# extract to /
nfs_common.tar.gz

# edit
/etc/host.allow
# adding (dont forget comma spaced and a carriage return)
ALL: 192.60.26.9 , 192.60.26.10

# add these to /etc/rc.d/rc.local
modprobe nfs
/etc/rc.d/rc.portmap start


# to check if nfs is running
rpcinfo -p localhost

# script in (this allows time for ip address to come up before mounting)
/root/startup/DCmount_nfs.sh
## poll interface eth0
while [ -z "`ifconfig | grep 'eth0'`" ]
do
sleep 3
done

mount-FULL -t nfs 192.60.26.10:/root /mnt/dc_server



Finally;
For later kernals (puppy 4.3, 4.31) just leave out the "NFS-modules-k2.6.25.16.pet" as the builds have the NFS modules enabled.

Hope it all makes sense

DC

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#10 Post by mikeb »

Thanks DC :)

well a step by step 'what I did from start to finish' is good...it's easy to focus on the nitty gritty and forget the 'not always obvious'.
For later kernals (puppy 4.3, 4.31) just leave out the "NFS-modules-k2.6.25.16.pet" as the builds have the NFS modules enabled.
puppy 4.00 to 4.21 were the ones lacking the full set as far as I know.
I read that the client can be done with only nfs in a more basic fashion but its not recommended for file safety reasons.

regards

mike

mrd
Posts: 124
Joined: Wed 28 Nov 2007, 02:04

#11 Post by mrd »

Nothing ruins my evening more than stupid problems like this.

I'm trying to run MacPup Foxy 3 which is supposedly based on puppy 4.31.1 and booting from the live CD I can nfs mount my network share with no problems and nothing more than the standard puppy mount-Full -t nfs -o rw,nolock 10.10.55.201:/MRD_FILES /mnt

This will not work once the install is done in a lin n win config. Everything else works fine, but when I try to mount I get "mount: RPC: Program not registered"

I can load the nfs modules by hand and see them loaded with lsmod and I can add the nfs_common.tar files and still have the same results.

I've had a long week and really just want this to work. I also tried to copy the other random looking z098098098234.sfs file off of the iso in case that was needed, but no luck there either.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#12 Post by mikeb »

So sunrpc loaded?
Pretty sure the nfs modules should get included with a full install...maybe a depmod needed but unlikely.
Is
/etc/rc.d/rc.portmap start
still being run?
I usually have this in /etc/rc.d/rc.local (this gets cleared with an install and client will not run without it.
Also check yer /etc/exports and other files in /etc still are still correct and present...again install uses a pristine /etc folder.



regards mike

mrd
Posts: 124
Joined: Wed 28 Nov 2007, 02:04

#13 Post by mrd »

Something worked! But I'm not sure what because it seems like the /etc/files are the same as with the LiveCD...

Thanks for the help!

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#14 Post by mikeb »

I wonder...perhaps your shared folder was not mounted...takes a couple of goes for me

well anyway glad its working ok

mike

mhanifpriatama
Posts: 60
Joined: Sat 22 Jan 2011, 07:50

#15 Post by mhanifpriatama »

Is there someone who has managed to use nfs with Lucid puppy? It has different kernel.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#16 Post by abushcrafter »

mhanifpriatama wrote:Is there someone who has managed to use nfs with Lucid puppy? It has different kernel.
...Or any info on using NFS in Wary?
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

Master_wrong
Posts: 452
Joined: Thu 20 Mar 2008, 01:48

#17 Post by Master_wrong »

@mhanifpriatama

Is there someone who has managed to use nfs with Lucid puppy? It has different kernel.
i confirm that the instruction work on luci 245.
i just checked it work on 5.2 too
Cluster-Pup v.2-Puppy Beowulf Cluster
[url]http://www.murga-linux.com/puppy/viewtopic.php?p=499199#499199[/url]

Rava
Posts: 15
Joined: Wed 24 Nov 2010, 17:11

#18 Post by Rava »

How can I use that with Quirky NOP 1.2.0, since it uses another Kernel Version (2.6.33.2) or is that Kernel pet only needed for older Puppies?

Or should I try unfs3-0.9.22 ( http://www.murga-linux.com/puppy/viewtopic.php?&t=64491 ) instead?

2lss
Posts: 225
Joined: Sun 20 Sep 2009, 23:54

#19 Post by 2lss »

abushcrafter wrote:...Or any info on using NFS in Wary?
I'm using Wary 5.1.1 and am able to mount an nfs share. Here's what I did:

Install "nfs-utils-1.2.1-i486.pet" (3'd post)

/etc/rc.d/rc.portmap start

mount-FULL -t nfs 192.168.1.250:/home/nfs /root/nfs

This works except I am unable to access /root/nfs;

Code: Select all

# ls /root/nfs
ls: cannot open directory /root/nfs: Permission denied
Anyone have an idea what the problem might be? I am able to mount the share using another machine running debian so I don't think the problem is server side.

EDIT: I changed the UID for my user "frank" on the client (my Wary box) to match the UID on the server and now if I "su frank" I can access the mount point. If I try to use the "root" user I still get permission denied.

Rava
Posts: 15
Joined: Wed 24 Nov 2010, 17:11

#20 Post by Rava »

^ Thanks 2lss

I think I then try to check that out with Quirky NOP 1.2.0...

When I get the time since I help with debugging the RC1 of x86_64 of Porteus - previously known as "Slax Remix" - on porteus.org. :D

Post Reply