fossil, flchk, flfmt – archival file server|
fossil/fossil [ –Dt ] [ –c cmd ] ... [ –f file ] [ –m free–memory–percent
fossil/flchk [ –f ] [ –c ncache ] [ –h host ] file
fossil/flfmt [ –y ] [ –b blocksize ] [ –h host ] [ –l label ] [ –v score ] file
fossil/conf [ –w ] file [ config ]
Fossil is the main file system for Plan 9. Unlike the Plan 9 file
servers of old, fossil is a collection of user–space programs that
run on a standard Plan 9 kernel. The name of the main fossil file
server at Murray Hill is pie. The Plan 9 distribution file server,
sources, is also a fossil server. |
Fossil is structured as a magnetic disk write buffer optionally backed by a Venti server for archival storage. It serves the Plan 9 protocol via TCP. A fossil file server conventionally presents three trees in the root directory of each file system: active, archive, and snapshot. /active is the root of a conventional file system whose blocks are stored in a disk file. In a typical configuration, the file server periodically marks the entire file system copy–on–write, effectively taking a snapshot of the file system at that moment. This snapshot is made available in a name created from the date and time of the snapshot: /snapshot/yyyy/mmdd/hhmm where yyyy is the full year, mm is the month number, dd is the day number, hh is the hour, and mm is the minute. The snapshots in /snapshot are ephemeral: eventually they are deleted to reclaim the disk space they occupy. Long–lasting snapshots stored on a Venti server are kept in /archive and also named from the date (though not the time) of the snapshot: /archive/yyyy/mmdds, where yyyy, mm, and dd are year, month, and day as before, and s is a sequence number if more than one archival snapshot is done in a day. For the first snapshot, s is null. For the subsequent snapshots, s is .1, .2, .3, etc. The root of the main file system that is frozen for the first archival snapshot of December 15, 2002 will be named /archive/2002/1215/.
Fossil normally requires all users except none to provide authentication tickets on each attach(5). To keep just anyone from connecting, none is only allowed to attach after another user has successfully attached on the same connection. The other user effectively acts as a chaperone for none. Authentication can be disabled using the –A flag to open or srv (see fossilcons(8)).
The groups called noworld and write are special on the file server. Any user belonging to noworld 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 and 0771 for directories. The effect is to deny world access permissions to noworld users, except when walking into directories. If the write group exists, then the file system appears read–only to users not in the group. This is used to make the Plan 9 distribution file server (sources.cs.bell–labs.com) readable by the world but writable only to the developers.
Fossil starts a new instance of the fossil file server. It is configured mainly through console commands, documented in fossilcons(8).
The options are:
–m Allocate free–memory–percent percent of the available free RAM for buffers. This overrides all other memory sizing parameters, notably the –c option to open. 30% is a reasonable choice.
Flchk checks the fossil file system stored in file for inconsistencies. Flchk is deprecated in favor of the console check command (see fossilcons(8)). Flchk prints fossil console commands that may be executed to take care of bad pointers (clrp), bad entries (clre), bad directory entries (clri), unreachable blocks (bfree). Console commands are interspersed with more detailed commentary on the file system. The commands are distinguished by being prefixed with sharp signs. Note that all proposed fixes are rather drastic: offending pieces of file system are simply chopped off.
Flchk does not modify the file system, so it is safe to run concurrently with fossil, though in this case the list of unreachable blocks and any inconsistencies involving the active file system should be taken with a grain of salt.
The options are:
Flfmt prepares file as a new fossil file system. The file system
is initialized with three empty directories active, archive, and
snapshot, as described above. The options are:
Conf reads or writes the configuration branded on the Fossil disk file. By default, it reads the configuration from the disk and prints it to standard output. If the –w flag is given, conf reads a new configuration from config (or else from standard input) and writes it to the disk. Inside the configuration file, the argument * may be used to stand in for the name of the disk holding the configuration. The Plan 9 kernel boot process runs ``fossil –f disk'' to start a Fossil file server. The disk is just a convenient place to store configuration information.
Last prints the vac score that resulted after the most recent
archival snapshot of the fossil in file.
Place the root of the archive file system on /n/dump and show
the modified times of the MIPS C compiler over all dumps in December
Perhaps because the disk has been corrupted or replaced, format
a new file system using the last archive score printed on the
Blindly accept the changes prescribed by flchk (not recommended):
yesterday(1), fs(3), fs(4), srv(4), fossilcons(8), loadfossil(8),
It is possible that the disk format (but not the Venti format)
will change in the future, to make the disk a full cache rather
than just a write buffer. Changing to the new format will require
reformatting the disk as in the example above, but note that this
will preserve most of the file system (all but /snapshot) with
The –m option currently assumes a block size of 8K bytes, and a
single file system per fossil instance.