PNFSDSFILE(8)
๐ pnfsdsfile(8) โ the pNFS data-storage-file glow-up guide โจ
okay so bestie, we're talking about pnfsdsfile from section 8 of the manual (system manager vibes ๐), and honestly? she's niche but she slays at exactly one job and does it flawlessly.
๐ธ NAME
pnfsdsfile โ show you where a pNFS data storage file actually lives, and/or mess with the pnfsd.dsfile extended attribute for those files ๐
๐ฆ SYNOPSIS
pnfsdsfile [-qz] [-s dshostname] [-c old-dshostname,new-dshostname]
[-m mirror_level] [-r dshostname] mdsfile
โจ DESCRIPTION
So here's the tea ๐: pnfsdsfile displays a data storage file's location(s) for a pNFS service, and/or modifies the pnfsd.dsfile extended attribute sitting on the mdsfile. A pNFS service keeps a data storage file for every regular file on the MetaData Server (MDS), and those live on one or more of the Data Servers (DS). If mirroring is turned on, the data storage file is gonna be on more than one of the DSs โ because redundancy is the moment, no cap ๐
.
Unless you pass some command options, this command just displays the location(s) of the data storage file for the MDS file mdsfile. Real talk though: it must be used on the MDS, and the mdsfile must be a file on the exported local file system โ not an NFSv4.1 mount. Like, that's a hard no ๐. All this info lives in the pnfsd.dsfile extended attribute for that mdsfile, and the command line options are how you change what's inside it.
โญ OPTIONS โญ
The following options are available, and yes, the spoiler is: they all eat ๐ฅ
-qโ suppresses printing of the DS file's location(s). quiet queen behavior ๐คซ-zโ says the file handle field of thepnfsd.dsfileextended attribute gets filled with all zero bits. That forces the pNFS MDS to do a Lookup RPC against the DS to acquire the file handle so it can update it. Normally you only need this after the DS file has been recovered from a backup, which changed the file handle. backup chaos โ zero it out ๐-s dshostnameโ works together with-z, so the zeroing-out of the file handle only happens if the DS server is the one you named with this option. targeted, not messy ๐ฏ-c old-dshostname,new-dshostnameโ lets a sysadmin replace the host IP# for the DS inside thepnfsd.dsfileextended attribute. Theold-hostnamemust resolve to the IP# that's already in thepnfsd.dsfileextended attribute, otherwise the replacement straight-up won't happen, sorry bestie ๐ญ. Ifold-dshostnamematches, then the IP# gets replaced by the firstAF_INETorAF_INET6address thatgetaddrinfo(3)returns fornew-dshostname. Changing a DS server's host IP# should be avoided, but this option will let you do it if the change is unavoidable. emergency-only energy ๐จ-m mirror_levelโ adds entrie(s) to the extended attributes with IP address set to0.0.0.0to bring the number of entries up tomirror_level. A system administrator can use this to prepare a file for mirroring via thepnfsdscopymrcommand with the-roption. prepping the group chat before everyone joins ๐ซถ-r dshostnameโ sets the IP address of the extended attribute entry for thedshostnameto0.0.0.0so it will no longer be used.
This one is meant for when mirroring is enabled and the dshostname DS is disabled, so you can re-enable it once it's repaired. And it needs to be done for all files in the exported MDS tree where the data may not be up-to-date on the repaired DS when it gets re-enabled. After it's re-enabled, the command pnfsdscopymr(1) with the -r option is used to copy the file's data over to that repaired DS and then update the extended attribute to use it. repair arc, we love to see it ๐
A typical use of this will be within a find(1) for all regular files in the MDS's exported tree.
For example, if the disabled DS is nfsv4-data3:
# cd <top-level-exported-directory-on-MDS>
# find . -type f -exec pnfsdsfile -q -r nfsv4-data3 {} \;
๐ heads up:-conly fires ifold-dshostnameresolves to the IP# already stored in the extended attribute, and changing a DS server's host IP# should be avoided in the first place. Also-rneeds to hit every single regular file in the exported MDS tree, so afind(1)sweep is the move โ don't do half the files and call it a day ๐.
๐ SEE ALSO
find(1), getaddrinfo(3), nfsv4(4), pnfs(4), nfsd(8), pnfsdscopymr(8), pnfsdskill(8) โ go read the whole friend group, iykyk ๐๐
๐ HISTORY
The pnfsdsfile command first appeared in FreeBSD 12.0. a legend was born โญ
okay that's the whole page bestie, go forth and slay those extended attributes ๐ฆ๐
this icon was brought to you by the Debian crew โ page dated June 30, 2018, tagged PNFSDSFILE(8) on the way out ๐ซถโจ
๐ฆ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2017 Rick Macklem
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms