The stock cwfs implements a 16K file system block size and 32-bit disk addresses, in order to be compatible with some existing file systems, notably emelie 's. These parameters can be changed by recompilation.
Cwfs expects to find the configuration block on config-device .
Options are: .TF -m
-a announce on announce-string instead of .LR tcp!*!9fs .
-c use a newer, faster, and incompatible cache-device layout. To convert an old file system's cache to the new layout, dump the file system, note the last superblock number, halt cwfs , restart cwfs with -cf , recover the file system, and start cwfs with -c thereafter.
-f enter the file server's configuration mode before starting normal operation.
-m the file device-map contains a simple device name (e.g., .LR w9 ) and a replacement per line. The device name is in the usual filsys notation of fsconfig (8). The replacement can be the name of an existing file (which cwfs will not grow) or another such device name. For example, the file
.EX w0 /tmp/w0 h1 w2
0.3v would map accesses to device .L w0 to existing file .LR /tmp/w0 and accesses to device .L h1 to device .LR w2 , if no file named .L w2 exists.
The file server normally requires all users except .L none to provide authentication tickets on each attach (5). This can be disabled using the noauth configuration command (see fsconfig (8)).
The group numbered 9999, normally called noworld , is special on the file server. Any user belonging to that group has attenuated access privileges. Specifically, when checking such a user's access to files, the file's permission bits are first ANDed with 0770 for normal files or 0771 for directories. The effect is to deny world access permissions to noworld users, except when walking directories.
The user none is always allowed to attach to emelie without authentication but has minimal permissions.
Emelie maintains three file systems on a combination of disks and write-once-read-many (WORM) magneto-optical disks.
other is a simple disk-based file system similar to kfs (4) .
main is a worm-based file system with a disk-based look-aside cache. The disk cache holds modified worm blocks to overcome the write-once property of the worm. The cache also holds recently accessed non-modified blocks to speed up the effective access time of the worm. Occasionally (usually daily at 5AM) the modified blocks in the disk cache are dumped . At this time, traffic to the file system is halted and the modified blocks are relabeled to the unwritten portion of the worm. After the dump, the file system traffic is continued and the relabeled blocks are copied to the worm by a background process.
dump Each time the main file system is dumped, its root is appended to a subdirectory of the dump file system. Since the dump file system is not mirrored with a disk cache, it is read-only. The name of the newly added root is created from the date of the dump: / yyyy / mmdds\f1. Here yyyy is the full year, mm is the month number, dd is the day number and s is a sequence number if more than one dump is done in a day. For the first dump, s is null. For the subsequent dumps s is 1, 2, 3, etc. The root of the main file system that is frozen on the first dump of March 1, 1992 will be named /1992/0301/ in the dump file system.
Various other fs (4) commands have been omitted since they (or equivalents) can now be executed directly on the underlying CPU server, notably date and passwd (see auth/wrkey ).
fs (4)'s device names .L h for IDE disks and .L m for Marvell SATA disks are not supported; use -m to map wren devices to appropriate names under /dev/sd* .
The file server kernel seems to have scanned PCI buses in reverse order from the other Plan 9 kernels, so systems with multiple SCSI cards may find controller numbering reversed. -m can be used to compensate for this if you don't want to change filsys declarations.
The file server kernel's config field in NVRAM was overloaded in recent times to hold a secstore (1) key for the CPU hostowner. Since cwfs runs on a CPU kernel, the location of its configuration block must be supplied on the command line.
Disk labels are now implemented for l devices. At the first access of a side, cwfs will attempt to read the label and verify that it has the correct side number and byte order; if either is wrong, it will issue a warning. If the label cannot be read, cwfs will attempt to write a new label.
To get only one line of output for each version of the compiler:
.EX ls -lp /n/dump/1992/02??/mips/bin/vc | uniqSean Quinlan, ``A Cached WORM File System'', Software - Practice and Experience, December, 1991
Ken Thompson, Geoff Collyer, ``The 64-bit Standalone Plan 9 File Server''
File system block size and disk address size (32- or 64-bit) are fixed at compilation time, and this is not easily changed.
Cwfs is probably not the right choice of file server for new file systems. It's intended to cope with existing file systems on optical jukeboxes or images thereof.