PDA

View Full Version : How can I use NFS in Knoppix 5.1?



GunSmoke
12-11-2007, 03:56 AM
I want to share directory between 2 knoppix systems.
I think that I didn't make any mistakes, but the problem was always happening.

First, I edited /etc/exports like this.

/home/knoppix 192.168.1.*(ro)

and I started portmap and nfs-kernel-server, and I checked showmount was OK.

I added the line allowing connect to portmap to /etc/hosts.allow

but whenever I tried to mount NFS, 'mount failed, reason given by server : permission denied' error message was kicked.

I tried to solve the problem, search and search.... So I tried /etc/exports like this.

/ramdisk/home/knoppix *(ro,no_root_squash)

and connected to localhost like this.

# mount -t nfs 127.0.0.1:/ramdisk/home/knoppix /mnt/nfs

but the same error occured.

How can I solve it?




--
大逆戰

chip.ling
12-31-2007, 03:42 AM
I want to share directory between 2 knoppix systems.
I think that I didn't make any mistakes, but the problem was always happening.

First, I edited /etc/exports like this.

/home/knoppix 192.168.1.*(ro)

and I started portmap and nfs-kernel-server, and I checked showmount was OK.

I added the line allowing connect to portmap to /etc/hosts.allow

but whenever I tried to mount NFS, 'mount failed, reason given by server : permission denied' error message was kicked.

I tried to solve the problem, search and search.... So I tried /etc/exports like this.

/ramdisk/home/knoppix *(ro,no_root_squash)

and connected to localhost like this.

# mount -t nfs 127.0.0.1:/ramdisk/home/knoppix /mnt/nfs

but the same error occured.

How can I solve it?

--
大逆戰

Assume your master machine is 192.168.1.101 and the client machine is 192.168.1.102

From the master machine 192.168.1.101, please try out the following entry in the /etc/exports instead of the "/home/knoppix 192.168.1.*(ro)"


/home/knoppix 192.168.1.0/255.255.255.0(ro)

Edit the master server /etc/hosts.deny file,
delete the line
ALL:PARANOID
and save the file

Edit the master server /etc/hosts.allow file
change the line
ALL : ALL@ALL : DENY
to
ALL : 192.168.1. LOCAL : ALLOW
and save the file

On the master machine, issue the command

$ sudo /etc/init.d/openbsd-inetd restart

From the client machine 192.168.1.102, run the following command


$ sudo mount 192.168.1.101:/home/knoppix /media/nfs

Rgds,
Chip

chip.ling
01-01-2008, 11:48 PM
Dear all,

Got emails requesting more details on this topic, just created a detail step by step Q&A on the Wifi page.

Please check out the Q7 from the below link for detail

http://www.knoppix.net/wiki/Network_FAQ

Happy New Year to everybody

Rgds,
Chip

GunSmoke
01-06-2008, 02:37 PM
First, I can't understand why you active ssh server.
and I've heared that TCP wrapper has nothing to do with nfs.

But I founded something about this problem. and I posted it to debian-knoppix mailing lists.
I quoted that.




A little improvement.

I can mount the share directory which another linux box is exporting
to knoppix. but still have problem when knoppix is exporting to other
linux box. I can't mount knoppix's exporting directory in other linux
box.

Yep. knoppix-terminalserver scripts use nfs, and
knoppix-terminalserver is running well.
I analyzed knoppix-terminalserver scripts, so I founded that my
configuration is something insufficiented.

I added /etc/exports

/cdrom 192.168.1.0/255.255.255.0(ro,no_root_squash,async)

and added /etc/hosts.allow

portmap in.tftpd rpc.mountd mountd rpc.lockd lockd rpc.nfsd nfsd :
127.0.0.1 LOCAL 192.168.123.0/255.255.255.0 : ALLOW

and I did this.

# /etc/init.d/portmap start
# /etc/init.d/nfs-kernel-server start

In other linux box, I tried to mount the exported directory. like this

# mount -t nfs -o nolock 192.168.1.176:/cdrom /mnt/nfs

wow. It was working!! I could mount knoppix's exporting directory.

But I still have not mounted another directory, any directory! except /cdrom.
All error message trying to mount exporting directory are exactly
same, 'Permission denied'.
Are there any something special configuration in /cdrom directory?

How can I mount knoppix's exporting directory in other linux box.

ps. painful job. please help me.





Oops!! /etc/hosts.allow have nothing to do with this problem.

Only /cdrom directory can export to other linux system.
Maybe UnionFS concern this problem. I can mount /KNOPPIX as well as
/cdrom, but can't /UNIONFS and /ramdisk.

What do you think of this problem?

chip.ling
01-07-2008, 10:37 PM
First, I can't understand why you active ssh server.
and I've heared that TCP wrapper has nothing to do with nfs.



Sorry about the confusion here. I did actually try out your problem by using one pc on my basement as the server and my laptop as the client from my room.

I boot up both the server/client machines with knoppix cd and then I started the SSH server on the server machine so that I can remotely logon to it from my room via ssh.

I have the same feeling with you that ssh should not matter to your NFS issue but I have to prove it tonight after work.

However, the steps I mentioned on the Wifi FAQ is a TRUE STEP-BY-STEP HISTORY of what I had done. AND IT WORKS at the end. That's why you see the SSH step in there.

After I revisited your description about your failure, I suspect it is the directories setting that created the problem.

Please try out to change the server side shared directory to 777 (i.e. sudo chmod 777 /master/share).

I don't know what user id the master server will be used when the client machine tries to connect and use the shared directory via NFS, most likely will use the id "nobody".

If you really struck with the problem, I suggest you try it again from scratch. Just follow the Wifi FAQ and make sure it works first. Then try to figure out how it is difference from your old steps. I found that it is very straight forward procedure to set up the NFS.

Rgds,
Chip

chip.ling
01-08-2008, 03:46 AM
OK, I'm back.

Just finished two more testing using the same machines as before.

First test, cut away the ssh activation step from both machines and then test the NFS connection.
Result: POSITIVE.
Conclusion: SSH is not required.

Second test, cut away the /etc/hosts.deny and /etc/hosts.allow steps on both machines and then test the NFS connection.
Result: POSITIVE
Conclusion: /etc/hosts.deny and /etc/hosts.allow steps are not required.

Base on the second test setting, I re-test three more directories in the system /ramdisk, /UNIONFS and /KNOPPIX.

Out from the 3 directories, only /KNOPPIX is able to be mounted via NFS. Both /ramdisk and /UNIONFS failed.

Work-around

From the server machine, I created two symbolic links inside my newly created sharing directory /testroot and point them to /ramdisk and /UNIONFS.

Then I am able to access the /ramdisk and /UNIONFS via my client NFS mount point to the /testroot directory.

I have updated the Wifi FAQ. You can find more detail on it.

http://www.knoppix.net/wiki/Network_FAQ

Rgds,
Chip

GunSmoke
01-08-2008, 04:35 PM
Yep. I could mount knoppix UNIONFS and ramdisk with your methods.

But still have a problem.

I made some files on server, and exported /testroot.

ex) touch /home/knoppix/test

As U know, executing above order /UNIONFS/home/knoppix/test and /ramdisk/home/knoppix/test are created.

But I couldn't find my files on client knoppix.

chip.ling
01-11-2008, 05:14 AM
Yep. I could mount knoppix UNIONFS and ramdisk with your methods.

But still have a problem.

I made some files on server, and exported /testroot.

ex) touch /home/knoppix/test

As U know, executing above order /UNIONFS/home/knoppix/test and /ramdisk/home/knoppix/test are created.

But I couldn't find my files on client knoppix.

You're right. I cannot find the file either. I did checked all the directories read/write/exec bits and they all look OK to me.

Have no idea why this happen, my wild guess is the UNIONFS limitation.

I tried a work-around by creating the structure like: /testroot/home/knoppix and tried to change the user knoppix default home to it, it failed too.


$ sudo usermod -d /testroot/home/knoppix -m knoppix

The command finished without complain. It just happens that knoppix home is not changing.

Rgds,
Chip

DynamiteDan
04-12-2008, 10:36 AM
Hi,

i am remastering a Knoppix 5.1.1 for a Blackfin Development Board. I tried and tried to get NFS work without any users interaction. If i use the tutorial and create a nfs share folder and edit my "/etc/exports", it works and i can use the nfs-share from my board. But if take "/home/knoppix/bfin", which is a folder in my mastered Knoppix, and my default "/etc/export" which points to "/home/knoppix/bfin" in my remastered Knoppix, it got the "permission denied" error message after trying to mount. My idea is that nfs should run without any configuration changes. Just put the CD in and thats it.
If i use a persistent image, i got no error messages and nothing has to be configured. So i think it got anything to do with UNIONFS which denies any connections. Any ideas?


Greetz