.*OPTION GML TWOPASS SYSVAR(S 1 H YES) :gdoc sec='IBM Internal Use Only' :frontm. :titlep. :title.NetDisk :title.A Simple Disk Server for PC DOS :date.October 1987 :author.Jim Christensen :address. :aline.IBM T.J.Watson Research Center, Hawthorne :aline.P.O.Box 704 :aline.Yorktown Heights, NY 10598 :aline.&rbl. :aline.Userid: JimC at YORKTOWN :eaddress. :etitlep. :toc. :body. :h1.What is NetDisk :p. 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 :hp2.server:ehp2., and the PCs who are accessing the disk :hp2.clients:ehp2.. One way of using NetDisk is illustrated by the following diagram. :xmp. +------- 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. :exmp. :h2.Functional Characteristics :p. :ul. :li.Requires a dedicated PC for the disk server. Any one drive on this machine may be used for the network disk. .* :li.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. .* :li.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. .* :li.Allows multiple disk servers on the same network, and access to multiple network disks within one PC. .* :li.Shares the network with other programs (eg MYTE). .* :li.Is not as fast as a local disk. :eul. :h2.Comparison with the PC Network Program :p. 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. :h2.WARNING :p. 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. .* .* :h1.Prerequisites for NetDisk :p.Before you can use NetDisk, you'll need the following: :ul. :li.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. :li.The NETBIOS programs that provide the API (ie the INT 0x5C interface) to the LAN. :eul. .* .* :h1.Running NetDisk :p. Once you've decided to use NetDisk, do the following steps: :ol. .* :li.Obtain the programs from any PCTOOLS service machine. You should get four files: :ul :li.NETDISK PACKAGE -- The table of contents for the NetDisk package. :li.NETDISK SCRIPT -- This document. :li.NETDISK SYSBIN -- The block device driver that runs in each client PC. :li.NETDISK EXEBIN -- The server program that runs in the server PC. :eul. .* :li.Download NETDISK SYSBIN to each PC that will run as a client. The file should be called NETDISK.SYS on the PC. 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 :hp2.NET:ehp2. directory on the :hp2.C:ehp2. disk, the line might look like this: :xmp. DEVICE=C:&bsl.NET&bsl.NETDISK.SYS CASEY DRZEUS :exmp. :p. The two parameters in this example (:hp2.CASEY:ehp2. and :hp2.DRZEUS:ehp2.) 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. :p. 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 :hp2.DRZEUS:ehp2. network disk. You could then look at the root directory of :hp2.DRZEUS:ehp2. with the DOS command :xmp. dir d: :exmp. :p. 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 :hp2.CASEY:ehp2. could access the network disks named :hp2.DRZEUS:ehp2. and :hp2.ATHENA:ehp2.. :xmp. DEVICE=C:&bsl.NET&bsl.NETDISK.SYS CASEY DRZEUS DEVICE=C:&bsl.NET&bsl.NETDISK.SYS CASEY ATHENA :exmp. .* :li.Download NETDISK EXEBIN to each PC that will run as a server. The file should be called NETDISK.EXE on the PC. 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: :xmp. netdisk :hp2.:ehp2. :hp2.:ehp2. :hp2.:ehp2. :exmp. :dl tsize=16. :dt. :dd.The drive letter of the disk to be served (ie made available to client PCs). For example, this could be :hp2.C:ehp2.. :dt. :dd.The name of the server PC. For example, this could be :hp2.DRZEUS:ehp2.. This name should be unique on the LAN. :dt. :dd.Zero or more of the following options: .* Begin embedded dlist :dl tsize=7. :dt./v :dd.Verbose. Causes the server to print extra status messages. :dt./w :dd.Write. Lets client PCs write on the disk. Without this option, client PCs will only be able to read the disk. :dt./x___ :dd.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: :xmp. ClientName ClientName AccessCode ClientName AccessCode LanID ClientName LanID :exmp. :hp2.ClientName:ehp2. is the name of the client PC. :hp2.AccessCode:ehp2. is :hp2.R:ehp2. to restrict this client to read-only access, or :hp2.W:ehp2. to allow the client read-write access. If :hp2.AccessCode:ehp2. is not specified, :hp2.W:ehp2. is assumed. Note that if the :hp2./w:ehp2. option mentioned above is NOT specified, then NO clients will be permitted to write on the disk. :hp2.LanID:ehp2. 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. :edl. .* End embedded dlist :edl. :p. Lets see how we might start the NetDisk server program, so that the client PC we called :hp2.CASEY:ehp2. could read and write on the server PC's C disk. :xmp. netdisk C DRZEUS /w :exmp. :eol. .* .* :h1.Implementation :p.A brief summary of how NetDisk works follows. :ul. :li.Uses the NETBIOS interface in both the client and server PCs. .* :li.Uses interrupts 0x25 and 0x26 to access the disk in the server PC. .* :li.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. .* :li.Determines which client PCs are active by timeouts. .* :li.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. :eul. :p. If you want more information on how NetDisk works, send me a note over VNET. I'm :xmp. JimC at YORKTOWN :exmp. :egdoc.