1.\" Copyright (c) 2018 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.Dd June 2, 2018
25.Dt PNFSDSCOPYMR 8
26.Os
27.Sh NAME
28.Nm pnfsdscopymr
29.Nd
30copy or move a data storage file for a MDS file to a different DS
31.Sh SYNOPSIS
32.Nm
33.Op Fl r Ar mounted-on-DS-dir
34.Op Fl m Ar source-mounted-on-DS-dir destination-mounted-on-DS-dir
35.Ar mdsfile
36.Sh DESCRIPTION
37The
38.Nm
39command copies a data storage file for an MDS file from one DS to another DS.
40It is normally used to recover data files onto a repaired DS, but can also
41be used to manually migrate a data storage file from one DS to a different one.
42By default, the command will copy the data storage file for
43.Dq mdsfile
44to one of the other DSs to create a mirror of it.
45This might be done if the file was created before mirroring was enabled on
46the pNFS service and now needs to be mirrored.
47.Pp
48The following options are available:
49.Bl -tag -width Ds
50.It Fl r Ar mounted-on-DS-dir
51This option indicates that the data storage file should be created on the DS
52that is mounted on the directory
53.Dq mounted-on-DS-dir .
54It will only do the copy if there is an entry in the pnfsd.dsfile extended
55attribute that has an IP address of 0.0.0.0.
56See
57.Xr pnfsdsfile 1
58for how to do this.
59This is normally done for all regular files via
60.Xr find 1
61in order to recover the data
62storage files onto a repaired DS.
63.It Fl m Ar source-mounted-on-DS-dir destination-mounted-on-DS-dir
64This option indicates that the data storage file is to be migrated from
65the source DS mounted on the diectory
66.Dq source-mounted-on-DS-dir
67to the DS mounted on the directory
68.Dq destination-mounted-on-DS-dir .
69In this case, the data storage file will be removed from the source DS
70when the copy is completed.
71.El
72If the copy/migration is already done, the command will simply exit(0),
73so that it can safely be used on all regular files in the exported directory
74tree on the MDS.
75.Pp
76This command must be run on the MDS and a typical usage would be as an
77argument for
78.Xr find 1
79for all regular files.
80.sp
81For example, if the repaired DS is mounted on /data3 and files previously
82stored on the repaired DS have had the DS's IP address set to 0.0.0.0:
83.br
84# cd <top-level-exported-directory-on-the-MDS>
85.br
86# find . -type f -exec pnfsdscopymr -r /data3 {} \\;
87.Sh SEE ALSO
88.Xr find 1 ,
89.Xr nfsv4 4 ,
90.Xr pnfs 4 ,
91.Xr nfsd 8 ,
92.Xr pnfsdsfile 8 ,
93.Xr pnfsdskill 8
94.Sh HISTORY
95The
96.Nm
97command first appeared in
98.Fx 12.0 .
99