PNFSDSFILE(8)

๐Ÿ“ฆ version 15.1, in freebsd 14.5, freebsd 15.1

๐Ÿ’… 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 the pnfsd.dsfile extended 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 the pnfsd.dsfile extended attribute. The old-hostname must resolve to the IP# that's already in the pnfsd.dsfile extended attribute, otherwise the replacement straight-up won't happen, sorry bestie ๐Ÿ˜ญ. If old-dshostname matches, then the IP# gets replaced by the first AF_INET or AF_INET6 address that getaddrinfo(3) returns for new-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 to 0.0.0.0 to bring the number of entries up to mirror_level. A system administrator can use this to prepare a file for mirroring via the pnfsdscopymr command with the -r option. prepping the group chat before everyone joins ๐Ÿซถ
  • -r dshostname โ€” sets the IP address of the extended attribute entry for the dshostname to 0.0.0.0 so 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: -c only fires if old-dshostname resolves 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 -r needs to hit every single regular file in the exported MDS tree, so a find(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