FSCMD — User Commands
NAME
fscmd − Set various parameters in the filesystem
SYNOPSIS
fscmd −[mM] size
fscmd −[fslLNCv]
fscmd −[wWxXyz]
fscmd −[BOtDR]
fscmd −generic arg
INTRODUCTION
This command is used to set various kernel variables that control the filesystem cache, tracing and debugging output, and other features of the system. It is implemented using the Fs_Command system call.
CACHE SIZE
The minimum and maximum number of filesystem blocks (4 Kbytes each) in the main memory cache is set with the -m (minimum) and -M (maximum) arguments. Follow either of these with the number of 4-Kbyte blocks, ie. -M 512 means a max of 2 Megabytes in the cache.
CACHE CONTROL
−fThe entire contents of the cache gets written-back and then invalidated by specifying −f.
−s [0|1]
The background process that writes back dirty data from the cache can be disabled by specifying the “−s 0” flag. This should be done when patching a mounted filesystem or else bad internal structures will get pushed to disk. Enable the sync daemon with “−s 1”.
−l [0|1]
Biasing against “large” files in the cache is enabled with “−l 1” and turned off with “−l 0”.
−L size
This sets what portion of the maximum cache size a file must occupy before it is considered a large file. For example a value of 8 would indicate that if a file is larger than 1/8 of the maximum cache size then it is considered a large file.
−C [0|1]
Caching on diskless nodes can be disabled with “−C 0”, and turned back on with “−C 1”. This has to be done on a file server to affect its clients; use of the -C flag on clients will have no effect.
−N [0|1]
The name cache on a diskfull node is disabled with “−N 0” and enabled with “−N 1”.
−v [0|1]
The Virtual Memory cache of recently used program segments is disabled with “−v 1” (yes, 1), and enabled with “−v 0”.
−b NSet the maximum number of block cleaner processes. This controls the amount of overlap during cache writebacks. 3 processes provides the most bandwidth, but it does load the server.
−r NSet the read ahead distance (in 4K blocks). When a read on the cache is done, the transfer of N more blocks is initiated.
CACHE WRITE BACK POLICY
Normally, dirty blocks in the file system cache are aged for at least 30 seconds before being written back. This gives the best performance, although alternate strategies can be tried out with the following flags. There are two write-back policies involved: the client’s and the server’s. Each of the flags below only affects the policy on the client or server on which it is invoked. For example the client could be using a write-through policy and the server a 30-second-delay policy. This would mean that client writes would not complete until the blocks have been written across the network into the server’s cache, but the blocks would not be written back to disk until at least 30 seconds later.
−S seconds
Set the cache write-back interval in seconds.
−w [0|1]
Write-through caching is enabled with “−w 1” and disabled with “−w 0”. With write-through, the write system call does not complete until the cache block is written back.
−W [0|1]
Write-back-on-close caching is enabled with “−W 1” and disabled with “−W 0”. With write-back-on-close the close system call does not complete until all of the file’s dirty blocks are written back.
−x [0|1]
Write-back of temporary files can be set to delay as long as possible with “−x 1”. This is turned off with “−x 0”. Normally temporary files are files that are in the /tmp directory.
−X dirNumber
This identifies the temporary directory to the file system. dirNumber should be the inode number of /tmp. Unfortunately, only one temporary directory is understood.
−y [0|1]
Write-back-as-soon-as-possible caching is enabled with “−y 1” and turned off with “−y 0”. With write-back-ASAP, the write system call completes immediately and the cache block is scheduled to be written out as-soon-as-possible.
−z [0|1]
Write-back-on-last-dirty-block caching is enabled with “−z 1” and turned off with “−z 0”. This policy only works on a server. It means the server writes back its blocks for a file after getting the last dirty block for the file from a client. For example, this policy combined with a write-back-on-close client policy would mean that after a client closes a file, all of the files blocks are guaranteed to be on the server’s disk.
DISK LAYOUT
−B skew
Set the block skew for disk allocation. Not supported in kernel yet.
TRACING/DEBUG FLAGS
There are several tracing/debugging flags that can have their value set via fscmd. Each flag expects a following integer on the command line that will specify the new value of the flag or trace level variable. Fscmd prints out the old value of the flag as it changes it. Some of the flags are Booleans that are set with values of 1 for TRUE, and 0 for FALSE.
−OThe fsStats structure is zeroed out. This information is displayed with the fsStat program.
−t [0|1]
Filesystem tracing is enabled with “−t 1”. This dumps internal events into a circular trace record. The trace gets printed via a special console key sequence, “L1-f”.
−D [0|1]
Cache consistency debug print statements are turned on with “−D 1”, and turned off with “−D 0”.
−R [0|1]
Read ahead tracing is enabled with “−R 1” and turned off with “−R 0”.
−generic arg
A generic hook for temporary file system operations. The result depends on arg.
SEE ALSO
fsStat, prefix, rpcCmd
FILES
/local/diskcmds- Server local startup file
/bootcmds- Network wide startup file
KEYWORDS
debugging, trace, cache, write-back
Sprite version 1.0 — September 28, 1992