NAME
     bind, mount, unmount - change the namespace

SYNOPSIS
     bind [ -b | -a ] new old
     mount /srv/name mountpoint
     mount server mountpoint [aname]
     unmount path

DESCRIPTION
     Everything on this deck is a file, and every file is served by some
     program: the keyboard, the mesh radio, the clock, a board on the other
     end of a radio link.  The namespace is the table that says which server
     answers for which part of the file tree -- that /dev is the console
     server, that /n/local is the flash filesystem, that /n/bbs is a machine
     several hundred miles away.  Nothing about that table is fixed.  You
     rearrange it, and every program that reads files sees the new arrangement
     without being told, because a program that can read a file already knows
     how to use anything you put in front of it.

     These three commands are how you rearrange it.

     Mount attaches a 9P server at a mountpoint.  The usual argument is a
     connection posted in /srv by srv(1); mount /srv/dc /n/dc grafts the whole
     of a remote machine's file tree onto /n/dc.  A bare server name that is
     not a /srv path names a connection opened by dial(1) but never posted, or
     failing that a local server directly, and an aname may follow it to
     attach to a subtree rather than the server's root.  For a connection from
     /srv the aname was already fixed when the connection was dialed, and any
     third argument is ignored.

     Bind makes an existing path visible at another path.  Both must already
     resolve; bind moves names around inside the namespace you have, where
     mount brings a new server into it.  It is the tool for putting a remote
     service exactly where local programs expect to find it:

          bind /n/dc/net/tcp /net/tcp

     after which gopher(1), telnet(1) and everything else that dials out uses
     the remote machine's network without knowing it is not the deck's own.

     Unmount removes the entry at path.  Any connection underneath survives --
     it is still posted in /srv and can be mounted again.  Use hangup(1) to
     close the connection itself.

     Ns(1) prints the resulting table.

OPTIONS
     -b   Bind new before old in a union: both directories visible at one
          name, new searched first.

     -a   The same, new searched last.

     With neither flag the bind replaces whatever was at old, which is what
     nearly every use wants.

EXAMPLES
     Attach a data crystal and put its board where the bbs(1) commands look
     for it:

          srv tcp!bbs.frstcomputer.net!9777 dc
          mount /srv/dc /n/dc
          bind /n/dc/rooms /n/bbs

     A crystal that exports its whole namespace keeps the board one level down
     instead; bind that:

          bind /n/dc/srv/bbs /n/bbs

     Borrow a neighbouring deck's mesh interface -- useful on a deck with no
     radio of its own, which then talks to the mesh through the one that has:

          srv aether!gateway aeth
          mount /srv/aeth /n/aeth
          bind /n/aeth/net/aether /net/aether

     Bind only what you mean to.  Binding a whole remote /net over the local
     one takes the deck's own /net/wifi with it, and the status bar then asks
     a machine that does not serve it.

     Put it back:

          unmount /n/bbs
          unmount /n/dc
          hangup dc

FILES
     /srv Posted connections, one file per name.

     /n   Where mounted file trees conventionally go: /n/local for flash,
          /n/dc for an attached crystal, /n/bbs for its board.

     /net Network interfaces: /net/tcp, /net/aether, /net/wifi.

SEE ALSO
     ns(1), dial(1), tunein(1), aether(3)

NOTES
     The mount table holds sixteen entries, shared by the default mounts made
     at boot.

BUGS
     Unions are not implemented: -b and -a are parsed, then refused.  Path
     resolution is longest-prefix matching over a flat table and never walks a
     union chain, so a union bind would appear to work and silently do
     nothing; it is rejected instead.

FRST Computer                                                          BIND(1)
