NFSREF(8)
π NFSREF(8) β the nfsref manual, but make it a group chat π
okay bestie, sit down, hydrate, and let's talk about nfsref β it lives in the System Manager's Manual section (that's section 8, the big-kid sysadmin section π), and it's literally the easiest way to manage NFS referrals. no cap.
β¨ NAME β¨
nfsref β manage NFS referrals π¦
πΈ SYNOPSIS πΈ
nfsref [-?d] [-t type] add pathname server export [ server export ... ]
nfsref [-?d] [-t type] remove pathname
nfsref [-?d] [-t type] lookup pathname
that's it. three little subcommands. iconic behavior honestly π
π§ INTRODUCTION π§
so NFS version 4 pulled up with a whole new concept called file system referrals. periodt.
a file system referral is basically like a symbolic link (or, symlink) to another file system share β usually on a totally different file server. and here's the slay part: an NFS client, under the server's direction, mounts the referred-to NFS export automatically the first time an application touches it. no user action. no drama. π
NFSv4 referrals can be used to transparently redirect clients to file systems that have been moved elsewhere, or to construct a single file name space across multiple file servers. and because the file servers control the shape of the whole file name space, no client configuration is required. zero. none. not a single config file. we love to see it π
π DESCRIPTION π
a junction is a file system object on an NFS server that, when an NFS client encounters it, triggers a referral. similar to a symlink, a junction contains one or more target locations that the server sends to clients in the form of an NFSv4 referral. it's giving "you thought this was a directory but it's actually a portal" π
on Linux, an existing directory can be converted to a junction and back atomically and without the loss of the directory contents. yes bestie, atomic. glow-up and glow-down, no casualties. but heads up: when a directory acts as a junction, its local content is hidden from NFSv4 clients. π
the nfsref(8) command is a simple way to get started managing junctions and their content. it's the beginner-friendly entrance to the junctionverse, and honestly? it ate. π₯
π Subcommands π
valid nfsref(8) subcommands are, in order:
addβ adds junction information to the directory named bypathname. the named directory must already exist, and must not already contain junction information. regular directory contents are obscured to NFS clients by this operation. πΆβπ«οΈ also, you gotta give it a list of one or more file server and export path pairs on the command line. when creating an NFS basic junction, this list is stored in an extended attribute of the directory. and if junction creation is successful, thenfsref(8)command flushes the kernel's export cache to remove previously cached junction information. out with the old β¨removeβ removes junction information from the directory named bypathname. the named directory must exist, and must contain junction information. regular directory contents are made visible to NFS clients again by this operation. the hidden stuff comes back out, we're un-hiding it π«Ά and if junction deletion is successful, thenfsref(8)command flushes the kernel's export cache to remove previously cached junction information. same cache flush, different vibe.lookupβ displays junction information stored in the directory named bypathname. the named directory must exist, and must contain junction information. when looking up an NFS basic junction, the junction information in the directory is listed on stdout. π
β Command line options β
-d,--debugβ enables debugging messages during operation. when it's acting up and you need to see the receipts π-t,--type=junction-typeβ specifies the junction type for the operation. valid values forjunction-typearenfs-basicornfs-fedfs. for theaddsubcommand, the default value if this option is not specified isnfs-basic. thenfs-fedfstype is not used in this implementation. π« for theremoveandlookupsubcommands, the--typeoption is not required. thenfsref(8)command operates on whatever junction contents are available. it'll figure it out, she's smart like that π
π₯ EXAMPLES π₯
suppose you have two file servers, top.example.net and home.example.net. you want all your clients to mount top.example.net:/ and then see the files under home.example.net:/ automatically in top:/home.
on top.example.net, you might issue this command as root:
# mkdir /home
# nfsref add /home home.example.net /
Created junction /home.
look at that output. Created junction /home. perfection. no notes. πβ¨
π SEE ALSO π
- RFC 8881 for a description of the NFS version 4 referral mechanism β go read it bestie, it's the lore π
π AUTHOR π
Chuck Lever <chuck.lever@oracle.com>
okay that's the whole page π it came from the System Manager's Manual, dated 9 Jan 2018, and the page is NFSREF(8) β ty for coming to my ted talk, go make some junctions, drink water, ily ππ¦β¨
π¦ where this page comes from
- arch rolling: nfs-utils 3.1.1-1 Β· GPL-2.0-or-later
- centos-stream 10: nfs-utils 1:2.8.3-9.el10 Β· MIT and GPLv2 and GPLv2+ and BSD
- debian trixie: nfs-kernel-server 1:2.8.3-1
- fedora 43: nfs-utils 1:2.8.4-0.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 43: nfs-utils 1:2.8.7-6.fc43 Β· LicenseRef-Callaway-MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LicenseRef-Callaway-BSD
- fedora 44: nfs-utils 1:2.8.7-0.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND (HPND-export-US-modify AND HPND-sell-variant) AND (GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause)
- fedora 44: nfs-utils 1:2.8.7-7.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND (HPND-export-US-modify AND HPND-sell-variant) AND (GPL-2.0-only WITH Linux-syscall-note OR BSD-3-Clause)
- nixos 26.05: nfs-utils 2.9.1
- nixpkgs unstable: nfs-utils 3.1.1
- opensuse-leap 16.0: nfs-kernel-server 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: nfs-kernel-server 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: nfs-kernel-server 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: nfs-kernel-server 2.8.2-160000.4.1 Β· GPL-2.0-or-later
- ubuntu questing: nfs-kernel-server 1:2.8.3-1ubuntu3
- ubuntu resolute: nfs-kernel-server 1:2.8.5-1ubuntu1
- ubuntu stonking: nfs-kernel-server 1:2.9.1-1ubuntu1
- Copyright 2011, 2018 Oracle. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms