xref: /freebsd/usr.sbin/pnfsdscopymr/pnfsdscopymr.8 (revision dc8725726d0205c10b01c06717cb265ab7d239e5)
1a520a7cfSRick Macklem.\" Copyright (c) 2018 Rick Macklem
2a520a7cfSRick Macklem.\"
3a520a7cfSRick Macklem.\" Redistribution and use in source and binary forms, with or without
4a520a7cfSRick Macklem.\" modification, are permitted provided that the following conditions
5a520a7cfSRick Macklem.\" are met:
6a520a7cfSRick Macklem.\" 1. Redistributions of source code must retain the above copyright
7a520a7cfSRick Macklem.\"    notice, this list of conditions and the following disclaimer.
8a520a7cfSRick Macklem.\" 2. Redistributions in binary form must reproduce the above copyright
9a520a7cfSRick Macklem.\"    notice, this list of conditions and the following disclaimer in the
10a520a7cfSRick Macklem.\"    documentation and/or other materials provided with the distribution.
11a520a7cfSRick Macklem.\"
12a520a7cfSRick Macklem.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13a520a7cfSRick Macklem.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14a520a7cfSRick Macklem.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15a520a7cfSRick Macklem.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16a520a7cfSRick Macklem.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17a520a7cfSRick Macklem.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18a520a7cfSRick Macklem.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19a520a7cfSRick Macklem.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20a520a7cfSRick Macklem.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21a520a7cfSRick Macklem.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22a520a7cfSRick Macklem.\" SUCH DAMAGE.
23a520a7cfSRick Macklem.\"
24a520a7cfSRick Macklem.Dd June 2, 2018
25a520a7cfSRick Macklem.Dt PNFSDSCOPYMR 8
26a520a7cfSRick Macklem.Os
27a520a7cfSRick Macklem.Sh NAME
28a520a7cfSRick Macklem.Nm pnfsdscopymr
29a520a7cfSRick Macklem.Nd
30a520a7cfSRick Macklemcopy or move a data storage file for a MDS file to a different DS
31a520a7cfSRick Macklem.Sh SYNOPSIS
32a520a7cfSRick Macklem.Nm
33a520a7cfSRick Macklem.Op Fl r Ar mounted-on-DS-dir
34a520a7cfSRick Macklem.Op Fl m Ar source-mounted-on-DS-dir destination-mounted-on-DS-dir
35a520a7cfSRick Macklem.Ar mdsfile
36a520a7cfSRick Macklem.Sh DESCRIPTION
37a520a7cfSRick MacklemThe
38a520a7cfSRick Macklem.Nm
39a520a7cfSRick Macklemcommand copies a data storage file for an MDS file from one DS to another DS.
40a520a7cfSRick MacklemIt is normally used to recover data files onto a repaired DS, but can also
41a520a7cfSRick Macklembe used to manually migrate a data storage file from one DS to a different one.
42a520a7cfSRick MacklemBy default, the command will copy the data storage file for
43a520a7cfSRick Macklem.Dq mdsfile
44a520a7cfSRick Macklemto one of the other DSs to create a mirror of it.
45a520a7cfSRick MacklemThis might be done if the file was created before mirroring was enabled on
46a520a7cfSRick Macklemthe pNFS service and now needs to be mirrored.
47a520a7cfSRick Macklem.Pp
48a520a7cfSRick MacklemThe following options are available:
49a520a7cfSRick Macklem.Bl -tag -width Ds
50a520a7cfSRick Macklem.It Fl r Ar mounted-on-DS-dir
51a520a7cfSRick MacklemThis option indicates that the data storage file should be created on the DS
52a520a7cfSRick Macklemthat is mounted on the directory
53a520a7cfSRick Macklem.Dq mounted-on-DS-dir .
54a520a7cfSRick MacklemIt will only do the copy if there is an entry in the pnfsd.dsfile extended
55a520a7cfSRick Macklemattribute that has an IP address of 0.0.0.0.
56a520a7cfSRick MacklemSee
57a520a7cfSRick Macklem.Xr pnfsdsfile 1
58a520a7cfSRick Macklemfor how to do this.
59a520a7cfSRick MacklemThis is normally done for all regular files via
60a520a7cfSRick Macklem.Xr find 1
61a520a7cfSRick Macklemin order to recover the data
62a520a7cfSRick Macklemstorage files onto a repaired DS.
63a520a7cfSRick Macklem.It Fl m Ar source-mounted-on-DS-dir destination-mounted-on-DS-dir
64a520a7cfSRick MacklemThis option indicates that the data storage file is to be migrated from
65*dc872572SElyes Haouasthe source DS mounted on the directory
66a520a7cfSRick Macklem.Dq source-mounted-on-DS-dir
67a520a7cfSRick Macklemto the DS mounted on the directory
68a520a7cfSRick Macklem.Dq destination-mounted-on-DS-dir .
69a520a7cfSRick MacklemIn this case, the data storage file will be removed from the source DS
70a520a7cfSRick Macklemwhen the copy is completed.
71a520a7cfSRick Macklem.El
72a520a7cfSRick MacklemIf the copy/migration is already done, the command will simply exit(0),
73a520a7cfSRick Macklemso that it can safely be used on all regular files in the exported directory
74a520a7cfSRick Macklemtree on the MDS.
75a520a7cfSRick Macklem.Pp
76a520a7cfSRick MacklemThis command must be run on the MDS and a typical usage would be as an
77a520a7cfSRick Macklemargument for
78a520a7cfSRick Macklem.Xr find 1
79a520a7cfSRick Macklemfor all regular files.
80a520a7cfSRick Macklem.sp
81a520a7cfSRick MacklemFor example, if the repaired DS is mounted on /data3 and files previously
82a520a7cfSRick Macklemstored on the repaired DS have had the DS's IP address set to 0.0.0.0:
83a520a7cfSRick Macklem.br
84a520a7cfSRick Macklem# cd <top-level-exported-directory-on-the-MDS>
85a520a7cfSRick Macklem.br
86a520a7cfSRick Macklem# find . -type f -exec pnfsdscopymr -r /data3 {} \\;
87a520a7cfSRick Macklem.Sh SEE ALSO
88a520a7cfSRick Macklem.Xr find 1 ,
89a520a7cfSRick Macklem.Xr nfsv4 4 ,
90a520a7cfSRick Macklem.Xr pnfs 4 ,
91a520a7cfSRick Macklem.Xr nfsd 8 ,
92a520a7cfSRick Macklem.Xr pnfsdsfile 8 ,
93a520a7cfSRick Macklem.Xr pnfsdskill 8
94a520a7cfSRick Macklem.Sh HISTORY
95a520a7cfSRick MacklemThe
96a520a7cfSRick Macklem.Nm
97a463bac8SRick Macklemcommand first appeared in
98a463bac8SRick Macklem.Fx 12.0 .
99