SRV(4)
π SRV(4) β like, the network file service glow-up
okay so bestie, welcome to srv and 9fs, the Kernel Interfaces Manual's own little duo for starting a network file service β¨ this is the page that makes remote files just... appear in your namespace. iconic behavior, honestly.
πΈ SYNOPSIS πΈ
srv [ -an ] [ -k keypattern ] address [ srvname ]
9fs system
that's the whole vibe check β an address, an optional name for it, and a couple flags. slay.
π¦ DESCRIPTION π¦
So srv dials the given address and initializes the connection so it serves the 9P protocol. Then β and this is the main character moment β it posts the resulting connection in the current name space (peep intro(4) if you need the lore) as srvname, which defaults to address. so if you don't name your baby, it just goes by the address it came from. lowkey poetic π
-aβ causessrvto post a pre-authenticated connection to the file systemaname(by default, the empty string β seeattach(9p)). like, the auth is already done, no need to ask again π-nβ causessrvto reject authentication attempts by clients. super useful if the remote server is known not to require authentication β no cap, why make everyone do the little auth dance for nothing? π
Srv authenticates over the 9P connection to establish a valid auth fid. If keypattern is specified, it's used to select the key used for authentication. And then the plot twist: client attach requests are rewritten to use the specified aname and auth fid β so everybody who attaches gets the same treatment. fr fr π₯
Now for the bestie: the 9fs command executes the srv necessary to make available the files of system. one command, whole file system, periodt.
9fs recognizes some special names, such as sources, to make the file server sources.cs.bell-labs.com available as service sources. Also important, ngl: 9fs is an rc(1) script β so go examine it to see what local conventions apply, because your machine might have its own little quirks. iykyk π§
lowkey a reminder: 9fs is a script, so don't assume it's doing exactly what some other machine's script does. read it. it's giving "trust but verify" π
π EXAMPLES π
List the root directory on sources:
9fs sources
9p ls sources
Mount a remote file server bootes on Linux using the kernel 9P mount driver, with srv handling authentication:
srv -a sources.cs.bell-labs.com sources
sudo mount -t 9p -o trans=unix,uname=$USER,dfltuid=`id -u`,dfltgid=`id -g`
`namespace`/sources /n/sources
that second one is the whole flex β srv does the auth, the kernel driver does the mounting, and you get /n/sources. obsessed π«Ά
β SOURCE β
/src/cmd/srv.c
/bin/9fs
π SEE ALSO π
dial(3), intro(4), netfiles(1)
and that's the page, bestie π straight from the Kernel Interfaces Manual, filed under SRV(4) β go forth and post some connections, you gorgeous nerd ππ¦β¨
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms