xref: /freebsd/usr.sbin/pnfsdsfile/pnfsdsfile.8 (revision f1ed5c000c688cf9781b486134baf4ba25415efd)
1.\" Copyright (c) 2017 Rick Macklem
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
6.\" 1. Redistributions of source code must retain the above copyright
7.\"    notice, this list of conditions and the following disclaimer.
8.\" 2. Redistributions in binary form must reproduce the above copyright
9.\"    notice, this list of conditions and the following disclaimer in the
10.\"    documentation and/or other materials provided with the distribution.
11.\"
12.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22.\" SUCH DAMAGE.
23.\"
24.\" $FreeBSD$
25.\"
26.Dd March 11, 2018
27.Dt PNFSDSFILE 8
28.Os
29.Sh NAME
30.Nm pnfsdsfile
31.Nd display
32a pNFS data storage file's location(s) and/or modify the
33.Dq pnfsd.dsfile
34extended attribute for them
35.Sh SYNOPSIS
36.Nm
37.Op Fl qz
38.Op Fl s Ar dshostname
39.Op Fl c Ar old-dshostname,new-dshostname
40.Op Fl r Ar dshostname
41.Ar mdsfile
42.Sh DESCRIPTION
43The
44.Nm
45command displays the data storage file's location(s) for a pNFS service and/or
46modifies the
47.Dq pnfsd.dsfile
48extended attribute on the
49.Ar mdsfile .
50A pNFS service maintains a data storage file for each regular file on
51the MetaData Server (MDS) on one or more of the Data Servers (DS).
52If mirroring is enabled, the data storage file will be on more that one of the DSs.
53Unless command options are specified, this command displays the location(s)
54of the data storage file for the MDS file
55.Ar mdsfile .
56It must be used on the MDS and the
57.Ar mdsfile
58must be a file on the exported local file system and not an NFSv4.1 mount.
59This information is stored in the
60.Dq pnfsd.dsfile
61extended attribute for this
62.Ar mdsfile .
63The command line options allow the information in the
64.Dq pnfsd.dsfile
65extended attribute to be changed.
66.Pp
67The following options are available:
68.Bl -tag -width Ds
69.It Fl q
70This option suppresses printing of the DS file's location(s).
71.It Fl z
72This option specifies that the file handle field of the pnfsd.dsfile
73extended attribute is to filled with all zero bits.
74This forces the pNFS MDS to do a Lookup RPC against the DS to acquire the file
75handle to update it.
76Normally this will only be necessary after the DS file has been recovered
77from a backup, causing the file handle to change.
78.It Fl s Ar dshostname
79This option can be used with
80.Fl z
81so that the zeroing out of the file handle is only done if the DS server
82is the one specified by this option.
83.It Fl c Ar old-dshostname,new-dshostname
84This option allows a sysadmin to replace the host IP# for the DS in the
85pnfsd.dsfile extended attribute.
86The old-hostname must resolve to the IP# already in the pnfsd.dsfile extended
87attribute or the replacement will not be done.
88If the old-dshostname matches, then the IP# is replaced by the first AF_INET
89or AF_INET6 address that
90.Xr getaddrinfo 3
91returns for the new-dshostname.
92Changing a DS server's host IP# should be avoided, but this option will
93allow it to be changed, if the change is unavoidable.
94.It Fl r Ar dshostname
95This option sets the IP address of the extended attribute entry for the
96.Ar dshostname
97to 0.0.0.0 so that it will no longer be used.
98.Pp
99This is meant to be used when mirroring is enabled and the
100.Ar dshostname
101DS is disabled, so that it can be re-enabled once it is repaired.
102This needs to be done for all files in the exported MDS tree where
103the data may not be up-to-date on the repaired DS when it is re-enabled.
104After being re-enabled, the command
105.Xr pnfsdscopymr 1
106with the
107.Dq -r
108option
109will be used to copy the the file's data to this repaired DS and then update the
110extended attribute to use it.
111.Pp
112A typical use of this will be within a
113.Xr find 1
114for all regular files in the MDS's exported tree.
115.sp
116For example, if the disabled DS is nfsv4-data3:
117.br
118# cd <top-level-exported-directory-on-MDS>
119.br
120# find . -type f -exec pnfsdsfile -q -r nfsv4-data3 {} \\;
121.El
122.Sh SEE ALSO
123.Xr find 1 ,
124.Xr getaddrinfo 3 ,
125.Xr nfsv4 4 ,
126.Xr pnfs 4 ,
127.Xr nfsd 8 ,
128.Xr pnfsdscopymr 8 ,
129.Xr pnfsdskill 8
130.Sh HISTORY
131The
132.Nm
133command first appeared in
134.Fx 12.0 .
135