EOT > /etc/exports
/ 192.168.xx.xx(rw,no_root_squash,no_subtree_check,sync) 192.168.xx.xy(rw,no_root_squash,no_subtree_check,sync)
EOT
# this line is needed only once if you dont need to delete /etc/exports
# so you can do that manually and take out the line here
# for a CD or poor man´s install you would need it
echo exports set
/etc/init.d/portmap start # (if it was not running already)
/etc/init.d/nfs-kernel-server start
echo NFS-Server startet
mount -t nfs 192.168.xx.xy:/ /mnt/notebook
echo Notebook mounted :code:
This script I run on my desktopcomputer. I made it as nfsstart, made it executable with chmod +x and copied it to /usr/local/bin/ . Now as su in a shell I simply do nfsstart and it would run.
As the laptop would not know about that I made a script for it too. Only the sequence of the IPs in line seven is changed and instead of "notebook" "desktop" is mounted using it´s IP. The echo-commands I just did to see what is happening.
The first lines fully stolen from Kano´s scripts, from "#" to "fi", it controls if I did the script as su (a must).
If I don´t need the connection no more I stop it so:
:code:#!/bin/bash
if [ $(id -u) != 0 ]; then
echo Error: You must be root to run this script!
exit 1
fi
umount /mnt/notebook
echo Notebook umounted
# if you need portmap, dont stop it
/etc/init.d/portmap stop
/etc/init.d/nfs-kernel-server stop
echo Kernel Server stopped:code:
Here the difference between the files on both computers is the umount-line only.
This script too is executable and copied to /etc/local/bin/ waiting to be used when I do nfsstop as su.
The names of the little "programs" are of your choice. Only don´t give them a name already used by another program or script. Such would cause problems...
Once again very short:
1. give the computers a mountpoint (both should have one, if you want a connection in both directions)
2. edit the scripts with your own IPs and mountpoints
3. make the scripts executable and copy or move them to /usr/local/bin/ (no .sh, so they can run as command from a shell)
That´s it. I had to run the script twice on that computer I started with, as the connection to the second was not jet possible, as the second computer at that time did not know about that. The scripts have to run on both computers.
Two days later:
(for
poormans installs or from CD and persistent Home)
It is easily done if you have installed a program with Kano´s scripts. I had the opera installed that way and so I had in my /home/knoppix some folders. The main folder is /home/knoppix/dist.
Inside it you find the /home/knoppix/dist/bin/ where u have to put the executable files.
The mountpoints also should in your persistent home now, as when booting you would not have them no more in /mnt.
So I changed in the scripts /mnt to /home/knoppix and find the content of my other computer now in /home/knoppix/desktopcomputer respectively /home/knoppix/notebook.
Just a tip, if you have a /home/knoppix/dist/bin anyways you can add your own scripts there executable and start them as a simple command from the shell.
Native english people, be so kind to check this howto...
:de:
NfsKernelServer
älteste bekannte Version dieser Seite wurde bearbeitet am 2004-07-14 14:26:16 von DerEinzigWahreMipooh [ ]
Nfs-Kernel-Server Howto
I wanted to connect my laptop and my desktopcomputer for exchanging files.
Not a real network, just for copying files from one to the other.
Someone told me a (supposed) simple solution, the nfs-kernel-server.
And as I want you to really have it simple, I write down here how to manage that.
Lets go.
My laptop and my desktopcomputer both are connected to a router, to have the choice using the Net with both of them.
My friendly router gave them an IP:
192.168.xx.xx and 192.168.xx.xy
(x and y are fakes here. I don´t know who would read this here, and it would be too simple for someone knowing my real IPs.)
I needed the IPs for telling
/etc/exports
who should deal with whom....
also i needed a running nfs-kernel-server
that is like so many things started by /etc/init.d/xx start
the portmap daemon has to run too, if not already active
And I need a mout-point, where I can find data of the respective other computer.
In my case I decided to take /mnt/desktop on the notebook for the data of the desktopcomputer and there I did /mnt/notebook for having the notebooks data on the desktop.
As su on the desktop I did: mkdir /mnt/notebook
on the notebook: mkdir /mnt/desktop
Practising the connection I found it could unnecessarily slow down my systems at boot and shutdown.
So I made some little scripts for starting and stopping this service.
:code:#!/bin/bash
if [ $(id -u) != 0 ]; then
echo Error: You must be root to run this script!
exit 1
fi
cat
EOT > /etc/exports
Letzter Editor :
Eigentümer :