Virtual OS/2 International Consumer Education
VOICE Home Page: http://www.os2voice.org
February 2003

[Newsletter Index]
[Previous Page] [Next Page]
[Feature Index]

editor@os2voice.org


Mikes' Notebook - NFS, TCP/IP, OS/2, and linux - cross platform with a vengence.

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.

A reasonable understanding of OS/2 and linux is assumed.


Preface - A word about NFS performance:


Part 1 - Getting NFS configured on OS/2.

I'm told that many people have had difficulty configuring NFS on OS/2, but personally I found it much simpler than configuring Netbios over TCP/IP.

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).

TCP/IP Configuration - Host Names tab

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.

TCP/IP Configuration - Autostart tab

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".

TCP/IP Configuration - Security tab

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.

TCP/IP Configuration - NFS tab

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.

Troubleshooting:

If NFSD starts, then quietly exits with no error message and for no apparent reason, delete the file \mptn\etc\ibmnfsfh.db, it's managed to get corrupted. This is why I don't recommend starting NFSD detached - if it does this, you'll have no way of knowing.

Aside from that one specific oddity, everything else is the same as troubleshooting TCP/IP in general.


Part 2 - getting NFS configured on linux.

Setting your NFSD (and portmap!) up to autostart is distribution specific, so I'll skip right to the good stuff. Reminder - we're talking about linux in this section, so case is important.

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'.

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
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.
/ (rw,no_root_squash,insecure)
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
no_root_squash
setting is used to remove the last vestiges of the security system (trying to get OS/2 and linux security to work together is up there with getting Microsoft to work with industry standards - it doesn't happen well or for long.) and
insecure
(which isn't as bad as it sounds) is required because the OS/2 NFS implementation is from the 3.x generation - see man exports for details on these and many other options.

And surprise - as soon as you start portmap and NFSD, you're up and running.

Troubleshooting:

The same as standard TCP/IP troubleshooting - there are no oddities that I've found.


Part 3 - accessing NFS resources on both platforms.

Mounting a linux filesystem from OS/2:

Type MOUNT at an OS/2 prompt, and you'll see the syntax guide. All of the defaults are reasonable, but I strongly suggest tweaking the different cache settings for your location and target systems. As I mentioned above, the performance differences can be astonishing. A very basic mount, however, can be as simple as:
mount -u0 -g0 p: \\opus:/
and yes, you can put this in your startup.cmd file.

To unmount, use the umount command, as in:

umount p:

Mounting an OS/2 filesystem from linux:

You can use the mount command from the command prompt:
mount -t nfs machinename(from hosts):resource(from exports) /path/to/mountpoint
or you can put line(s) like this in your fstab file:
mwcdt:c /mnt/mwcdt/c nfs _netdev 0 0
where:

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

umount /path/to/mountpoint

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"), "Advanced Linux Networking" by Roderick W. Smith (Copyright 2002, Pearson Education, Inc., Published by Addison-Wesley), and the relevant MAN pages in your linux distribution.

References:

Mike's Notebook - unusual networking problems (and solutions) in OS/2 and eCS: http://www.catherders.com/mwclanprob.shtml



Mike's Notebook - http://www.catherders.com/mwcexp.shtml web site contains an assortment of frequently updated articles and tips for OS/2 users.


[Feature Index]
editor@os2voice.org
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org