Netdisk

Netdisk.zip written by Jim Christensen, Oct 1987.


What is NetDisk

NetDisk is a simple disk server for PC DOS. It allows multiple PCs connected by a local area network (LAN) to access the disk of another PC on the LAN. We call the PC whose disk is being accessed the "server", and the PCs who are accessing the disk "clients".

One way of using NetDisk is illustrated by the following diagram.

      +------- LAN -------+---------------+---------------+
      |                   |               |               |
      |                   |               |               |
|-----------|       |-----------|   |-----------|   |-----------|
| Server PC |       | Client PC |   | Client PC |   | Client PC |
|-----------|       |-----------|   |-----------|   |-----------|
This PC's disk      All of the client PCs can read the server's
is accessible by    disk just as though it were a local, private
all client PCs.     disk.  A client PC may write on the server's
                    disk if it's the only active client.

Functional Characteristics

Requires a dedicated PC for the disk server. Any one drive on this machine may be used for the network disk.

Allows multiple PCs to read the network disk concurrently. The network disk looks like a new drive letter to these PCs, and each can have its own current directory. Optionally, you can specify which PCs are allowed to access the network disk.

Allows any PC to write on the network disk, as long as it's the only active user of the network disk. Optionally, the network disk may be write-protected against some or all users.

Allows multiple disk servers on the same network, and access to multiple network disks within one PC.

Shares the network with other programs (e.g. MYTE).

Is not as fast as a local disk.


Comparison with the PC Network Program

IBM announced a program along with the PC Network that also provides a disk server function. So why did I write NetDisk? I needed more disk space, but I wasn't willing to give-up a lot of memory to get it. NetDisk uses about 2K of my PC's memory. The PC Network program uses more like 130K. I grant that you get more function for that 130K, but all I needed was the disk server function.

Warning! I've tested Netdisk and my department uses it in the manner shown in the above diagram. I have some confidence that it works as designed. Be aware however that NetDisk server program uses a low level interface to the real disk (see Implementation section). If NetDisk has bugs in it, the server's file system could be damaged. If you plan to run the NetDisk server on a disk with important data, I recommend that you replicate that data on another disk or diskette.


Prerequisites for NetDisk

Before you can use NetDisk, you'll need the following:

Two or more PCs connected by a LAN. I've tested NetDisk only on the IBM Token Ring network, but I think NetDisk should work equally well on the IBM PC Network as the interface to PC DOS programs is the same for both of these network adapters.

The NETBIOS programs that provide the API (i.e. the INT 0x5C interface) to the LAN.


Running NetDisk

Once you've decided to use NetDisk, do the following steps:

NETDISK.PAC -- The table of contents for the NetDisk package.
NETDISK.TXT -- This document.
NETDISK.SYS -- The block device driver that runs in each client PC.
NETDISK.EXE -- The server program that runs in the server PC.

Client Configuration

Download NETDISK.SYS to each PC that will run as a client.

Also add a line to the CONFIG.SYS file of each client PC to install NETDISK.SYS as a device driver at boot time. If you put NETDISK.SYS in the "NET" directory on the C disk, the line might look like this:

DEVICE=C:/NET/NETDISK.SYS CASEY DRZEUS

The two parameters in this example (CASEY and DRZEUS) are the name of this client PC and the name of the server PC, respectively. Each PC on the LAN should have a unique name.

Adding a line like the one above to the CONFIG.SYS file will make a new disk drive letter available to DOS and DOS programs. For example, your PC might assign drive letter D to the DRZEUS network disk. You could then look at the root directory of DRZEUS with the DOS command

dir d:

If a client PC will access more than one network disk, then its CONFIG.SYS file should contain one line for each network disk. Let's expand our example so that the client PC named CASEY could access the network disks named DRZEUS and ATHENA.

DEVICE=C:/NET/NETDISK.SYS CASEY DRZEUS
DEVICE=C:/NET/NETDISK.SYS CASEY ATHENA

Configure Server

Download NETDISK.EXE to each PC that will run as a server.

You don't install this program. You simply run NETDISK.EXE whenever you want a PC to perform the server function, and stop it when you're finished. NETDISK.EXE requires some parameters, and they must be in the right order. The syntax can be summarized as follows:

netdisk <Drive> <ServerName> <Options>

<Drive> The drive letter of the disk to be served (i.e. made available to client PCs). For example, this could be "C".
<ServerName> The name of the server PC. For example, this could be DRZEUS.
This name should be unique on the LAN.
<Options> Zero or more of the following options:
/v = Verbose. Causes the server to print extra status messages.
/w -Write. Lets client PCs write on the disk. Without this option, client PCs will only be able to read the disk.
/x___ - Security. Lets you specify which PCs can use the disk.
   In place of ___ you specify the name of a normal ASCII file. You can create this file with any text editor (eg EDLIN, PE2, E3). Each line of the file is either a comment (if the line starts with a space), or names one client PC who's authorized to use the disk. Lines that are not comments must be in one of the following formats:

ClientName
ClientName AccessCode
ClientName AccessCode LanID
ClientName LanID

"ClientName" is the name of the client PC."AccessCode" is "R" to restrict this client to read-only access, or "W" to allow the client read-write access. If "AccessCode" is not specified, "W" is assumed.

Note that if the"/w"option mentioned above is NOT specified, then NO clients will be permitted to write on the disk. "LanID" is the unit identification number of the LAN adapter that the client PC uses to access the server. If you omit this number, the server will fill it in the first time the client uses the disk.

Lets see how we might start the NetDisk server program, so that the client PC we called CASEY could read and write on the server PC's C: disk.

netdisk C DRZEUS /w

Implementation

A brief summary of how NetDisk works follows.

Uses the NETBIOS interface in both the client and server PCs.

Uses interrupts 0x25 and 0x26 to access the disk in the server PC.

Uses the "media changed" mechanism to synchronize the updates that multiple client PCs could make over a period of time to the same network disk.

Determines which client PCs are active by timeouts.

Checks the identity of client PCs by matching the unit identification number of their LAN adapter (as returned by the NETBIOS remote adapter status operation) against the information stored in a security file.

Content created and/or collected by:
Louis F. Ohland, Peter H. Wendt, David L. Beem, William R. Walsh, Tatsuo Sunagawa, Tomáš Slavotínek, Jim Shorney, Tim N. Clarke, Kevin Bowling, and many others.

Ardent Tool of Capitalism is maintained by Tomáš Slavotínek.
Last update: 29 Sep 2024 - Changelog | About | Legal & Contact