NASD Programmer's Documentation
Running the drive

The NASD drive can run either as a user-level process, or entirely in the kernel of some operating systems. To determine if your operating system supports the NASD drive in-kernel, see the implementation notes for your platform.

Both the user-level drive and the front-end to the in-kernel drive are built in the drive/ directory. The user-level drive binary is pdrive. The front-end to the in-kernel drive is pikdrive. Each of these is run with arguments of the form

% binaryname [options] devicename where binaryname is pdrive or pikdrive, and devicename is the name of a raw disk to use as the NASD.

Some options are common to both forms of the drive. Others are specific to one drive or the other. Individual ports of either form of the drive may offer additional options as well.

Common options

OptionPurpose
-c Set number of blocks in drive block cache
-f Format the drive before starting
-i Set maximum number of I/Os outstanding at device driver
-l Set drive layout
-m Set maximum disk length to use
-q Set disk queue policy
-T Use DCE/TCP instead of DCE/UDP
-t Set number of RPC service threads

The first time the drive is run on a new physical device, that device must be formatted for use as a NASD. This is accomplished by running the drive with the -f option. During its normal startup sequence, rather than validate the internal correctness of the drive contents, the drive will be formatted as a NASD with no existing partitions.

When adjusting the number of blocks in the disk cache, bear in mind that the drive configuration may implicitly require a minimum number of cache blocks. For instance, if reference count blocks are to be wired into the cache, the cache must contain at least as many blocks as there are reference count blocks.

The number of RPC service threads is the number of threads per RPC system. Thus, if multiple RPC systems are enabled (for instance, by default the user-level drive supports both message queue RPC and DCE RPC), that number of threads is created for each of these packages, which function totally independently of one another.

User-level drive options

-x Ignore extant message queue

The -x option instructs the drive to delete an existing NASD drive RPC message queue, if such is found. This is useful when debugging a user-level NASD drive. A drive that crashes will leave its message queue extant, and future drives will avoid starting as a result, believing that a drive is already running on this host.

Terminating the drive

Both forms of the drive may be terminated cleanly, allowing the drive to complete a shutdown sequence that includes flushing any dirty buffers and releasing allocated resources. On UNIX platforms, this may be accomplished by delivering SIGINT to the drive process in whatever manner is most appropriate (often ^C at the controlling TTY).
<--- ---> ^<br>|<br>|
Compiling NASD into the dux kernel Running programs in tests/ NASD Programmer's Documentation