%THE HELIOS FILE SERVER, PUBLISHED NOVEMBER 1990. PLEASE IGNORE THE overfull
%h box MESSAGES WHICH APPEAR WHEN YOU RUN LATEX ON THIS FILE: THEY DO NOT 
%AFFECT THE FINAL OUTPUT.
%$Id: HEL91014.tex,v 1.3 1992/01/27 15:59:38 doc Exp $
\documentstyle[twoside,makeidx,a5,times]{psl}
\title{{\Huge The Helios File Server}}
\author{}
\date{}
\makeindex
\pagestyle{plain}
\begin{document}

\include{docinfo}

\docinfotitle{The Helios File Server}
\docinfoauthor{Perihelion Software Limited}
\docinfoproject{HEL}
\docinfoauthinit{PSL}
\docinfoyear{90}
\docinfodocno{014}
\docinforev{1}
\docinfooperator{ID}
\docinfostate{APPROVED}
\docinfosecurity{PUBLISHED 1990}
\docinforeader{PSL}

\maketitle
\input{HEL91015}
\setcounter{tocdepth}{4}
\pagenumbering{roman}
\tableofcontents


\cleardoublepage
\pagenumbering{arabic}

\chapter{Introduction}

The {\tt Helios File Server (HFS)} is a powerful tool designed to deal with
mass storage random access devices in multi processor networks. You can
use the file server to perform tasks which require high data transfer
rates, particularly when you combine it with transputer hosted SCSI
interfaces, or other disc interfaces. Some typical uses for the file
server would be, for example, in the fields of image processing, real
time databases and distributed databases. When it is in daily use, the
file server will improve productivity and reduce your need to use host
processors which are based on old technology. A tape server \index{Tape server} is also
included in the package, giving you access to tapes on the same
interface as the discs. This makes it easier for you to back up your
directories. For example, you might use the {\tt tar}\index{tar} command, which
will be described later in this guide, to archive your material.

\section{Main Features}

{\tt (1)} The {\tt disc organisation} of the Helios file server is based
on that of the Berkeley Fast File System \index{Berkeley Fast File System} of {\tt BSD version 4.2} and
later. Extensions have been added to include the Helios
protection mechanisms and to improve the overall performance of the file
server, which means that the best possible use of disc capacity and bandwidth 
is now guaranteed.
\vspace{0.25cm}
 
\noindent {\tt (2)} A {\tt cache} \index{Cache} gives you access to data out of memory, when it
is present. Using {\tt read ahead} and {\tt write behind},
 the disc access times will move outside the client's critical
path, allowing data to be transferred between the client and the file
server at a very high rate. It is possible to reach data transfer rates 
of over 500Kbytes per second between processors, and 2 to 3 Mbytes per
second within a processor, to and from the {\tt cache}.
\vspace{0.25cm}

\noindent {\tt (3)} {\tt Multi threading} within the server gives access to many clients
at the same time. This also means that high data transfer rates can be
reached and maintained at a speed comparable to that of the hardware.
\vspace{0.25cm}

\noindent {\tt (4)} The {\tt block size} of the file server is set to 4Kbytes. This
 makes large disc transfers possible, increasing the band width in
the process, by allocating adjacent file blocks to adjacent disc blocks.
The disc is divided into several {\tt cylinder groups} of equal size
which can be individually controlled for the allocation of blocks. The
{\tt block allocation algorithms} make sure that there is a good
compromise between the clustering and the spreading of information, so
that any wasted empty space at the end of a file is kept to a minimum.
\vspace{0.25cm}

\noindent {\tt (5)} The Helios file server differs from the {\tt BSD Fast File
System} in  that it does not use {\tt hard links}, and that
{\tt inodes} are stored in the parent directory. This means that 
 directory searching, access rights calculation and update
will operate more quickly. You can still achieve the same effect as {\tt
BSD links} by using {\tt Helios symbolic links}, which allow the file
server to store links to objects both inside and outside the volume of
the disc.
\vspace{0.25cm}

\noindent {\tt (6)} The Helios file server is used as a {\tt device independent}
Helios server. This means that it can run on any node in a processor
network, more than one file server may be present in a system, and all
these file servers may be accessed in a {\tt transparent} manner by
clients.
\vspace{0.25cm}

\noindent {\tt (7)} The Helios file server is {\tt fully parameterised}, which
means that you can use it with a wide range of hardware. The {\tt device
interface} is only bound to the server at run time, allowing you to run
the server on any hardware for which you can write a device.
\vspace{0.25cm}

\noindent {\tt (8)} In addition to interfaces for the SCSI and M212 disc devices,
an inexpensive alternative is provided in the form of a {\tt raw disc
I/O server interface}.\index{Raw disc
I/O server interface.} This means that the Helios file server can make
use of a free partition on the disc of a host such as a PC. Support for access to a tape device using the same I/O driver is
also included.
\vspace{0.25cm}

\noindent {\tt (9)} The HFS software package comes complete with a number
of {\tt utilities} to make it easier to use the file server and
the file system consistency checker. There are mechanisms, (based on
capabilities), for the protection of files. The file server can also be used
within the protection mechanisms\index{Protection mechanisms} of Helios, version 1.2. (This will
prevent other people from damaging your files when working in a multi
user environment.)
\vspace{0.25cm}

\section{Tape Support}

HFS provides support for access to a tape. This comes in the form of a
file which you can use with the normal {\tt I/O file access
functions}. To make this option work, you will need to define a second
volume in the {\tt devinfo.src} file, with the  type {\tt raw}. The
name of the tape file will be the same one that appears in the name
entry of the volume. Remember that the {\tt raw} volume {\em must} be
the second volume. Note that a tape does not contain the Helios Filing
System, so it should be specified as of type `raw' in the devinfo file.
The normal way to gain access to the tape system is
to use the {\tt tar} command, which is described in Chapter 5 of this
guide.
   

\section{SCSI and M212 Device Support}

The Helios File Server is hardware independent. It uses device drivers
to access many of the most popular transputer disc interfaces. Several
possible configurations are currently available for the Helios File
Server. Please refer to the separate, loose leaf notes entitled: `The
Helios File Server: Installation Information', for an explanation of
product specific hardware requirements.



\section{Software Requirements}

You will need to use version 1.1A, or a later version of The Helios
Operating System to run the file server. The commands for manipulating
the protection mechanism are documented in this guide, but the relevant
software is not included in this package because you will find that it
is already provided as a part of the standard operating system release.

\noindent {\bf Note:} For a list of the files contained in the Release
Disc, please refer to the separate, loose leaf notes entitled: `The
Helios File Server: Installation Information'.
\pagestyle{empty}


\cleardoublepage
\pagestyle{plain}
\chapter{Installation}

These are the steps you should take to install the Helios File Server in
your system:

\begin{enumerate}
\item Copy the software into your system.
\item Configure the software to run with your hardware.
\item Format and initialise the hardware to work with the file server.
\item Run the file server.
\end{enumerate}

\noindent (The rest of this chapter describes in detail how to work through each of
the above stages.)


\section{How to copy the disc}

Before you can install the file server, you must first make a backup
copy of the release disc\index{File server release disc}. Copy the directories {\tt lib}, {\tt
bin}, and {\tt etc} from the floppy disc into the equivalent Helios
directories. You will not need to copy the {\tt devs} 
directory unless you intend to write your own device driver.
You will not need to copy the {\tt msdos}\index{MSDOS} directory either, 
because the device drivers  it contains only have to be run once. 
If you would like to find out more about this,  read  The
Perihelion Software Technical Report No.19: The Helios Interface To 
Hardware Devices. Users of Helios version 1.2 onwards can use the {\tt
Loadpac} installation program to load their software automatically. 


\section{The DevInfo File}  

Before you run the file server, make an appropriate entry in
the {\tt devinfo.src} file\index{Devinfo.src file}. (You will find that the example file
contains entries for each of the currently supported devices.) Now, find
the {\tt discdevice} which corresponds to the device you want to use,
and edit the drive parameters to match your disc. (Please refer to
the note at the end of this section.)
You must also decide how much {\tt cache memory}\index{Cache memory} the file server
should be allowed to use. The practical minimum is {\tt 100k}, and any value
of over 1 Mbyte will allow most of your working files to be {\tt
cached}. When you have edited the {\tt devinfo.src} file, you should
compile it again by using the following command:

\begin{verbatim}
gdi /helios/etc/devinfo.src /helios/etc/devinfo
\end{verbatim}

\noindent {\bf Note 1:} Currently, several possible configurations are
available for the Helios File Server. For details of hardware specific
entries, please refer to the separate, loose leaf notes entitled: `The
Helios File Server: Installation Information'. There
is also an example of the {\tt devinfo.src} file in the appendix of these
notes, and on page 8 of The Perihelion Technical Report, Number 20:
`Device Configuration'.


\subsection{Entries for the Raw Disc}

The raw disc service \index{Raw disc service} is provided by a server within the Helios I/O server.
This provides you with a directory called {\tt /rawdisc}, containing a
list of partitions which are available for the file server to use. you
will need to {\tt initialise} the parameters in the {\tt fileserver} and
{\tt discdevice} structures of the {\tt devinfo.src} file\index{Devinfo.src file}, to set up the
partitions you intend to use. Run the {\tt makedisc} program and the
disc parameters, (such as sectorsize, and the number of sectors, tracks and 
cylinders), will be displayed on your screen. If you have already run
the {\tt makedisc} program once, simply rerun it to obtain this information.





\subsubsection{The PC Raw Disc Service}

If you are using a {\tt PC}, the {\tt rawdisc} directory will only contain
one partition, which you must {\tt define} by making the entry:

\begin{verbatim}
rawdisc_drive = `x'
\end{verbatim}

\noindent in your {\tt host.con} file\index{host.con file}. (The {\tt `x'} in our example
above represents the drive you intend to use. It might be drive D
for instance.) You will need to set the {\bf controller}
field to {\tt 0} in the disc device entry for the file server you want
to use, (i.e. The Helios file server), because {\tt rawdisc} only
contains a {\tt 0} file.


\section{Formatting and initialisation}

Before you can run the file server on a disc or on o partition, it must
be formatted and then initialised with the file server data structures.
For details of the {\tt fsformat} command, see Chapter 3 of this guide.
For hardware specific information, read the separate notes entitled `The
Helios File Server: Installation Information'. 	

Once formatted, the disc or partition must be initialised before use.
This is achieved by starting the file server with the {\tt -m} option.
{\bf For example:} \begin{verbatim}
/helios/lib/fs -m <name>
\end{verbatim}

Note that the name must be the same as the name of the `fileserver'
entry in the {\tt devinfo.src} file. It is also the name you associate
with the disc or partition you have just formatted. After
initialisation, you can run the fileserver.

\section{How to run the File Server}

The Helios File System can be booted with the following set of options:
\begin{verbatim} fs [-m|-f|-b|-n|-s] <device>
\end{verbatim}


\noindent {\tt -m} \hspace{0.25cm} Call the Format routine.

\noindent {\tt -f} \hspace{0.25cm} Perform Full Checks (default).

\noindent {\tt -b} \hspace{0.25cm} Perform Basic Checks only.

\noindent {\tt -n} \hspace{0.25cm} Bypass the checker completely.

\noindent {\tt -s} \hspace{0.25cm} Create a new superblock.
\vspace{0.25cm}


If you want to run the file server {\tt locally}, you should use the
command: 

\begin{verbatim}
/helios/lib/fs <name> &
\end{verbatim}

\noindent {\tt $<$name$>$} is the file server `entry' name in the {\tt
devinfo.src} file.
\vspace{0.25cm}

\noindent{\bf Caution:} If the  CDL shell variable\index{CDL shell variable} is set, the {\tt task
force manager} will automatically place the file server on a processor of
its own choice. 

\noindent If you want to run the file server on a specific processor, use the
command: 
\nopagebreak
\begin{verbatim}
remote -d <FSMachine> /helios/lib/fs <name>
\end{verbatim}

\noindent This command would be particularly useful when you want to run
the file server on a processor which is adjacent to the controller hardware.

\noindent As an alternative,
you might run the file server from the {\tt initrc} file\index{initrc file}, by changing
the command to:

\begin{verbatim}
run -e /helios/lib/fs fs <name>
\end{verbatim}

\noindent You will now have the file server running, and you can gain access to it
 as a server by using the  volume name which you gave in the
{\tt devinfo} file.
\cleardoublepage

\chapter{Commands}
 
\noindent This chapter consists of an alphabetical list of the commands
you can use with the Helios file server. Most of these commands are
supplied on the file server release disc,\index{File server release disc}
(See the separate, loose leaf notes entitled:`The Helios File Server: Installation Information', Table 4.1), and the
remainder are included in version 1.2 onwards of The Helios Operating System.
\newpage



\hspace{4cm}{\large \bf chmod}
\vspace{0.5cm}

\noindent {\bf Purpose:} To alter the access matrix of an object.
\vspace{0.5cm}

\noindent {\bf Format:} \begin{verbatim} chmod {[vxyz][+-=][rwefghvxyzda] <file>}
\end{verbatim}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent The {\tt chmod} command\index{chmod command@{\bf chmod command}} is supplied with version 1.2 onwards of The
Helios Operating System, and you would use it to alter the  access
matrices of  objects within servers such as the  file server and the
ram disc server\index{Ram disc server}, which can use protection. The  command
line is made up of a sequence of  matrix modifiers\index{Matrix modifiers} and object
names. A matrix modifier starts with a category letter,
which is followed by an  operator and then finally, there is an 
access mask specification.\index{Access mask} The category letter will be one
of the
following letters: {\tt v,x,y,} or {\tt z}. (The letter {\tt v}
is the symbol for the rights of the owner, {\tt z} is for public rights,
and {\tt x} and {\tt y} are for friends.) As the  operator, you
would need to tell your system how you want to combine the new access mask
with the existing one, for the category you are working on. The example
below shows you how to do this:
\vspace{0.25cm}

{\tt +} The new mask is added to the current mask

{\tt -} The new mask is deleted from the current mask

{\tt =} The current mask is replaced by the new mask
\vspace{0.25cm}

\noindent To specify the access mask \index{Access mask}, give the letters which stand
for the access rights in any order. The  matrix changes you specify   
will affect all the subsequent  objects in the  argument list.
Some more  modifiers may also appear, and the effect they have will
be combined with that of previous  modifiers. The  access
matrix\index{Access matrix} of an  object will only be changed if the client has
alter rights to that  object.

\noindent{\bf For example:} Imagine that you have a file called {\tt fred} which
you want to make inaccessible to the public, but still available
to all other clients. You could use the following command:

\begin{verbatim}
chmod v-w x-w y-w z-rw fred
\end{verbatim}

\noindent Now, imagine that you have a directory called {\tt adm}, and you want to
make it inaccessible to all clients except those with {\tt x
access rights}. Use the command:

\begin{verbatim}
chmod v= x=rwvxyzda y= z= adm
\end{verbatim}
\nopagebreak

\noindent If you want to know more about protection, 
refer to The Helios Operating System, chapter 13:  `Protection and
Authentication'. 
\vspace{0.5cm}

\noindent {\bf See also: refine}
\vspace{0.25cm}


\noindent {\bf Note:} For the Disc Editor, see Chapter 4.

\newpage

\hspace{4cm} {\large \bf fs}
\vspace{0.5cm}

\noindent {\bf Purpose:} The binary object of the Helios File System.
\vspace{0.5cm}

\noindent {\bf Format:}
\vspace{0.25cm}

\noindent {\tt /helios/lib/fs -m $<$device$>$} (To create a new file system.)

\noindent {\tt /helios/lib/fs $<$device$>$} (To boot the file server.)
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent This command \index{fs command@{\bf fs command}} contains the {\tt binary code} of the 
file server. If you call it up by using the option {\tt -m}, the {\tt formatting
routine} is carried out, so that a new file system is generated on the
disc. (The program ends when this step is completed.) If you call up
{\tt fs} without using the option {\tt -m}, the file server will be {\tt
booted.} (The {\tt $<$device$>$} in the format illustrated above
corresponds to the fileserver entry in the {\tt devinfo} file. If you want to place the server 
on a processor of your choice, you can use the {\tt remote} utility\index{Remote utility}. There are
two further options: {\tt -b} and {\tt -f}. These options call up the
two different checking modes of the file system checker. (Please refer
to Chapter 6, section 2 for a detailed description of the checking modes.)


\newpage
\hspace{4cm}{\large \bf fsformat}
\vspace{0.5cm}

\noindent {\bf Purpose:} To format a disc partition.
\vspace{0.5cm}

\noindent {\bf Format:} \begin{verbatim} fsformat [-p<number>][-i<number>][-t<number>]
[-c<number>] devname
\end{verbatim}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent This command \index{fsformat command@{\bf fsformat command}} will format a specified
disc partition\index{Disc
partition} according to the parameters supplied. You would use {\tt
devname} as the  discdevice entry name of the device you are going
to use. The flag {\tt p} introduces the number of the partition which
will be  formatted, and the default is {\tt 0}. There are three
other {\tt flags}, as follows:
\vspace{0.25cm}

\noindent {\tt -i} introduces the {\tt interleave factor},
(Default 1)

\noindent {\tt -t} introduces the {\tt track skew} to be used,
(Default 0).

\noindent {\tt -c} introduces the {\tt cylinder skew} to be used,
(Default  0).
\vspace{0.25cm}

\noindent Remember that variations in the  format of a disc can make a
significant difference to the performance of the file server. The most
important thing for you to consider here is the  interleave \index{Interleave} of
sectors on a single track. If the interleave is too small, it might make
the  device wait for an entire revolution between each sector, and
if it is too large, it could cause unnecessary  latency.
The  track skew\index{Track skew} is the difference between the positions of the 
first sectors on adjacent tracks in the same cylinder, and its purpose
is to allow for any  head change latency,(although this is usually
zero). 
The {\tt cylinder skew}\index{Cylinder skew} is the difference between the positions of the
 first sector on the  last track of the cylinder {\tt n},
for example, and the  first sector on the  first track of the
cylinder {\tt n+1}. You can use the  cylinder skew to change the
position of the  first sector of  track {\tt 0} to the  start
position on each cylinder. You can also use the  cylinder skew to
make allowance for  seek latency between adjacent cylinders. (The {\tt disc editor}\index{Disc
editor}, which will be described in Chapter 4, includes some
commands designed to let you experiment with the format of a disc.)
\vspace{0.25cm}

\noindent {\bf Note:} Some disc drivers may not use some of  the
parameters supplied for the format of a disc. Remember that formatting a
disc can be a lengthy process, depending on the size of the disc, speed
and driver implementation.


\newpage

\hspace{4cm} {\large \bf fsync}
\vspace{0.5cm}

\noindent {\bf Purpose:} Toggle between partly and fully synchronous modes.
\vspace{0.5cm}

\noindent {\bf Format:} {\tt fsync fileserver -[a/s]}
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent If you want to change the {\tt cache} behavior\index{Cache behaviour} of the file
server, you will need to use the {\tt fsync} command\index{fsync command@{\bf fsync command}}. When the file
server is operating normally, it will only  write blocks of data
from the {\tt cache} to disc 
\vspace{0.25cm}

\noindent {\tt (a)} When it needs to re-use the  cache memory.

\noindent {\tt (b)} When you use a {\tt sync} command \index{sync command}, or

\noindent {\tt (c)} Automatically, at intervals of 20 seconds.
\vspace{0.25cm}

\noindent This is called {\tt asynchronous} behaviour\index{Asynchronous behaviour}, and it is the default
behaviour for the file server. There is an alternative way for the file
server to behave, and this is called {\tt synchronous}\index{Synchronous behaviour}, which means that
the file server will  write the data to disc immediately. You can
pre-set this alternative behaviour in the {\tt devinfo} file\index{Devinfo file}, but you
can also change from the default to the alternative  dynamically,
by using the {\tt fsync} command\index{sync command}\index{fsync command}. If you use this command, remember that
the first argument you use with it must be the server name of a
file server volume, and the second argument will be either {\tt a}
or {\tt s}, depending on whether you are going to use the {\tt asynchronous}
or the {\tt synchronous} mode.
\vspace{0.25cm}

\noindent {\bf Example:} {\tt fsync /raw -s}
change fileserver /raw to synchronous mode.

\noindent {\bf See also: sync}


\newpage

\hspace{4cm} {\large \bf gdi}
\vspace{0.5cm}

\noindent {\bf Purpose:} To compile a devinfo file.
\vspace{0.5cm}

\noindent {\bf Format:} {\tt gdi source destination}
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent This command \index{gdi command@{\bf gdi command}} is a {\tt compiler} for the
{\tt devinfo} file\index{Devinfo file}. Its
source file  should be a description of {\tt devinfo} in the form of
text. When the file has been compiled, it will be placed in the 
destination file. When the file server is searching for the compiled
file, it will look in the following files:
\begin{verbatim}
(a)  /rom/devinfo
(b)  /loader/DevInfo
(c)  /helios/etc/devinfo
\end{verbatim}
(The program will tell you if you have made any errors in the syntax.)
\vspace{0.25cm}

\noindent To compile a {\tt devinfo.src} file, use a command line like
the example illustrated below:\begin{verbatim}
gdi devinfo.src devinfo
\end{verbatim}

\noindent This will create a binary date file {\tt devinfo}, which the file server
can use to obtain the disc characteristics.

\newpage

\hspace{4cm} {\large \bf loadm2}
\vspace{0.5cm}

\noindent {\bf Purpose:} To load M212 firmware.
\vspace{0.5cm}

\noindent {\bf Format:} {\tt loadm2 linkno}
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent You would use the {\tt loadm2} command\index{loadm2 command@{\bf loadm2 command}} to load
{\tt firmware}\index{Firmware} onto an
M212 disc controller\index{M212 disc controller}. The argument to use with this command will
be the number of the  link attached to the {\tt M212}, on the
processor which is running the {\tt loadm2} program. The {\tt M212} should
be in {\tt reset state}, and ready to  boot from its link. The 
{\tt loadm2} program will look for the  firmware in the file 
{\tt /helios/lib/b5multi.b2}. This code is supplied with the M212 and it should be
copied to the {\tt /helios/lib} directory.



\newpage

\hspace{4cm} {\large \bf refine}
\vspace{0.5cm}

\noindent {\bf Purpose:} To refine and generate a capability.
\vspace{0.5cm}

\noindent {\bf Format:} {\tt refine [+-=][rwefghvxyzda] object...}
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.25cm}

\noindent The {\tt refine} command\index{refine command@{\bf refine command}} is supplied with The Helios Operating
System, version 1.2 onwards.
This command will give you the  name and the  capability, in
coded form, for each individual {\tt object} in a list. The  capability
is  encoded in the form of 16 characters. These are {\tt
concatenated} with the name of the file, and prefixed with a {\bf @}
character. The {\tt Helios System Library}\index{Helios System Library} will recognise this format
for file names, so it will allow you to use such a {\tt string} of 16
characters in situations when it would normally expect to be given the
name of a file. In particular, these  strings can be placed in a
 shell variable or in an  environment variable, and they can
be  compiled into programs. The {\tt refine} command also allows you
to change the {\tt access mask}\index{Access mask} which is stored in the {\tt capability},
by taking steps similar to those you would use with the {\tt chmod} command\index{chmod
command}, described earlier in this chapter. (Once again, for further
reference you could read The Helios Operating System, Chapter 13:
`Protection and authentication').
\vspace{0.25cm}


\noindent {\bf See also: chmod}

\newpage

\hspace{4cm} {\large \bf sync}
\vspace{0.5cm}

\noindent {\bf Purpose:} To flush the cache of the file server.
\vspace{0.5cm}

\noindent {\bf Format:} {\tt sync $<$fileserver$>$}
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent When you use this command \index{sync command@{\bf sync command}}, the file server will {\tt flush} any blocks
of data which are out of date from its {\tt cache} to disc, and this
will {\tt synchronise} the cache and the disc. You only need to use one
argument, and that will be the {\tt server name} of the file server to
be synchronised.
\vspace{0.25cm}

\noindent {\bf Example:} {\tt sync /raw}

\noindent {\bf See also: termfs}
\vspace{0.25cm}

\noindent {\bf Note:} For {\bf tar}, see Chapter 5

\newpage

\hspace{4cm} {\large \bf termfs}
\vspace{0.5cm}

\noindent {\bf Purpose:} To stop a file server.
\vspace{0.5cm}

\noindent {\bf Format:} {\tt termfs $<$fileserver$>$}
\vspace{0.5cm}

\noindent {\bf Description:}
\vspace{0.5cm}

\noindent Use this command \index{termfs command@{\bf termfs command}} to  terminate the file server. Once again, you
only need to use one argument, which will be the {\tt server name} of
the file server to be terminated.
\vspace{0.25cm}

\noindent {\bf See also: sync}


\cleardoublepage

\chapter{The Disc Editor}

The {\tt disc editor}\index{Disc editor@{\bf Disc editor}} is a simple program for examining a Helios file server disc
or partition. You can call it up by using the command:

\begin{verbatim}
de <fsname>
\end{verbatim}

\noindent (Remember that {\tt $<$fsname$>$} must be the same as the name of the
{\tt devinfo fileserver entry} of the disc you are going to examine.)
The disc editor uses just one {\tt block buffer}. You can place disc
blocks in this buffer to read, examine and alter them before finally
{\tt writing} them back to disc. (The commands you can use with the disc
editor are listed below.)

\section{A read-write check of the disc}

{\bf Format:} {\tt a} 
\vspace{0.25cm}

\noindent {\bf Caution:} (When you use this command, you will wipe out
any data that was on the disc.) This command will perform a complete {\tt read
-write} check of the disc. The disc editor will then tell you if any of the
blocks of data are {\tt bad}. When you have {\tt initialised} the disc by
using the {\tt m} command, you can use the list of {\tt bad} blocks with the
{\tt k} command to prevent the filing system from using them.

\section{A read-write test on the disc}

{\bf Format:} {\tt t} 
\vspace{0.25cm}

\noindent {\bf Caution:} (You should only use this command on empty
discs, because it will destroy any filing system that is present.)
When you use this command, a prompt will appear on the screen for you to
give the {\tt data size} you are going to use. (The data size is
measured in Kbytes, and the  default size is 64 kbytes.) The data
will then be written to the disc, and read back, starting at
{\tt block 0}. (This operation will be timed, and the results will then
be reported to you on the screen.) If you use the {\tt m} command to
vary the format of this region of the disc, and then use this {\tt t}
command to perform a read-write test on the disc, this will help you to
find the best  format for your needs.


\section{Mark bad blocks}

{\bf Format:} {\tt k $<$n$>$}
\vspace{0.25cm}


\noindent This command marks the given block as allocated, so that it
will not be used by the file system.


\section{Set the block size}

{\bf Format:} {\tt b $<$n$>$} 
\vspace{0.25cm}

\noindent You can use this command to set the {\tt block size}\index{Block size}. ($<$n$>$ represents the
size you choose.)


\section{Interpret the current block as a cylinder group block}

{\bf Format:} {\tt c}
\vspace{0.25cm}


\noindent This command will give you a summary of the {\tt cylinder
group}.\index{Cylinder group} It
also gives you the {\tt allocation map}\index{Allocation map} and the cylinder group's copy of
the {\tt super block}\index{Block: super block}.

\section{Display the contents of the current block}

{\bf Format:} {\tt d} 
\vspace{0.25cm}

\noindent When you use this command, the contents of the current block will be
displayed in {\tt dump} format.

\section{Print out a directory entry in the current block}

{\bf Format:} {\tt f $<$n$>$} 
\vspace{0.25cm}

\noindent Use this command to print out a particular directory entry in the
current block. ($<$n$>$ represents the entry you want to print out.)
Your printout will also show you which are the {\tt direct data blocks}\index{Blocks: direct blocks}, and
the first {\tt indirect data blocks}\index{Blocks: indirect blocks}, so this command gives you more
information than the {\tt l} command, which will be described later in
this chapter.

\section{Print a description of each command}

{\bf Format:} {\tt h}
\vspace{0.25cm}

\noindent If you would like to see a brief description of each of the commands you
can use with the disc editor, just use this command and it will be
printed out for you to study.\index{Disc editor commands: description}

\section{Interpret the current block as a directory block}

{\bf Format:} {\tt l} 
\vspace{0.25cm}

\noindent Use this command to have the current block interpreted as a 
{\tt directory block}\index{Block: directory block}, and to display a list of the {\tt valid directory
entries}.


\section{Format cylinders on the disc}

{\bf Format:} {\tt m}
\vspace{0.25cm}

\noindent {\bf Caution:} (When you use this command, you will wipe out any data
that was on the disc.)
With this command, you can format a number of cylinders on the disc.
When you have entered the command, a prompt will appear on the screen
for the  cylinder extent,\index{Cylinder extent} the interleave\index{Interleave} and the track
and  cylinder skews.\index{Track skew} \index{Cylinder skew} You would normally use this command to
test  disc devices, but you can also use it in conjunction with the
{\tt t} command to find out the best possible  interleave and 
skew for the disc.


\section{Quit the disc editor}

{\bf Format:} {\tt q}
\vspace{0.25cm}

\noindent  Use this command when you want to end your session on the disc editor.
\index{Disc editor: how to quit}

\section{Read a block}


{\bf Format:} {\tt r $<$n$>$}
\vspace{0.25cm}

\noindent $<$n$>$ here represents the {\tt block number}\index{Block number} you want to read.
If no {\tt argument} is given in the command, the current block
number is used. (The current block number is set by any argument you use
with an {\tt r} command or with a {\tt w} command.)

\section{Interpret current block as disc summary block}

{\bf Format:} {\tt s} 
\vspace{0.25cm}

\noindent The current block will be interpreted
as the  {\tt disc summary block} when this command is used.
\index{Block: disc summary block} This means that you will be able to see 
the  root directory entry and the {\tt allocation summaries}\index{Allocation summaries} for the 
whole file server and for each cylinder group. The  disc summary block
will always be  block number {\tt 1}.

\section{Toggle the block valid flag}

{\bf Format:} {\tt v}
\vspace{0.25cm}

\noindent If you have altered a block by using the {\tt =} command, the disc
editor will not allow a new block to be read until (a): the original
block has been {\tt written} back to disc, or (b): you give the {\tt v}
command to invalidate the changes you made to the block.
\index{Block valid flag}

\section{Write a block}

{\bf Format:} {\tt w $<$n$>$}
\vspace{0.25cm}

\noindent With this command you can write the current block, or another block of
your choosing. (The {\tt $<$n$>$} represents the number of the block you
choose.)
\index{Block: writing a block}

\section{Toggle the write protect mode}

{\bf Format:} {\tt x} 
\vspace{0.25cm}

\noindent The  default setting for the {\tt write protect mode}\index{Write protect mode} is {\tt ON}.
This means that the disc editor will not write to the disc. You can use
the {\tt x} command to {\tt switch off} the mode.

\section{Zero a block}

{\bf Format:} {\tt z} 
\vspace{0.25cm}

\noindent This command zeros the contents of the current block buffer.

\index{Block: to zero a block}

\section{Report size and number}

{\bf Format:} {\tt ?}
\vspace{0.25cm}

\noindent Use this command to obtain a report of the disc size, the block size and
the current block number.

\section{Set the current block position}

{\bf Format:} {\tt $<$hex$>$}
\vspace{0.25cm}

\noindent You can set the current block position by using a
{\tt hexadecimal number}\index{Hexadecimal
number} by itself. The number must start with a digit, so those values
which would normally start with the letters {\tt a} to {\tt f} should be
prefixed with a {\tt 0}.


\section{Set the byte}

{\bf Format:} {\tt = $<$hex$>$} 
\vspace{0.25cm}

\noindent You would use this command to {\tt set the byte}\index{Byte: how to set it} at the current block
position. Use the previous command to set the byte position for this command. 

\vspace{0.25cm}

\cleardoublepage

\chapter{The `tar' File Archiver}

\section{Background Information}

{\tt tar}\index{tar@{\bf tar}} provides you with a way to store many files into one single
{\tt archive}\index{Archive}. It is useful for making backup copies\index{Backup copies} or for
packaging up a set of files that you want to move to another system.
There are several ways for you to store your {\tt archive}:
\vspace{0.25cm}

\noindent(a) You could keep it in another Helios file.
\vspace{0.25cm}

\noindent(b) You could store it on an  I/O device such as  tape\index{Tape}, 
 floppy\index{Floppy disc},  cartridge\index{Cartridge} 
or  hard disc\index{Hard disc}. 
\vspace{0.25cm}

\noindent(c) You could send it over a network.
\vspace{0.25cm}

\noindent(d) You could {\tt pipe}\index{Pipe} it to another program.
\vspace{0.25cm}

\noindent The {\tt tar} file archiver was originally available at the same time as
version 7 of  Unix\index{Unix}, and it has continued basically unchanged. It
has been proposed as the standard format for the interchange of files
among systems which conform to the IEEE P1003 Portable Operating System
(POSIX)  \index{IEEE P1003 Portable Operating
System} standard. The current version of {\tt tar} gives you some of the
extensions which were proposed in the draft standards for the
P1003, including owner and group names and support for named
pipes, fifos, contiguous files, and block and character devices. 

\section{Main Features}

\subsection{tar Options}

If you are reading an archive with the current version of {\tt tar}, you
will be able to continue even if {\tt tar} finds an error. (In the past,
{\tt tar} would always stop if it found {\tt checksum errors}\index{Checksum errors}, and you would
need to use the {\tt i} option so that you could continue your reading.)
You can {\tt specify} {\tt tar} options\index{tar options} in two ways:
\vspace{0.25cm}

\noindent (a) You can use normal Unix\index{Unix} conventions. (This means that each
option you specify must be preceded by a {\tt dash} (like this {\tt
-}), and if you use an  argument, it must directly follow the
option you are specifying. You can combine several options behind one
dash ({\tt -}), but only if you are not using any arguments with
those options.
\vspace{0.25cm}

\noindent (b) For compatibility with the {\tt Unix tar program}, You can also
specify the options as {\tt keyletters}\index{Keyletters}. (This means that you put all
of the option letters into the first argument to {\tt tar}, without
using the dash ({\tt -}). Any argument you use with your options must
be placed inside the second or third (etc) argument to {\tt tar}. 
\vspace{0.25cm}

\noindent {\tt For example:}
\vspace{0.25cm}

\noindent Normal: {\tt tar -f arcname -cv file1 file2}
\vspace{0.25cm}

\noindent Old: {\tt tar fcv arcname file1 file2}
\vspace{0.25cm}

\noindent You must include at least one of the options {\tt -c, -t, -d or -x}, but
you can use any of the other options whenever you choose.

\subsection{A list of the tar options and their effects}

{\bf Option} \hspace{1cm} {\bf Effect}


\begin{itemize}
\item[{{\tt -b} {\em N}}]
This option specifies a {\tt blocking factor}\index{Blocking factor} for the archive. The block
size will be {\em N x 512} bytes. Larger blocks typically run faster,
and they will allow you to store more data on a tape. The {\tt default
blocking factor} is normally 20, and it is set when {\tt tar} is
compiled. The maximum block size is limited only by the memory space
available, and by the ability of the device containing the archive to
{\tt read} and {\tt write} the size you want to use.

\item[{\tt -B}]
If you are reading an archive, you can use this option to {\tt re block}
it as you read it {\tt tar} normally reads each block with a single {\tt
read} system call, but this does not work when you are reading from a
pipe, because the command {read} will only give you the data that has
arrived {\tt so far}. If you use the {\tt -B} option, {\tt tar} will
carry out the {\tt read} command repeatedly to fill out to a record
boundary, rather than reporting an error. (The {\tt -B} option is in
fact the {\tt default} when you are reading an archive from standard
input.

\item[{\tt -c}]
Use this option to create an archive from a list of files.

\item[{\tt D}]
When you are creating an archive, this option makes sure that you can
{\tt dump} a directory without dumping the files inside it.
\index{Dumping directories}

\item[{{\tt -f} {\em F}}]
Use this option to specify the {\tt filename}\index{Filename} of the archive. If your
filename was represented by a dash (-), then the archive would be read
from the standard input, or written to the standard output. If you are
not using the {\tt -f} option, and the environment variable {\tt TAPE}
exists, then you would use its value as the filename. (Otherwise, a
default filename which was determined when {\tt tar} was compiled is
used. {\bf For example:} {\tt tape}, preceded by a forward slash (/). The default is
normally set to the {\tt first} {\tt tape drive}\index{Tape drive}, or to another transportable
{\tt I/O} medium on your system.

\item[{\tt -h}]
If {\tt tar} comes across a {\tt symbolic link}\index{Symbolic link} when you are creating an
archive, this option will make sure that you dump the file or directory
that the link is pointing to, rather than dumping it as a symbolic link.

\item[{\tt -i}]
This option tells {\tt tar} to ignore blocks of {\tt zeros} in the
archive. (Normally, a block of zeros indicates the end of an archive,
but they can sometimes be found in the middle of a damaged archive, or
at intervals in an archive which was made up of several others, so in
these cases the {\tt -i} option allows {\tt tar} to continue
unhindered.) Note that with this option set, {\tt tar} will read right
to the end of your file, thus eliminating any possible problems with
multi file tapes.

\item[{\tt -k}]
Use this option to ensure that when you extract a file from an archive,
you keep the existing files, rather than overwriting them with the
versions from the archive.
\index{Archive file extracting}

\item[{\tt -l}]
When you are {\tt dumping} the contents of a directory to an archive,
the {\tt -l} option allows you to stay inside the local file system of
that directory. This option will only affect the files you dump because
they are in a {\tt dumped directory}\index{Dumped directory}, and not those files which are
named on the command line. (The latter are always dumped, and they can
be from various file systems.) The {\tt -l} option is useful for making
{\tt full dump} archival backups of your file system. Any files which
are  skipped while you are using this option will be listed on the
standard error.\index{Standard error}.\index{Archive backups}

\item[{\tt -m}]
When you are extracting files from an archive, use this option to set
the modified {\tt timestamp} of each file to the current time, rather
than extracting the timestamps\index{Timestamps} individually.

\item[{\tt -o}]
You would rarely need to use this option, but if you are creating an
archive, it will write an {\tt old format} archive which does not
include any information about directories, pipes, fifos, contiguous
files or device files. In most cases you will find that a {\tt new
format} archive can be read by an  old format tar program without
difficulty.\index{Archive: old format archives}

\item[{\tt -p}]
Use this option when you are extracting files from an archive, to
restore them to the same {\tt permissions} that they had inside the
archive. (If you do not specify the {\tt -p} option, the current {\tt
unmask} will limit the permissions of the files you extract. See {\tt
unmask} for further details.

\item[{\tt -R}]
Each time that {\tt tar} produces a message, this option will print the
record number inside the archive where the message occurred. You would
find this particularly useful when you are reading damaged archives\index{Archives:damaged},
because it helps you to pinpoint the damaged sections. 

\item[{\tt -s}]
When you want {\tt tar} to extract a number of files from an archive, or
to list their names, you can use the {\tt -s} option to have your list
of filenames sorted into the same order as the tape. This means that you
can call for very long lists even if you are using a small machine,
because the entire list need not be read into memory at once. If you run
{\tt tar -t} on your archive and edit its output, this will also create
a sorted list\index{Sorted list of files}.

\item[{\tt -t}]
If you want to draw up a table of contents\index{Archive: table of contents} for one of your existing
archives, use this option. If file names are specified, only the files
which match those names will be listed. (The listing appears on the
standard output.)

\item[{\tt -T, F}]
Rather than specifying filenames or regular
expressions\index{Regular expressions} as arguments to
the {\tt tar} command, this option ensures that they are read from the
file {\tt F}, at the rate of one per line. If the filename you specify
is {\tt -}, the list is read from the standard input. When you use this
option in conjunction with the {\tt -s} option, you can process longer
lists of files, and you can {\tt pipe} them to {\tt tar}.
\index{Pipe}

\item[{\tt -v}]
This option causes {\tt tar} to be {\tt verbose} about the files which
are being processed or listed. (Archive creation, file extraction and
differencing are normally silent, and archive listing simply gives
filenames.) The {\tt -v} option produces a listing of the {\tt ls -l}
type. The output from this option appears on the standard output, except
when creating an archive, in which case it goes to the standard error\index{Standard
error} output. (This is because the new archive might be on the standard
output.) 

\item[{\tt -x}]
Use this option to extract files from an existing archive. If filenames
are specified, only files which match the specified names will be
extracted. (Otherwise, all of the files in the archive will be
extracted.)
\end{itemize}



\subsection{Archiving files and directories}

When you have chosen your options, you must give {\tt tar} the name(s) of the
file(s) you want it to work on. ({\tt tar} can read a list of names from
a file if you use the {\tt t} option.) If you specify the name of a 
directory, {\tt tar} will process it and all of the files it contains
recursively. If you specify a full path name when you are
creating an archive, it will be  written to that archive without
the initial forward slash (/), so that those files can later be
 read into a location different from the one where they were
dumped, and {\tt tar} will print a warning. If you attempt to extract
files from an archive which contains full path names, {\tt tar}
will only extract them in relation to the current directory, and once
again, a warning message will appear. When you are extracting or listing
files, {\tt tar} will treat the  filenames as regular
expressions, mainly using the same syntax as the shell.  The
shell itself will separately match each substring between a
forward slash (/), but {\tt tar} will match the whole string at once,
so do not be surprised if some anomalies occur. ({\bf For example},
a star (*) or a question mark (?) can match a forward slash (/).) If you
want to specify a {\tt regular expression} as an argument to {\tt tar},
you must quote it so that the  shell will not expand it. 


\cleardoublepage

\chapter{The Helios File System Checker}

\section{What the file system checker checker can do}

\noindent This chapter describes the standard integrated  version, {\tt (1.1-1)},
of the file system checker.\index{File system checker@{\bf file system checker}}
The checker is a maintenance tool which protects data stored
on hard disc from damage in the event of a power loss, a hardware
malfunction or a head crash, for example. Its purpose
is primarily to gain access to a filing system after such a
disaster, and secondly to discover and repair any corrupted parts of your filing
system. It should be noted at this point that if a comprehensive repair
of damaged files and sub directories is required, the {\tt File System
Interactive Maintenance Tool}\index{File System
Interactive Maintenance Tool} should be used.(See section 6.6 of
this guide for further reference.)


\subsection{How the file system checker starts up}

\noindent The checker is built into The Helios File
System  HFS, so it is automatically started each time the file
system is booted. It checks and repairs the file system without user
interaction. The checker normally runs in {\tt silent} mode. This means
that it simply reports to you as it passes through the different phases
of the checking process. If it finds any damage on the disc it reads it
as an error, and reports it by writing a message in the server window on
your screen. When the checking process is completed, the file server
will start up, and you will be able to gain access to your filing system
in the normal way.  

\noindent {\bf Note:} If you attempt to use the file system checker with a damaged
disc controller or to check a non formatted disc, for example, you may
not be able to start it until the original cause of the damage, such as
a hardware malfunction, has been solved.

\section{The checking modes}

\noindent There are two different {\tt checking modes}. {\tt BASIC
CHECK} is the default mode, which automatically starts when the file server 
is booted. In
this mode, the file system checker tests the basic data structures on
the disc, such as those used to manage the allocation of blocks, for example.
The second mode is {\tt FULL CHECK}, which scans the complete directory
tree and tests each entry, whether it is a file, a symbolic link or a
sub directory entry. If the default mode discovers an error on the disc,
the {\tt FULL CHECK} mode automatically takes over to search for any
further damage.\index{Checking modes: Basic Check}\index{Checking modes: Full Check}
\vspace{0.25cm}

\noindent The Helios File System can be booted with the following extended set of
options: \begin{verbatim} fs [-m|-b|-f] <device> 
\end{verbatim}

\begin{enumerate}
\item {\tt -m} Call up the format routine. 
\item {\tt -b} Perform only basic checks. (default.)
\item {\tt -f} Perform full checks.
\end{enumerate}

\section{Understanding HFS data structures on disc}

\noindent This section provides you with a brief description of the main 
data structures\index{HFS data structures} which are managed by The Helios File System (HFS), and tested
and corrected by the Helios File System Checker. This will make it
easier for you to understand the basic principles of the checker and to
follow the different phases of the checking process. 

\subsection{Disc layout}

\noindent The Helios File System divides a disc logically into sections of equal
size, each containing the same number of blocks. These sections are
called {\tt cylinder groups}.\index{Cylinder group} This type of disc layout\index{Disc layout} has several
advantages. The use of algorithms\index{Algorithms} for block allocation and the creation
of new directory entries and files ensures space efficiency on the disc.
There is minimal fragmentation of disc space, and the best possible
medium access times are achieved because the data is organised in such a
regular pattern on the disc. 

\noindent The information required to manage a cylinder group is stored in one
data block, which is called an {\tt info block}. Each cylinder group has
its own info block\index{Block:info block}, and it is placed with a fixed {\tt relative
rotational offset}. The most important data structure is called a \index{Bit map}
bit map. This is an array of bytes which keeps a record of which blocks
are allocated or free within the specific cylinder group, and it forms
the major part of each info block. In addition to this, the {\tt allocation summary}\index{Allocation
summary} of a cylinder group will reveal the number of free blocks and
the number of sub directories which are stored in that group. Another
data block which has a special purpose is called a {\tt summary
block}.\index{Block: summary block}
This collects the allocation summary from the info block of each
cylinder group, and it also collects the allocation summary for the file
system as a whole. This information allows the file server to decide
where to allocate new blocks on the disc quickly and with space efficiency
when you want to create a new file, for example. 

\noindent The {\tt super block} is where the fixed parameters of the established
filing system are stored. These parameters include the number of
cylinder groups to be used, the size of each cylinder group and the
rotational offset for the placement of info blocks in each cylinder
group. A copy of this super block\index{Block: super block} is stored in each info block. Under
normal operating conditions, the contents of the superblock should never
be changed once a disc has been formatted. See Figure 1 for a simple
overview of the layout of a disc.\index{Filing system parameters}



\begin{verbatim}
Block Number
____________

            ________________________
0:          | boot block           |
            |_____________________ |
1:          | summary block        |
            |_____________________ |____cylinder group 0___ 
2:          | info block of the    |                     ||
            | first cylinder group |                     ||
            |_____________________ |                    \||/
3:          | first data block     |                     \/
            |_____________________ |
            \                      /           
            /_____________________ \____cylinder group 1____
            | info block of the    |
            | second cylinder group|

Fig.1: An overview of the layout of a disc.


\end{verbatim}


\section{Directory entries and files}

\noindent The information required to describe a file or a sub directory entry is
stored in a data structure called an {\tt inode}\index{Inode}. This information
includes the date of creation, the size (measured in bytes) and a \index{Type flag}
{\tt type flag} to indicate whether the entry describes a sub directory, a
\index{Symbolic link}symbolic link or an ordinary file. The access matrix\index{Access matrix} and the number of
blocks allocated to a particular entry are also included. 

\noindent References to data blocks are stored in {\tt direct blocks}\index{Blocks: direct}. To maintain
space efficiency, only a limited number of these are created within an inode.
When the system has to manage a large file, a {\tt single indirect block}\index{Block: single indirect
block} is allocated, which only contains references to data blocks. In
the same way, a very large file which takes up hundreds of megabytes is
described by using a {\tt double indirect block} \index{Double indirect block}. This is noted in the
inode. The inode stores references to indirect blocks, which in turn
refer to data blocks. This arrangement allows the system to deal with a
wide range of file sizes without wasting space on the disc.

\noindent There is a special type of data block which is called a {\tt
directory block}\index{Block: directory
block}. This is stored by an inode of the {\tt directory} type. (A sub
directory entry.) A directory block only contains inode data structures,
and this allows The Helios File System to build hierarchical directory
structures. 

\noindent When the file system checker is in {\tt FULL CHECK} mode, it searches
the whole directory tree, starting with the inode of the root directory.
It checks each entry and corrects any errors it finds. If the damage to
a particular entry is so great that it is rendered unusable, its
corresponding inode is deleted when the checking process is completed.

\section{The different phases of the checking process}

\noindent The checking process moves through four distinct phases.

\subsection{Phase 1}

\noindent During this phase, the file system checker is in {\tt BASIC CHECK} mode.
Firstly, the checker tests the validity of the super block data
structure. (It finds this in the info block\index{Block: info block} of the first cylinder
group.) Next, the checker compares the super block\index{Block: super block} with the copies which
are stored in the info blocks of the other cylinder groups\index{Cylinder groups}. It then
compares the bit map of each cylinder group with the allocation
summaries. (You will remember that these are stored in the info blocks
and in the summary block\index{Block: summary block}.) 

\noindent {\bf Note:} Make sure that you run a final {\tt sync} phase before
terminating the file server. (During the {\tt sync phase}\index{sync phase}, all modified data
blocks which are stored in the buffer cache are written to disc.) If
this is not done, the information in the bit maps and the summary block
will not match when you start the file system checker.

\noindent Finally, the checker inspects the {\tt root directory inode}\index{Inode: root directory inode}, which is part of
the summary block. It does this to make sure that you can gain initial access
to the root directory of the filing system. If the checker detects no
errors on the disc, then the actual checking process is completed at
this point. However, if an error is found, the {\tt FULL CHECK} mode
starts up automatically, and the following three phases are performed.

\subsection{Phase 2}

\noindent During this phase, the file system checker searches the whole directory
tree to test all of the single directory entries. (This is the main part
of the checking process\index{Checking process}.) The checker starts at the inode of the root
directory, and eventually tests each individual entry. If an entry is so
badly damaged that it is unusable, then it will be deleted when the
checking process is complete.

\subsection{Phase 3}

\noindent At this stage, the file system checker reads the results of the tests it
performed in phases 1 and 2. It then corrects any errors in block allocation\index{Block: errors in block
allocation}. There are two possible errors which might occur. The first
of these would be a block which is referred to by more than one entry.
The checker decides which of the entries is the {\tt legal owner} of
such a block. The second error occurs when a block is recorded in a bit map\index{Bit
map} as an allocated block, but it is not referred to by any of the
entries which were tested in phase 2. This is called a {\tt lost block}\index{Block: lost block},
and the checker will store it in the {\tt lost and found directory}\index{Lost and found directory} if
it contains information about directories. (This will eventually allow
you to re integrate any sub directory structures which have been cut off
from your directory tree because of damage to the disc.)

\subsection{Phase 4}

\noindent In phase 4, the file system checker performs some general tidying
operations on the disc, and it also adjusts the allocation summary\index{Allocation summary} of
the filing system, which is stored in the summary block\index{Block: summary block}.

\section{The File System Interactive Maintenance Tool}

\noindent The file system checker runs in a  non interactive mode, which
means that its approach is fixed and systematic. The procedures it
follows are designed to achieve the best results possible. However, if
you would like more control over the checking process, 
use the {\tt File System Interactive Maintenance Tool}\index{File System Interactive Maintenance Tool},
which runs in a fully extended interactive mode. This will provide you
with a range of options for dealing with the errors on a damaged disc.
It offers extended features such
as a disc editor which can inspect and modify individual data blocks,
interpret disc administration data structures and search byte patterns
on disc.

\cleardoublepage
\printindex
\cleardoublepage
\pagestyle{empty}
\input{HEL91016}
\end{document}

