VOICE Home Page: http://www.os2voice.org
|By Michael W. Cocke© February 2003|
Preface - a word about NFS Performance.
Part 1 covers getting NFS configured on OS/2.
Part 2 covers getting NFS configured on linux.
Part 3 covers accessing NFS resources on both platforms.
First, you'll need to have installed NFS for OS/2. There doesn't seem to be a good way to install it except during the initial installation of OS/2. It is not, for example, available in either of the selective installs. If you have access to a system that does have NFS already installed, it's trivial to copy it to another system.
Open up "TCP/IP configuration (local)" which should be located in the "TCP/IP" folder of the "System Setup" folder. When the notebook opens, click the "Host Names" tab (on the top), then click the "Hosts" tab (on the bottom).
Most important: Make certain that "look through hosts before going to name server" (on the bottom) is checked!
Save your changes and exit. You'll have to reboot unless "look through hosts before going to name server" was already set.
Next, we need to configure the autostart of the NFS server and the security settings.
PLEASE NOTE: You also need to autostart "portmap", as well as "NFSD" in order to use NFSD. You can use "detached" mode for that. I recommend against detaching NFSD for reasons that I'll get to in the troubleshooting section (below).
Next, configure the security for NFS users. For now, leave the user ID (UID) and group ID (GID) set to 0 (that's a zero). What this actually does is tell OS/2 for which user and group IDs to fake linux style access privileges. 0/0 is 'root', which equates to an OS/2 "administrator".
And then set up what local resources should be shared via NFS, just like creating Warp Peer shares and resource controls - with a few differences, which I'll discuss below.
Since user IDs (in general) tend to be platform specific and NFS was designed specifically not to be tied to a particular platform, access privileges are handled differently.
First of all, when you define the 'alias' of a directory to make available, I strongly recommend against using a backslash (\) , a forward slash (/), or a hyphen (-) as a part of the name. The reason is quite simple, and will foul up newcomers to cross platform networking every time... Windows and OS/2 use a backslash as a path separator and a forward slash as a command parameter (switch) flag. BSD, unix, and linux use a forward slash as a path separator and a hyphen as a switch flag. Remember that you have to enter the alias, usually with options (switches) on each system... So, yes, it is entirely possible to create a device alias that you cannot access from another platform! Big OOOPS.
For each directory that you choose to make accessible via NFS, you also get to specify who gets to access it - and how. Notice that you can specify 'public', which means anyone can do anything with that directory. You can also specify read-only and read-write, BY HOSTNAME or IP ADDRESS. Yes, that's exactly what it sounds like - the user doesn't need a user ID and password, they get access by using the correct machine.
Quick aside on the subject of security: Please remember - if you're using a NAT layer to connect multiple computers to the internet, once you cross that layer, ALL of your local computers have the exact same IP address! That means that not only do YOU have the correct IP address to access the NFS volume at work, so does your 7 year old son....
And that's essentially how to get an NFS server running on OS/2.
Aside from that one specific oddity, everything else is the same as troubleshooting TCP/IP in general.
First, set up your HOSTS file(s). This is a bit more complex than it appears, because there are two ways to do it. I'm going to skip the "tcpd" and hosts.allow and hosts.deny method and assume that you're doing this in the simplest way possible, in which case make sure that you're not autostarting tcpd....
Your HOSTS file (/etc/hosts) is the local host name resolution file - just like you set up in the OS/2 tcp/ip configuration notebook only without the notebook GUI. See 'man hosts'.
Next, you need to set up the exports list (/etc/exports). Most decent distributions will give you some kind of GUI for this, but here's the bare-bones text-only version.
127.0.0.1 localhost.localdomain localhost 192.168.1.20 opus.catherders.com opus 192.168.1.2 server.catherders.com server 192.168.1.3 mwcdt.catherders.com mwcdt 192.168.1.1 gateway.catherders.com gateway
This is a very simple export file. Basically, everything in the root directory and below (in other words, the entire filesystem) is available read-write. The
And surprise - as soon as you start portmap and NFSD, you're up and running.
and yes, you can put this in your startup.cmd file.
mount -u0 -g0 p: \\opus:/
To unmount, use the umount command, as in:
or you can put line(s) like this in your fstab file:
mount -t nfs machinename(from hosts):resource(from exports) /path/to/mountpoint
mwcdt:c /mnt/mwcdt/c nfs _netdev 0 0
Please see man fstab for details - look at the different cache setting options. I strongly suggest tweaking the different cache settings for your location and target systems. As I mentioned above, the performance differences can be astonishing.
To unmount, use the command
And that's it, in a very large nutshell. Please note that this article is only
meant as an introduction - for in-depth details, I recommend the IBM
OS/2 Redbook SG24-4730-00 ("TCP/IP Implementation in an OS/2 Warp Environment"),
Networking" by Roderick W. Smith (Copyright 2002, Pearson Education, Inc.,
Published by Addison-Wesley), and the relevant MAN pages in your linux distribution.
Mike's Notebook - http://www.catherders.com/mwcexp.shtml web site contains an assortment of frequently updated articles and tips for OS/2 users.
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org