hjfs – file server maintenance




create path uid gid perm [lad]




echo [on|off]


newuser name [options]



debug-chdeind file [offset value]

debug-deind file

debug-getblk file [blk|start end]


The following commands should be written to the console of an hjfs(4) file server.

Allow disables permission checking and allows changing file ownership (see chgrp(1)). This may help in initializing a file system. Use this with caution.

Chatty enables chatty 9p.

Create creates a file on the current file system. Uid and gid are names or numbers from /adm/users. Perm is the low 9 bits of the permission mode of the file, in octal. An optional final l, a, or d creates a locked file, append-only file, or directory.

Df prints the number of free, used and total blocks/megabytes. It scans the block table and can be slow on large hard disks.

Disallow restores permission checking back to normal after a file system has been initialized.

Dump immediately starts a dump.

Echo expects the argument on or off. On causes all executed commands to be printed on the system console. Off reverses the effects of on.

Halt exits the program.

Newuser requires a name argument. With no options it adds user name, with group leader name, to /adm/users and makes the directory /usr/name owned by user and group name. The options are


Add a group: add the name to /adm/users but don’t create the directory. By convention, groups are numbered starting from 10000, users from 0.  


Rename existing user name to newname.  


Change the leader of name to leader. If leader is missing, remove the existing leader.  


Add member to the member list of name.  


Remove existing member from the member list of name.  

After a successful newuser command the file server overwrites /adm/users to reflect the internal state of the user table.

Users reads the contents of file /adm/users to initialize the file server’s internal representation of the users structure.

Sync writes dirty blocks in memory to the magnetic disk cache.

Note: Debug commands operate on internal data structures; they are inherently dangerous and can cause file system damage.

Debug-chdeind changes the value of the byte at the specified offset in the in-memory directory entry and prints the old value. Dangerous if used carelessly.

Debug-deind requires a file argument. It prints the directory entry of file.

Debug-getblk prints the physical blocks of file corresponding to the logical block blk or the logical blocks between start and end.


Check disk usage (output appears on the system console).


% echo df >>/srv/hjfs.cmd






Debug-chdeind should perhaps be less crazy and have a portable interface.