├── LICENSE
├── README.md
├── doc
└── Wyng_Archive_Format_V3.md
├── media
├── become_a_patron_button.png
├── buymeacoffee_57.png
├── ko-fi.png
└── lp_donate.svg
├── misc
└── convert-dir-to-subvol.sh
├── pubkey
├── src
├── wyng
└── wyng.gpg
└── tests
└── lvm_setup.sh
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | _
Wyng
_
2 |
3 | Faster incremental backups for logical volumes and disk images.
4 |
5 |
6 | ### Introduction
7 |
8 | Wyng is able to deliver faster incremental backups for logical
9 | volumes and disk images. It accesses *copy-on-write* metadata (instead of comparing all data
10 | for each backup) to instantly find changes since the last backup.
11 | Combined with its efficient archive format, Wyng can also very quickly reclaim space
12 | from older backup sessions.
13 |
14 | Having nearly instantaneous access to volume changes and a nimble archival format
15 | enables backing up even terabyte-sized volumes multiple times per hour with little
16 | impact on system resources.
17 |
18 | Wyng pushes data to archives in a stream-like fashion, which avoids temporary data
19 | caches and re-processing data. And Wyng's ingenious snapshot rotation avoids common
20 | _aging snapshot_ space consumption pitfalls.
21 |
22 | Wyng also doesn't require the source admin system to ever mount processed volumes or
23 | to handle them as anything other than blocks, so it safely handles
24 | untrusted data in guest filesystems to bolster container-based security.
25 |
26 |
27 | ### Status
28 |
29 | Public beta with a range of features including:
30 |
31 | - Incremental backups of Linux logical volumes from Btrfs, XFS and Thin-provisioned LVM
32 |
33 | - Supported destinations: Local filesystem, Virtual machine or SSH host
34 |
35 | - Fast pruning of old backup sessions
36 |
37 | - Basic archive management such as add/delete volume and auto-pruning
38 |
39 | - Automatic creation & management of local snapshots
40 |
41 | - Data deduplication
42 |
43 | - Marking and selecting archived snapshots with user-defined tags
44 |
45 | Version 0.8 major enhancements:
46 |
47 | - Btrfs and XFS reflink support
48 |
49 | - Authenticated encryption with auth caching
50 |
51 | - Full data & metadata integrity checking
52 |
53 | - Fast differential receive based on local snapshots
54 |
55 | - Overall faster operation
56 |
57 | - Change autoprune behavior with --apdays
58 |
59 | - Configure defaults in /etc/wyng/wyng.ini
60 |
61 | - Mountpoints no longer required at destination
62 |
63 | - Simple selection of archives and local paths: Choose any _local_ or _dest_ each time you run Wyng
64 |
65 | - Multiple volumes can now be specified for most Wyng commands; send and receive support multiple storage pools
66 |
67 | Wyng is released under a GPL license and comes with no warranties expressed or implied.
68 |
69 |
70 | Wyng v0.8 Requirements & Setup
71 | ---
72 |
73 | Before starting:
74 |
75 | * Python 3.8 or greater is required for basic operation.
76 |
77 | * For encryption and top performance, the _python3-pycryptodome_ and _python3-zstd_ packages
78 | should be installed, respectively.
79 |
80 | * Volumes to be backed-up should reside locally in one of the following snapshot-capable
81 | storage types: LVM thin-provisioned pool, Btrfs subvolume, or XFS/reflink capable filesystem. Otherwise, volumes may be imported from or saved to other filesystems at standard (slower) speeds.
82 |
83 | * For backing up from LVM, _thin-provisioning-tools & lvm2_ must be present on the source system. For Btrfs, the `btrfs` command must be present.
84 |
85 | * The destination system where the Wyng archive is stored (if different from source) should
86 | also have python3, plus a basic Unix command set and filesystem (i.e. a typical Linux or BSD
87 | system). Otherwise, _samba_, FUSE, etc. may be used to access remote storage using smb, sftp, s3 or other protocols
88 | without concern for python or Unix commands.
89 |
90 | * See the 'Testing' section below for tips and caveats about using the alpha and beta versions.
91 |
92 |
93 | ## Getting Started
94 |
95 | Wyng is distributed as a single Python executable with no complex
96 | supporting modules or other program files; it can be placed in '/usr/local/bin'
97 | or another place of your choosing.
98 |
99 |
100 | Archives can be created with `wyng arch-init`:
101 |
102 | ```
103 | wyng arch-init --dest=ssh://me@example.com:/home/me/mylaptop.backup
104 |
105 | ...or...
106 |
107 | wyng arch-init --dest=file:/mnt/drive2/mylaptop.backup
108 | ```
109 |
110 | The examples above create a 'mylaptop.backup' directory on the destination.
111 | The `--dest` argument includes the destination type, remote system (where applicable)
112 | and directory path.
113 |
114 | Next you can start making backups with `wyng send`:
115 |
116 | ```
117 | wyng send --dest=file:/mnt/drive1/mylaptop.backup --local=volgrp1/pool1 root-volume home-volume
118 | ```
119 |
120 | This command sends two volumes 'root-volume' and 'home-volume' from the LVM thin pool 'volgrp1/pool1' to the destination archive.
121 |
122 |
123 | ## Operation
124 |
125 | Run Wyng using the following commands and arguments in the form of:
126 |
127 | **wyng \[--options] command \[volume_names] \[--options]**
128 |
129 |
130 | ### Command summary
131 |
132 | | _Command_ | _Description_ |
133 | |---------|---|
134 | | **list** _[volume_name]_ | List volumes or volume sessions.
135 | | **send** _[volume_name]_ | Perform a backup of enabled volumes.
136 | | **receive** _volume_name [*]_ | Restore volume(s) from the archive.
137 | | **verify** _volume_name [*]_ | Verify volumes' data integrity.
138 | | **prune** _[volume_name] [*]_ | Remove older backup sessions to recover archive space.
139 | | **delete** _volume_name_ | Remove entire volume from config and archive.
140 | | **rename** _vol_name_ _new_name_ | Renames a volume in the archive.
141 | | **arch-init** | Create a new Wyng archive.
142 | | **arch-deduplicate** | Deduplicate existing data in an archive.
143 | | **version** | Print the Wyng version and exit.
144 |
145 |
146 | ### Advanced commands
147 |
148 | | _Command_ | _Description_ |
149 | |---------|---|
150 | | **monitor** | Collect volume change metadata & rotate snapshots.
151 | | **diff** _volume_name [*]_ | Compare local volume with archived volume.
152 | | **add** _volume_name [*]_ | Adds a volume name without session data to the archive.
153 | | **arch-check** _[volume_name] [*]_ | Thorough check of archive data & metadata
154 |
155 |
156 | ### Command details
157 |
158 | #### send
159 |
160 | Performs a backup by storing volume data to a new session in the archive. If the volume
161 | already exists in the archive, incremental mode is automatically used.
162 |
163 | ```
164 |
165 | wyng send my_big_volume --local=vg/pool --dest=file:/mnt/drive1/mylaptop.backup
166 |
167 | ```
168 |
169 | `send` supports automatic pruning of older backup sessions to recover disk space before the new data is sent; set `--autoprune` option to _on_ or _full_ to use this feature.
170 |
171 | Volume names for non-LVM storage may include subdirectories, making them relative paths in
172 | the same manner as file paths in `tar`.
173 | For example, `wyng --local=/mnt/pool1 send appvms/personal.img` will send the volume located
174 | at '/mnt/pool1/appvms/personal.img'.
175 |
176 | #### receive
177 |
178 | Retrieves volumes (using the latest session ID
179 | if `--session` isn't specified) from the archive and saves it to either the `--local`
180 | storage or the path specified with `--save-to` (the latter allows receiving only
181 | one volume at a time).
182 | If `--session` is used, only one date-time is accepted. The volume name is required.
183 |
184 | ```
185 |
186 | wyng receive vm-work-private --local=vg/pool --dest=file:/mnt/drive1/mylaptop.backup
187 |
188 | ```
189 |
190 | ...restores a volume called 'vm-work-private' to 'myfile.img' in
191 | the LVM thin pool 'vg/pool'. Note that `--dest` always refers to the archive location, so
192 | the volume is being restored _from_ '/mnt/drive1/mylaptop.backup'.
193 |
194 | Its possible to receive to any valid file path or block device using the `--save-to` option,
195 | which can be used in place of `--local`.
196 | For any save path, Wyng will try to discard old data before receiving unless `--sparse`,
197 | `--sparse-write` or `--use-snapshot` options are used.
198 |
199 |
200 | #### verify
201 |
202 | The `verify` command is similar to `receive` without saving the data. For both
203 | `receive` and `verify` modes, an error will be reported with a non-zero exit
204 | code if the received data does not pass integrity checks.
205 |
206 |
207 | #### prune
208 |
209 | Reclaim space on a backup drive by removing prior backup session(s) you specify.
210 |
211 | To use, supply a single exact date-time in _YYYYMMDD-HHMMSS_ format to remove a
212 | specific session, or two date-times representing a range:
213 |
214 | ```
215 | wyng prune --all --session=20180605-000000,20180701-140000 --dest=file:/mnt/drive1/mylaptop.backup
216 | ```
217 |
218 | ...removes backup sessions from midnight on June 5 through 2pm on July 1 for all
219 | volumes. Alternately, `--all-before` may be used with a single `--session` date-time
220 | to prune all sessions prior to that time.
221 |
222 | The `--keep` option can accept a single date-time or a tag in the form `^tagID`.
223 | Matching sessions will be excluded from pruning and autopruning.
224 |
225 | Also see `--autoprune` option below which works with `prune` and `send` commands.
226 |
227 |
228 | #### delete
229 |
230 | Removes a volume's Wyng-managed snapshots, config and metadata from the source system and
231 | all of its *data* from the destination archive (everything deleted except the source
232 | volume). Use with caution!
233 |
234 | An alternate form of `delete` will remove all Wyng archive-related metadata (incl. snapshots) from the
235 | local system without affecting the archive on the destination:
236 |
237 | ```
238 |
239 | wyng delete --clean
240 |
241 | ```
242 |
243 | Alternately, using `delete --clean --all` will remove all known Wyng metadata from the local system,
244 | including any snapshots from the `--local` path.
245 |
246 | #### rename
247 | ```
248 |
249 | wyng rename oldname newname
250 |
251 | ```
252 |
253 | Renames a volume _'oldname'_ in the archive to _'newname'_. Note: This will rename only the
254 | archive volume, _not_ your source volume.
255 |
256 |
257 | #### arch-deduplicate
258 |
259 | De-duplicates the entire archive by removing repeating patterns. This can save space
260 | on the destination's drive while keeping the archived volumes intact.
261 |
262 | De-duplication can also be performed incrementally by using `--dedup` with `send`.
263 |
264 |
265 | ```
266 |
267 | wyng arch-deduplicate
268 |
269 | ```
270 |
271 |
272 | #### arch-init
273 |
274 | Create a new archive on a mounted drive...
275 | ```
276 |
277 | wyng arch-init --dest=file:/mnt/backups/archive1
278 |
279 | ```
280 |
281 | Create a new archive with stronger compression on a remote system...
282 | ```
283 |
284 | wyng arch-init --dest=ssh://user@example.com --compression=zstd:7
285 |
286 | ```
287 |
288 | Optional parameters for `arch-init` are _encrypt, compression, hashtype_ and _chunk-factor_.
289 | These cannot be changed for an archive after it is initialized.
290 |
291 |
292 | #### arch-check
293 |
294 | Intensive check of archive integrity, reading each session's _deltas_ completely starting with
295 | the newest and working back to the oldest. This differs from `verify` which first builds a complete index and checks a complete volume.
296 |
297 | Using `--session=newest` provides a 'verify the last session' function (useful after an incremental
298 | backup). Otherwise, supplying a date-time will make `arch-check` start the check from that point and
299 | then continue working toward the oldest session. Session ranges are not yet supported.
300 |
301 | Depending on how `arch-check` is used, the verification process can be shorter _or much longer_
302 | than using `verify` as the latter is always the size of a volume snapshot. The longest, most
303 | complete form of `arch-check` is to supply no parameters, which checks all sessions in all volumes.
304 |
305 |
306 |
307 | #### monitor
308 |
309 | Frees disk space that is cumulatively occupied by aging snapshots, thereby addressing a
310 | common resource usage issue with snapshot-based backups.
311 | After harvesting their change metadata, the older snapshots are replaced with
312 | new ones occupying zero space. Running `monitor` isn't necessary,
313 | but it only takes a few seconds and is good to run on a frequent, regular basis
314 | if you have some volumes that are write-intensive. Volume names may also be
315 | specified if its desired to monitor only certain volumes.
316 |
317 | This rule in /etc/cron.d runs `monitor` every 20 minutes:
318 |
319 | ```
320 | */20 * * * * root su -l -c '/usr/local/bin/wyng monitor --all'
321 | ```
322 |
323 |
324 | #### diff
325 |
326 | Compare a local volume snapshot with the archive and report any differences.
327 | This is useful for diagnostics and can also be useful after a verification
328 | error has occurred.
329 |
330 |
331 | #### add
332 |
333 | Adds new, empty volume name(s) to the archive. On subsequent `send -a`, Wyng will backup
334 | the volume data if present.
335 |
336 |
337 |
338 |
339 | ### Parameters / Options summary
340 |
341 | | _Option_ | _Description_
342 | |-------------------------------|--------------
343 | --dest=_URL_ | Location of backup archive.
344 | --local=_vg/pool_ _...or..._ | Storage pool containing local volumes.
345 | --local=_/absolute/path_ |
346 | --authmin=_N_ | Remember authentication for N minutes (default: 5)
347 | --all, -a | Select all volumes (most cmds); Or clean all snapshots (delete).
348 | --volex=_volname_ | Exclude volumes (send, monitor, list, prune).
349 | --dedup, -d | Use deduplication for send (see notes).
350 | --session=_date-time[,date-time]_ | Select a session or session range by date-time or tag (receive, verify, prune).
351 | --all-before | Select all sessions before the specified _--session date-time_ (prune).
352 | --autoprune=off | Automatic pruning by calendar date.
353 | --apdays=_A:B:C:D_ | Number of days to keep or to thin-out older sessions
354 | --keep=_date-time_ | Specify date-time or tag of sessions to keep (prune).
355 | --tag=tagname[,desc] | Use session tags (send, list).
356 | --sparse | Receive volume data sparsely (implies --sparse-write)
357 | --sparse-write | Overwrite local data only where it differs (receive)
358 | --use-snapshot | Use snapshots when available for faster `receive`.
359 | --send-unchanged | Record unchanged volumes, don't skip them (send)
360 | --unattended, -u | Don't prompt for interactive input.
361 | --clean | Perform garbage collection (arch-check) or metadata removal (delete).
362 | --verbose | Increase details.
363 | --quiet | Shhh...
364 |
365 |
366 | ### Advanced Options
367 |
368 | | _Option_ | _Description_
369 | |-------------------------------|--------------
370 | --save-to=_path_ | Save a volume to _path_ (receive).
371 | --local_from=_json file_ | Specify local:[volumes] sets instead of --local.
372 | --import-other-from | Import volume data from a non-snapshot capable path during `send`
373 | --session-strict=_on_ | Don't retrieve volume from next-oldest session if no exact session match
374 | --encrypt=_cipher_ | Set encryption mode or _'off'_ (default: _'xchacha20-dgr'_)
375 | --compression | (arch-init) Set compression type:level.
376 | --hashtype | (arch-init) Set data hash algorithm: _hmac-sha256_ or _blake2b_.
377 | --chunk-factor | (arch-init) Set archive chunk size.
378 | --vid | Select volume by ID (delete)
379 | --tar-bypass | Use direct access for file:/ archives (send)
380 | --passcmd=_'command'_ | Read passphrase from output of a wallet/auth app
381 | --upgrade-format | Upgrade older Wyng archive to current format. (arch-check)
382 | --change-uuid | Change the archive UUID to a new random value. (arch-check)
383 | --dry-run | Make `send` session a dry run, see estimate of changed data.
384 | --remap | Remap volume to current archive during `send` or `diff`.
385 | --json | Output volume: session info in json format (list).
386 | --force | Not used with most commands.
387 | --force-allow-rollback | Accept archive if it was reverted to an earlier state.
388 | --opt-ssh | Override internal _ssh_ options.
389 | --opt-qubes | Override internal _qvm-run_ options.
390 | --meta-reduce=_mode:N_ | Reduce or extend local metadata caching.
391 | --meta-dir=_path_ | Use a different metadata dir than the default.
392 | --debug | Debug mode
393 |
394 |
395 |
396 |
397 | ### Option Details
398 |
399 | #### `--dest=URL`
400 |
401 | This option tells Wyng where to access the archive and has the same meaning for all read or write
402 | commands. It accepts one of the following forms:
403 |
404 | | _URL Form_ | _Destination Type_
405 | |----------|-----------------
406 | |__file:__/path | Local filesystem
407 | |__ssh:__//user@example.com[:port][/path] | SSH server
408 | |__qubes:__//vm-name[/path] | Qubes virtual machine
409 | |__qubes-ssh:__//vm-name:me@example.com[:port][/path] | SSH server via a Qubes VM
410 |
411 |
412 | #### `--local`
413 |
414 | The location of local storage where logical volumes, disk images, etc. reside. This serves as
415 | the _source_ for `send` commands, and as the place where `receive` restores/saves volumes.
416 |
417 | This parameter takes one of two forms: Either the source volume group and pool as 'vgname/poolname'
418 | or a directory path on a reflink-capable filesystem such as Btrfs or XFS (for Btrfs the path should
419 | end at a subvolume). Required for commands `send`, `monitor` and `diff` (and `receive` when
420 | not using `--saveto`).
421 |
422 |
423 | #### `--session=[,]` OR
424 | #### `--session=^[,^]`
425 |
426 | Session allows you to specify a single date-time or tag spec for the`receive`, `verify`, `diff`,
427 | and `arch-check` commands. Using a tag selects the last session having that tag. When specifying
428 | a tag, it must be prefixed by a `^` carat.
429 |
430 | For `prune`, specifying
431 | a tag will have different effects: a single spec using a tag will remove only each individual session
432 | with that tag, whereas a tag in a dual (range) spec will define an inclusive range anchored at the first
433 | instance of the tag (when the tag is the first spec) or the last instance (when the tag is the
434 | second range spec). Also, date-times and tags may be used together in a range spec.
435 |
436 |
437 | #### `--volex= [--volex= *]`
438 |
439 | Exclude one or more volumes from processing. May be used with commands that operate on multiple
440 | volumes in a single invocation, such as `send`. volex is useful in cases where a volume is
441 | in the archive, but frequent automatic backups aren't needed. Or when certain volumes should
442 | be excluded from prune, monitor, etc.
443 |
444 | **Please note:** volex syntax had to be changed from the v0.3 option syntax which used a comma to
445 | specify multiple volumes.
446 |
447 |
448 | #### `--sparse-write`
449 |
450 | Used with `receive`, the sparse-write mode tells Wyng not to create a brand-new local volume and
451 | results in the data being sparsely written into the existing volume instead. This is useful if
452 | the existing
453 | local volume is a clone/snapshot of another volume and you wish to save local disk space. It is also
454 | best used when the backup/archive storage is local (i.e. fast USB drive or similar) and you don't
455 | want the added CPU usage of full `--sparse` mode.
456 |
457 |
458 | #### `--sparse`
459 |
460 | The sparse mode can be used with the `receive` command to intelligently retrieve and overwrite
461 | an existing
462 | local volume so that only the differences between local and archived volumes will be fetched
463 | from the archive and written to the local volume. This results in reduced network
464 | usage at the expense of some extra CPU usage on the local machine, and also uses
465 | less local disk space when snapshots are a factor. The best situation for sparse mode is when
466 | you want to restore/revert a large volume with a containing a limited number of changes
467 | over a low-bandwidth connection.
468 |
469 |
470 | #### `--use-snapshot`
471 |
472 | A faster-than-sparse option that uses a snapshot as the baseline for the
473 | `receive`, if one is available. Use with `--sparse` if you want Wyng to fall back to
474 | sparse mode when snapshots are not already present.
475 |
476 |
477 | #### `--tar-bypass` _(experimental)_
478 |
479 | Use direct access for file:/ archives during `send`. This can reduce sending times by
480 | up to 20%.
481 |
482 |
483 | #### `--dedup`, `-d`
484 |
485 | When used with the `send` command, data chunks from the new backup will be sent only if
486 | they don't already exist somewhere in the archive. Otherwise, a link will be used saving
487 | disk space and possibly time and bandwith.
488 |
489 | The trade-off for deduplicating is longer startup time for Wyng, in addition to using more
490 | memory and CPU resources during backups. Using `--dedup` works best if you are backing-up
491 | multiple volumes that have a lot of the same content and/or you are backing-up over a slow
492 | Internet link.
493 |
494 |
495 | #### `--dry-run`
496 |
497 | Have `send` perform a dry run, where no data is saved to the archive. This is useful for testing and also getting an estimate of the amount of data that will be transmitted during a normal `send`. If a volume that had lost its snapshot or delta map is included in a dry run, its map will be re-created automatically saving time on the next `send`.
498 |
499 | Since it affects the amount of data transmitted, including the `--dedup` option in the dry run is recommended if you intend to make the actual backup with `--dedup`.
500 |
501 |
502 | #### `--autoprune=(off | on | full)`
503 |
504 | Autoprune may be used with either the `prune` or `send` commands and will cause Wyng to
505 | automatically remove older backup sessions according to date criteria. When used with `send`
506 | specifically, the autopruning process will be triggered in advance of sending new sessions
507 | when using _full_ mode, or in _on_ mode only or if the destination filesytem is
508 | low on free space. (See _--apdays_ to specify additional autoprune parameters.)
509 |
510 | Selectable modes are:
511 |
512 | __off__ is the current default.
513 |
514 | __on__ removes _some_ sessions, as space is needed on the destination.
515 |
516 | __full__ removes all sessions that are due to expire according to above criteria.
517 |
518 | #### `--apdays=A:B:C:D`
519 |
520 | Adjust autoprune with the following four parameters:
521 |
522 | * A: The oldest day before which _all_ sessions are removed. Default is 0 (disabled).
523 | * B: Thinning days; the number of days before which _some_ sessions will be removed
524 | according to the ratio _D/C_. Default is 62 days.
525 | * C: Number of _days_ for the D/C ratio. Default is 1.
526 | * D: Number of _sessions_ for the D/C ratio. Default is 2.
527 |
528 | An example: `--apdays=365:31:1:2` will cause autoprune to remove all sessions that are older
529 | than 365 days, and sessions older than 31 days will be thinned-out while preserving
530 | (roughly on average) two sessions per day.
531 |
532 | #### `--tag=`
533 |
534 | With `send`, attach a tag name of your choosing to the new backup session/snapshot; this may be
535 | repeated on the command line to add multiple tags. Specifying an empty '' or '@' tag will cause Wyng to ask for one or more tags to be manually input; this also causes `list` to display tag
536 | information when listing sessions.
537 |
538 | #### `--authmin=`
539 | #### `--passcmd=`
540 |
541 | These two options help automate Wyng authentication, and may be used together or separately.
542 |
543 | `--authmin` takes a numeric value from -1 to 60 for the
544 | number of minutes to remember the current authentication for subsequent Wyng invocations.
545 | The default authmin time is 2 minutes. Specifying a -1 will cancel a prior authentication
546 | and 0 will skip storing the authentication.
547 |
548 | The `--passcmd` option takes a string representing a shell command that outputs a passphrase
549 | to _stdout_ which
550 | Wyng then reads instead of prompting for passphrase input. If a prior auth from
551 | `--authmin` is active, this option is ignored and the command will not be executed.
552 |
553 |
554 | #### `--import-other-from=volname:|:path`
555 |
556 | Enables `send`ing a volume from a path that is not a supported snapshot storage type. This may
557 | be any regular file or a block device which is seek-able.
558 |
559 | When it is specified this option causes slow delta comparisons to be used for the specified volume(s)
560 | instead of the default fast snapshot-based delta comparisons. It is not recommended for regular
561 | use with large volumes.
562 |
563 | The special delimeter used to separate the _volname_ (archive volume name) and the _path_ is ':|:'
564 | which means this option cannot be used to `send` directly to volume names in the archive which
565 | contain that character sequence.
566 |
567 |
568 | #### `--session-strict=on|off`
569 |
570 | For receive, verify, diff: If set to 'on' (the default) Wyng won't retrieve volumes from next-oldest session if the
571 | specified volumes don't have an exact match for the specified session. When set to 'off'
572 | Wyng will try to retrieve the next-oldest version of the volume if one exists.
573 |
574 |
575 | #### `--local_from=_json file_`
576 |
577 | Specify both local storage and volume names for `send` or `receive` as sets, instead
578 | of using --local and volume names on the command line. The json file must take the form
579 | of `{local-a: [[volname1, alias1], [volnameN, aliasN], ...], ...]}`. This allows multiple
580 | local storage sources to be sent/received in a single session.
581 |
582 | _Alias_ can be _'null'_ for no alias or any valid name. However, the volume names (or aliases)
583 | must all be unique across different sources as they are stored in the same archive. Aliases define which local volume name into which an archive volume will be received, or when sending
584 | they indicate a request to actually _rename_ the target volume to the alias.
585 |
586 |
587 | #### `--meta-reduce=mode:minutes`
588 |
589 | Control the degree to which locally cached session metadata is retained or removed when
590 | Wyng exits. This can effect a noticeable reduction in the space that Wyng uses in /var
591 | while trading off a little speed.
592 |
593 | ___Mode___ is one of _off, on,_ or _extra_: _off_ results in no reduction (all metadata is
594 | retained); _on_ removes uncompressed metadata; _extra_ removes both compressed and uncompressed
595 | metadata.
596 |
597 | ___Minutes___ is an integer defining the metadata's maximum age in minutes, where '0'
598 | will cause it to be removed immediately when Wyng exits.
599 |
600 | The default setting is _'on:3000'_.
601 |
602 |
603 | #### `--compression`
604 |
605 | Accepts the forms `type` or `type:level`. The three types available are `zstd` (zstandard),
606 | plus `zlib` and `bz2` (bzip2). Note that Wyng will only default
607 | to `zstd` when the 'python3-zstd' package is installed; otherwise it will fall back to the less
608 | capable `zlib`. (default=zstd:3)
609 |
610 |
611 | #### `--hashtype`
612 |
613 | Accepts a value of either _'blake2b'_ or _'hmac-sha256'_ (default). The digest size is 256 bits.
614 |
615 |
616 | #### `--chunk-factor`
617 |
618 | Sets the pre-compression data chunk size used within the destination archive.
619 | Accepted range is an integer exponent from '1' to '6', resulting in a chunk size of 64kB for
620 | factor '1', 128kB for factor '2', 256kB for factor '3' and so on. To maintain a good
621 | space efficiency and performance balance, a factor of '2' or greater is suggested for archives
622 | that will store volumes larger than about 100GB. (default=2)
623 |
624 |
625 | #### `--encrypt`
626 |
627 | Selects the encryption cipher/mode. The available modes are:
628 |
629 | - `xchacha20-dgr` — Using HMAC-SHA256(rnd||hash) function. This is the default.
630 | - `xchacha20-msr` — Using HMAC-SHA256(rnd||msg) function.
631 | - `xchacha20-ct` — Counter based; fast like _*-dgr_ with different safety trade-offs (see issue [158](https://github.com/tasket/wyng-backup/issues/158)).
632 | - `off` — Turns off Wyng's authentication and encryption.
633 |
634 |
635 |
636 |
637 | ### Configuration files
638 |
639 | Wyng will look in _'/etc/wyng/wyng.ini'_ for option defaults. For options that are flags with
640 | no value like `--dedup`, use a _1_ or _0_ to indicate _enable_ or _disable_ (yes or no).
641 | For options allowing multiple entries per command line, in the .ini use multiple lines with the
642 | 2nd item onward indented by at least one space.
643 |
644 | An example _wyng.ini_ file:
645 |
646 | ```
647 | [var-global-default]
648 | dedup = 1
649 | authmin = 10
650 | autoprune = full
651 | dest = ssh://user@192.168.0.8/home/user/wyng.backup
652 | local = /mnt/btrfs01/vms
653 | volex = misc/caches.img
654 | misc/deprecated_apps.img
655 | windows10_recovery.vmdk
656 | ```
657 |
658 |
659 | ### Verifying Code
660 |
661 | Wyng code can be cryptographically verified using either `gpg` directly or via `git`:
662 |
663 | ```sh
664 | # Import Key
665 | ~$ cd wyng-backup
666 | ~/wyng-backup$ gpg --import pubkey
667 | gpg: key 1DC4D106F07F1886: public key "Christopher Laprise " imported
668 | gpg: Total number processed: 1
669 | gpg: imported: 1
670 |
671 | # GPG Method
672 | ~/wyng-backup$ gpg --verify src/wyng.gpg src/wyng
673 |
674 | # Git Method
675 | ~/wyng-backup$ git verify-commit HEAD
676 |
677 | # Output:
678 | gpg: Signature made Sat 26 Aug 2023 04:20:46 PM EDT
679 | gpg: using RSA key 0573D1F63412AF043C47B8C8448568C8B281C952
680 | gpg: Good signature from "Christopher Laprise " [unknown]
681 | gpg: aka "Christopher Laprise " [unknown]
682 | ```
683 |
684 |
685 | ### Security notes
686 |
687 | #### Automated authentication:
688 |
689 | Wyng supports two modes of supplying passphrase secrets: Standard input
690 | and the `--passcmd` option. The former can accept a secret from a pipe or
691 | redirect because when auth is necessary it is always the first input prompt.
692 | However, the prompt may not always occur when `--authmin` value > 0 is used since
693 | the passphrase may not be needed for repeat invocations of Wyng.
694 |
695 | #### Persistence of cached archive.ini & archive.salt:
696 |
697 | Authentication schemes in general can only verify the authenticity for an
698 | object at any point in time; they aren't well suited to telling us if that object
699 | (i.e. a backup archive) is the most recent update, and so they are vulnerable to rollback
700 | attacks that replace your current archive with an older version (in Wyng this is related to
701 | replay attacks, but not downgrade attacks). Wyng guards against
702 | such attacks by checking that the time encoded in your locally cached archive.ini isn't newer
703 | than the one on the destination/remote; Wyng also displays the last archive modification time
704 | whenever you access it.
705 |
706 |
707 | #### Protecting and Verifying Archive Authenticity:
708 |
709 | With encryption enabled, Wyng provides a kind of built-in verification of archive authenticity;
710 | this is because it uses an AEAD cipher mode. However, custom verification
711 | (BYOV) is also possible with Wyng and even works on non-encrypted archives. All you need
712 | to do is sign the 'archive.ini' file from the top archive directory after executing any Wyng
713 | command that changes the archive (i.e. _arch-init, add, send, prune, delete, rename_).
714 |
715 | Subsequently, the steps to verify total archive authenticity would be to simply run
716 | `wyng arch-check --dest ` (using Wyng's built-in authenticated encryption), or else using custom
717 | authentication based on GPG, for instance:
718 | ```
719 | cd /mnt/backups
720 | gpg --verify laptop1.sig laptop1.backup/archive.ini && wyng arch-check --dest=file:/mnt/backups/laptop1.backup
721 | ```
722 | Note that custom signature files should _not_ be stored within the archive directory.
723 |
724 | (Although volumes can be verified piecemeal with the `wyng verify` command, it is not suited
725 | to verifying everything within an archive.)
726 |
727 |
728 | ### Tips & Caveats
729 |
730 | * Qubes users: If you're using Wyng to backup Qubes VMs, you probably want to use the Wyng wrapper made especially for Qubes, [wyng-util-qubes](https://github.com/tasket/wyng-util-qubes), which makes saving & restoring VM settings along with data easy!
731 |
732 | * LVM users: Wyng has an internal snapshot manager which creates snapshots of volumes
733 | in addition to any snapshots you may already have on your local storage system.
734 | This can pose a serious challenge to _lvmthin_ (aka thin-provisioned LVM) as the default space
735 | allocated for metadata is often too small for rigorous & repeated snapshot rotation
736 | cycles. It is recommended to _at least double_ the existing or default tmeta space
737 | on each thin pool used with `wyng send` or `wyng monitor`; see the man page
738 | section _[Manually manage free metadata space of a thin pool LV](https://www.linux.org/docs/man7/lvmthin.html)_ for guidance on using
739 | the `lvextend --poolmetadatasize` command.
740 |
741 | * Btrfs users: In general it is a good idea to use disk images on a Btrfs filesystem that is
742 | relatively recent and well-maintained to ensure that fragmentation does not cause
743 | noticeable slowdowns. The simplest way to maintain a responsive filesystem is to
744 | defragment image files monthly or weekly as it is a single command and typically takes
745 | only a few minutes (there is no need to dismount the images). For example:
746 |
747 | ```
748 | sudo btrfs filesystem defragment -r -t 256K /var/lib/qubes
749 | ```
750 |
751 |
752 | Note that while the 'autodefrag' mount option can be used as an alternative, the overall performance will be reduced due to the smaller fragments and constant effect of write-amplification.
753 |
754 |
755 | Btrfs deduplicators like `bees` or `duperemove` can quickly increase fragmentation
756 | (i.e. undo the effects of _defragment_) if not used carefully. The `duperemove` docs
757 | indicate that choosing a larger block size will limit fragmentation, making it
758 | preferable to _bees_. The block `-b` value should be matched to the one used
759 | for `defragment -t`.
760 |
761 | * Receive/restore and deduplication: Wyng `receive` can prevent data duplication when there is an existing volume to over-write; in sparse mode it will compare existing data on disk with incoming data from the archive and avoid writing to areas that match. The `--use-snapshot` option has a similar space-saving effect and may be combined with the _sparse_ options. However, Wyng cannot tell if any other volumes on the system are related to the volumes being received, and it won't automatically use them as a starting point to reduce consumption of disk space; to attain the 'dedup' effect when restoring its up to you to create snapshots from related volumes at your respective receive paths/LVs before running `wyng --sparse receive`.
762 |
763 | * To reduce the size of incremental backups it may be helpful to remove or isolate cache
764 | files, if they exist in your source volumes. Typically, the greatest cache space
765 | consumption comes from web browsers, so
766 | volumes holding paths like /home/user/.cache can be impacted by this, depending
767 | on the amount and type of browser use associated with the volume. Three possible
768 | approaches are to clear caches on browser exit, delete /home/user/.cache dirs on
769 | system/container shutdown (this reasonably assumes cached data is expendable),
770 | or to mount .cache on a separate volume that is not configured for backup.
771 |
772 | * If you've changed your local path without first running `wyng delete --clean` to
773 | remove snapshots, there may be orphaned snapshots remaining under your old volume group
774 | or local directory. Deleting them can prevent unnecessary consumption of disk space. LVM snapshots can be found with the patterns `'*.tick'` and `'*.tock'` with
775 | the tag "wyng". Btrfs/XFS snapshots can be found with `'sn*.wyng?'`.
776 |
777 | * Keeping a [duplicate](https://github.com/tasket/wyng-backup/issues/199) archive or "a backup of the backup" is possible with the following:
778 | ```
779 | mv destpath destpath-incomplete
780 | rsync -uaHW --delete --no-compress sourcepath/. destpath-incomplete
781 | mv destpath-incomplete destpath
782 | ```
783 |
784 |
785 | The simple rsync example above can become bogged-down with unnecessary transfers because it doesn't take into account when pruning shifts data into different paths. A script that addresses this performance pitfall is available here.
786 |
787 | Note that since a duplicate archive is identical, including internal UUIDs, it should only be kept for an emergency such as when the original archive is no longer available or becomes unusable. Switching back and forth between the original and duplicate for regular archival operations is not supported.
788 |
789 | * _Sending to multiple archives:_ If you have created separate archives (not duplicates as described in the last section) and want to backup one or more volumes to both archives, Wyng can do this seamlessly from non-LVM storage systems such as Btrfs. With LVM, the --remap option would have to be used each time you switch archives; this slows Wyng down to the pace of a regular incremental backup program, so keeping a duplicate archive using rsync or similar may be preferable. However, this issue doesn't affect sending different sets of volumes to different archives, only when a specific volume is sent to more than one archive.
790 |
791 | * Wyng archives should be stored on Unix-like filesystems that were formatted with default or close-to default metadata settings (i.e. _inode_ capacity has not been manually reduced). Any format providing a 16KB:1 (or lower) data-to-inode ratio should work fine regardless of the Wyng chunksize being used.
792 |
793 |
794 | ### Troubleshooting notes
795 |
796 | * If you encounter an error during send/backup that the Btrfs path is "not a subvolume" its probably due to the `--local` path or pool ending in a dir not a subvolume. If you can't adjust the local path to end at an existing subvol, then a dir can be easily converted using `btfs subvol create` and `mv` commands. See the 'misc' project folder for an example dir-to-subvol conversion script.
797 |
798 | * A major change in v0.8 is that for `send` and `monitor` Wyng will no longer assume you want to
799 | act on all known volumes if you don't specify any volumes. You must now use `-a` or `--all`, which
800 | now work for other commands as well. This change also enables adding new volumes while doing a
801 | complete backup, for instance: `wyng -a send my-new-volume` – updates every volume already
802 | in the archive plus backup 'my-new-volume' as well.
803 |
804 | * Backup sessions shown in `list` output may be seemingly (but not actually) out of
805 | order if the system's local time shifts
806 | substantially between backups, such as when moving between time zones (including DST).
807 | If this results in undesired selections with `--session` ranges, its possible
808 | to nail down the precisely desired range by observing the output of
809 | `list volumename` and using exact date-times from the listing.
810 |
811 | * Wyng locally stores information about backups in two ways: Snapshots alongside your local
812 | source volumes, and metadata under _/var/lib/wyng_. It is safe to _delete_
813 | Wyng snapshots without risking the integrity of backups (although `send` will become slower).
814 | However, as with all CoW snapshot based backup tools, you should never attempt to directly mount, alter or otherwise utilize a Wyng snapshot
815 | as this could (very likely) result in future backup sessions being corrupt (this is why Wyng
816 | snapshots are stored as read-only). If you think you have somehow altered a Wyng snapshot, you
817 | should consider it corrupt and immediately delete it before the next `send`.
818 | If you're in a pinch and need to use the data in a Wyng snapshot, you should first make your own
819 | copy or snapshot of the Wyng snapshot using `cp --reflink` or `lvcreate -s` and use that instead.
820 |
821 | * Error _"Cached metadata is newer"_ indicates that something has reverted the archive to an earlier state. This could be due to a rollback attack, but could also be the result of your own actions such as keeping multiple copies of the same archive and alternately mounting them at the same location (in which case giving each copy a slightly different dir name can avert this error"; it could also be the result of a Wyng cache handling bug. Use the `--force-allow-rollback` option if you need to recover from this error and use the older archive as is.
822 |
823 | * Metadata cached under _/var/lib/wyng_ may also be manually deleted. However, the _archive.\*_
824 | root files in each 'a_*' directory are part of Wyng's defense against rollback attacks, so if you
825 | feel the need to manually reclaim space used in this dir then consider leaving the _archive.\*_
826 | files in place.
827 |
828 | * If data corruption in the archive is suspected, use `wyng arch-check` which will scan for errors and show options for recovery.
829 |
830 | * If a volume becomes damaged and unrecoverable it may be necessary to delete it by its volume ID by using `wyng delete --vid` instead of the volume name.
831 |
832 | ### Testing
833 |
834 | * The best way to test Wyng updates is to pull from a 'beta' branch or 'fixes' branch and start using the program for send and receive (backup and restore) as well as prune and diff operations (`wyng diff` verifies volumes with additional checking that the archive content is identical to the local copy, which is good for testing). Usually 'wip' and 'experimental' usually should be avoided unless you have an issue for a bug and a fix has been posted in one of them. Note that the '08beta' branch is being retired in preparation for the v0.8 full release; its not certain when '09beta' will be started.
835 |
836 | * Testing goals are basically stability, usability, security and efficiency. Compatibility
837 | is also a valued topic, where source systems are generally expected to be a fairly recent
838 | Linux distro or Qubes OS. Destination systems can vary a lot, they just need to have Python and
839 | Unix commands or support a compatible FUSE protocol such as sshfs(sftp) or s3.
840 |
841 |
842 | ### Donations
843 |
844 |
845 |
846 | Ko-Fi donate
847 |
848 | Buy me a coffee!
849 |
850 |
851 | If you like this project, monetary contributions are welcome and can
852 | be made through [Liberapay](https://liberapay.com/tasket/donate) or [Ko-Fi](https://ko-fi.com/tasket) or [Buymeacoffee](https://www.buymeacoffee.com/tasket).
853 |
--------------------------------------------------------------------------------
/doc/Wyng_Archive_Format_V3.md:
--------------------------------------------------------------------------------
1 | Wyng Archive Format V3
2 | ======================
3 |
4 | Document version 0.9.7, date 2025-03-28
5 | Author: Christopher Laprise, tasket@protonmail.com
6 |
7 | Home URLs:
8 | https://github.com/tasket/wyng-backup
9 | https://codeberg.org/tasket/wyng-backup
10 |
11 | Copyright 2023 Christopher Laprise, see 'License' section.
12 |
13 | ## Introduction
14 |
15 | The Wyng archive format is designed to store and manage raw disk volumes including logical
16 | volumes, disk image files & block devices for backup and archival purposes. It leverages the
17 | efficiency of common Unix-like filesystems as opposed to monolithic databases, which in turn
18 | facilitates quick addition and removal of incremental snapshots as well as data de-duplication.
19 | Authentication of data in either encrypted or cleartext form is also supported.
20 |
21 | ## General Overview
22 |
23 | #### Directory Structure:
24 |
25 | ```
26 | NAME DESCRIPTION
27 | mylaptop.backup/ archive dir
28 | ├── archive.ini archive metadata root
29 | ├── archive.salt archive encryption salt
30 | ├── salt.bak backup copy of salt
31 | ├── Vol_ab1234/ volume dir 'Vol_hexnum'
32 | │ ├── volinfo volume metadata
33 | │ │
34 | │ ├── S_20230101-120101/ session 0 dir 'S_date-time'
35 | │ │ ├── info session 0 metadata
36 | │ │ ├── manifest.z session 0 manifest: chunk hash list
37 | │ │ └── 000000000/ chunk dir for range 0x000000000XXXXXXX
38 | │ │ ├── x0000000000000000 data chunk
39 | │ │ ├── x0000000000020000 data chunk
40 | │ │ ├── x0000000000040000 data chunk
41 | │ │ ├── x0000000000060000 data chunk
42 | │ │ ├── x0000000000080000 data chunk
43 | │ │ ├── x00000000000a0000 data chunk
44 | │ │ │ [...] data chunks...
45 | │ │ └── x0000000002e00000 data chunk
46 | │ │
47 | │ ├── S_20230101-130101/ session 1 dir
48 | │ │ ├── info session 1 metadata
49 | │ │ ├── manifest.z session 1 manifest
50 | │ │ └── 000000000/ chunk dir for range 0x000000000XXXXXXX
51 | │ │ ├── x0000000000080000 data chunk
52 | │ │ ├── x0000000001b40000 data chunk
53 | │ │ └── x0000000002e00000 data chunk
54 | ```
55 |
56 | Wyng archives are directories similar to Apple OS X _sparsebundles_ in which volume data is divided
57 | into chunk files which are named for their respective addresses (offsets) within the volume. This
58 | simple hierarchical structure also accomodates multiple volumes and multiple sessions (or snapshots)
59 | for each volume. The top-level dir is named
60 | by the user and contains subdirs for each volume named 'Vol\_XXXXXX' (hex). Beneath the volume dirs
61 | are session subdirs named 'S\_YYYYMMDD-HHMMSS' (date-time) which have subdirs named after the
62 | 9 most-significant digits (MSD) of the hexadecimal address ranges in the volume. Within the address
63 | MSD dirs are the data chunk files.
64 |
65 | Metadata files within an archive are also hierarchical, with _archive.ini_ forming the root which holds global variables and a volume list pointing to volume dirs and hash values to validate each volume's _volinfo_ file. Similarly, each _volinfo_ has a list pointing to the volume's session
66 | subdirs along with the hash values to validate session _info_ files. And each session's _info_
67 | file contains a hash to validate the session's _manifest.z_ file. Each volume may also have a file named _session_, a json list of session names showing their actual sequencing unaffected by local time zone.
68 |
69 | Finally, _manifest.z_ contains a simple list of the volume data chunks contained in that session,
70 | referencing each chunk's address within the volume and its hash value (or '0' for all-zero chunks).
71 | The manifest for the oldest session contains a contiguous list of chunks, while newer
72 | session manifests list only chunks that have changed since the prior session.
73 |
74 | ## Write operations
75 |
76 | The major causes of change in a Wyng archive are the Wyng program's `send`, `prune` and `delete`
77 | commands.
78 |
79 | For example, a `send` operation will deposit data chunks into a new session dir suffixed with '-tmp',
80 | and then rename the dir without the suffix when the session transfer is complete. The data chunks
81 | themselves may be either regular binary files or space-saving hard links to existing data
82 | chunk files when de-duplication is used. There is no expectation of chunk files ever being updated
83 | or re-written except when they are replaced with hard links; they are intended mainly to be moved to
84 | other session dirs or to be deleted.
85 |
86 | New or changed metadata files are saved initially with a '.tmp' extension for the object in
87 | question, and then "zipper"-saved up the hierarchy to _archive.ini.tmp_ with updated hashes for
88 | each changed file. The '.tmp' files are then "zipper" renamed up the hierarchy without the
89 | extension to replace the old metadata. For a Wyng `send` operation, the following metadata
90 | files must be created or updated: _manifest.z, info, volinfo, archive.ini_.
91 |
92 | ## Read operations
93 |
94 | Accessing a volume session so that it appears as a complete data snapshot over the volume's
95 | entire address range involves combining all of the volume's session manifests up to that point
96 | (but not later ones) in a merge-unique operation keyed on the manifest's chunk address column.
97 | For example, the following shell commands combine two decoded session manifests to create a
98 | complete representation of the latter session:
99 |
100 | ```
101 | p=mylaptop.backup/Vol_ab1234
102 | sort -umsd -k2,2 $p/S_20230101-120101/manifest $p/S_20230101-130101/manifest >/tmp/ab1234
103 | ```
104 |
105 | A third column can be automatically added to indicate the session
106 | subdirs where each chunk is stored.
107 | This results in a list with each chunk's hash, address and path for the
108 | volume's entire range at that session's point in time. (See the Wyng function 'merge_manifests()'
109 | for implementation details.)
110 |
111 | ## Compression and hash types
112 |
113 | Selectable compression types are: _zstd_ (zstandard), _zlib_ and _bz2_ (bzip2). All objects except for
114 | salt files are compressed. All compressed objects use the same type selected by the user except for
115 | the _archive.ini BODY_ which always uses _gzip_.
116 |
117 | Hash type can be either _blake2b_ or _hmac-sha256_, uniform for an entire archive, with hashes
118 | stored as 256-bit 'URL safe' base64 strings.
119 |
120 | ## Archive integrity
121 |
122 | The Wyng format + code enforces a strict integrity regime by embedding each object's hash (digest)
123 | into the 'parent' metadata that references it. On Wyng startup, each data and metadata validation
124 | step is performed on a file immediately after it is decrypted and before it is decompressed,
125 | although _archive.ini_ is unique in this respect as the archive root.
126 |
127 | The validation chain is:
128 |
129 | archive.ini --\> volinfo --\> info --\> manifest.z --\> chunk files
130 |
131 | Without _authentication_ of the _archive.ini_ root, this process functions like a strong internal
132 | consistency check. However, with authentication of the root, that authentication extends
133 | to the entire archive. For encrypted archives, an authenticating cipher is always used for
134 | metadata starting at the root. Users may also authenticate _archive.ini_ independently, such as
135 | with a PGP signature; this allows authentication of un-encrypted Wyng archives.
136 |
137 | ## Encryption
138 |
139 | Wyng archives employ a combination of XChaCha20-Poly1305 AEAD and XChaCha20 ciphers for metadata and
140 | data, respectively. Each cipher uses a 256-bit key derrived from a passphrase and a 256-bit salt.
141 |
142 | Re-keying is _not_ implemented and all keys are static. However, the cipher's 192-bit
143 | nonces are used to their full extent with each nonce being generated by _libsodium_-recommended
144 | methods including a protected 80-bit counter and a keyed hash of _m || rnd_, as well as
145 | a keyed hash of _Hk || rnd_. In counter mode, the
146 | counter for each key is mirrored between the _archive.ini_ and the local cache of the
147 | _archive.salt_, with the highest value of the two used at runtime. Specifics of each
148 | encryption mode's key, counter, nonce and ciphertext handling can be found in
149 | Wyng's _DataCryptography_ class.
150 |
151 | Since authentication carries a performance penalty, and since
152 | Wyng's internal integrity checking extends authentication from the root to all other files, a
153 | non-authenticating cipher is typically used for data chunks.
154 |
155 | ## Data Structures
156 |
157 | ### archive.ini
158 |
159 | METADATA ROOT
160 |
161 | ##### HEADER
162 |
163 | | Content | Field Name | Type | Length (Bytes) | Desc |
164 | |:--------------|:--------------|:--------|:-------|:-----|
165 | |'[WYNG03]\x0a' | header prefix | UTF-8 | 9 | File type with version
166 | |'ci = XX\x0a' | cipher mode | UTF-8 | 8 | Two digits: cipher type
167 | |_N_-bytes | BODY | binary | _variable_ | gzip and encrypted, or gzip only if 'ci = 00'
168 |
169 | ##### BODY (ENCRYPTED)
170 |
171 | Where encrypted, the metadata files (or _archive.ini_ BODY) each consist of a single _message_,
172 | and are prefixed with the associated _nonce_ and _tag_. For the _ChaCha20-Poly1305_ cipher,
173 | the precise _message_ layout is:
174 |
175 | | Bytes | Type | Desc |
176 | |:-------|:--------|:-----|
177 | | 24 | binary | nonce
178 | | 16 | binary | AEAD tag
179 | | * | binary | msg ciphertext
180 |
181 | ##### BODY (PLAINTEXT)
182 | (ALL = UTF-8 encoded lines after decryption and decompression, ini config format):
183 |
184 | | Attribute or Section Name | Type | Desc |
185 | |:---------------------------|:-----------|:-----|
186 | |'[var]' | | ini section header
187 | |'uuid = ' | str | Archive UUID-4
188 | |'updated_at = ' | float | Unix seconds: Metadata timestamp
189 | |'format_ver = ' | int | Format version, matches header prefix, Ex. _3_
190 | |'chunksize = ' | int | Data chunk size, Ex. _131072_
191 | |'compression = ' | str | Compression type, Ex. _zstd_
192 | |'compr_level = ' | int | Compression level, Ex. _3_
193 | |'hashtype = ' | str | Hash type: _blake2b_ or _sha256_
194 | |'ci_mode = ' | str | Cipher selection, two characters. Must match header 'ci'.
195 | |'dataci_count = ' | int | Counter for data cipher
196 | |'mci_count = ' | int | Counter for metadata cipher
197 | | | _blank_ |
198 | |'[volumes]' | | ini section header: volumes list
199 | |vid[0] ' = ' | 256bit_b64_str | Volume id & hash for compressed 'volinfo' file
200 | |vid[N] ' = ' | 256bit_b64_str | Volume id & hash for [...]
201 | | | _blank_ |
202 | |'[in_process]' | | ini section header; usually empty
203 | |N ' = ' | str | Brief enum dict starting with volume id and operation name; describes interrupted write command such as 'delete' or 'merge'
204 |
205 |
206 | ---
207 |
208 | ### archive.salt
209 |
210 | Holds four key salt + counter pairs, with the first two sets for data (slot 0) and metadata (slot 1). Slots 2 and 3 provide salts for derived subkeys for 'Wyng_Nonces' and 'Wyng-Manifest-Hash' contexts, respectively. The offset for a key slot is calculated as: _(16 + 64) \* slot_.
211 |
212 | The key derivation function is _scrypt(passphrase, salt, n=2^19, r=8, p=1, maxmem=640\*1024\*1024, keysize)_.
213 | The subkey derivation function is _HKDF(key, output_size, salt, 'SHA512', slot-2, context)_, where
214 | the SHA-512 hash function is used and _output_size_ is typically 64 (bytes).
215 |
216 | The last 104 bytes are comprised of a BLAKE2b hash of all four salts, encrypted with the
217 | metadata cipher (slot 1). This is used to check the salt file integrity.
218 |
219 | | Bytes | Type | Desc |
220 | |:-------|:--------|:-----|
221 | | 10 | int | 80-bit counter, slot 0
222 | | 64 | binary | 512-bit key salt, slot 0
223 | | 10 | int | 80-bit counter, slot 1
224 | | 64 | binary | 512-bit key salt, slot 1
225 | | 10 | int | NULL / unused
226 | | 64 | binary | 512-bit key salt, slot 2
227 | | 10 | int | NULL / unused
228 | | 64 | binary | 512-bit key salt, slot 3
229 | | 24 | binary | Salt hash nonce
230 | | 16 | binary | Salt hash tag
231 | | 64 | binary | Salt hash, encrypted
232 |
233 | ---
234 |
235 | ### volinfo
236 |
237 | VOLUME METADATA
238 | (ALL = UTF-8 encoded lines after decryption and decompression):
239 |
240 | | Attribute Name | Type | Desc |
241 | |:----------------|:-----------|:-----|
242 | |'name = ' | str | Volume name (max. 4000 chars or 112 chars for LVM)
243 | |'desc = ' | str | Volume description (max. 100 chars)
244 | |'S_YYYYMMDD-HHMMSS = ' | 256bit_b64_str | Session name = hash for compressed 'info' file (0 or more occurrences)
245 |
246 |
247 | ---
248 |
249 | ### info
250 |
251 | SESSION METADATA
252 | (ALL = UTF-8 encoded lines after decryption and decompression):
253 |
254 | | Attribute Name | Type | Desc |
255 | |:-----------------|:-----------|:-----|
256 | |'localtime = ' | int | Unix nanoseconds: snapshot timestamp
257 | |'volsize = ' | int | Volume size in bytes
258 | |'sequence = ' | int | Session sequence number
259 | |'previous = ' | str | Name of previous session or "None" for oldest session
260 | |'permissions = ' | str | mode_int:user:group or single char "r\|w"
261 | |'manifesthash = ' | 256bit_b64_str or '0' | manifest hash, or '0' if empty session
262 | |'tag = ' | str | 'tag_id description' (0 or more occurrences)
263 |
264 |
265 | ---
266 |
267 | ### manifest.z
268 |
269 | DATA CHUNK HASH INDEX
270 |
271 | * Named 'manifest' in cache when decrypted and decompressed.
272 | * ASCII 'C' encoded lines after decryption and decompression.
273 | * Plaintext consists of __two columns__ always sorted by column two (xCHUNK_ADDRESS). No headers or sections.
274 | * Single _space_ (0x20) between columns, EOL (0x0a) line termination.
275 | * Single '0' in column one denotes all-zero 'hole' chunk with no associated data chunk file.
276 |
277 |
278 | _256bit_b64_str xCHUNK_ADDRESS_
279 |
280 | ...or...
281 |
282 | 0 _xCHUNK_ADDRESS_
283 |
284 | ---
285 |
286 | ### x0000000000000000
287 |
288 | DATA CHUNK
289 |
290 | Each data chunk file is named for the in-volume address (i.e. offset) from which the data was read.
291 | It contains compressed and encrypted series of data blocks from a source volume, which is validated
292 | by the corresponding hash in _manifest.z_.
293 |
294 | The chunk sizes before compression and encryption are uniform for each archive, with the
295 | exception of a volume's last chunk which is often smaller.
296 | The chunk size choices at archive creation time are _64KiB / 2 \* (2^N)_, where _N_ is an
297 | integer from 1 to 6.
298 |
299 | For the XChacha20 cipher, an encrypted chunk consists of a single _message_
300 | prefixed by a 24-byte _nonce_. For non-encrypted archives, a file will
301 | begin with a compression header generated by the chosen compression algorithm.
302 | Data chunk contents are processed as _raw data blocks_ with no inspection of internal
303 | content beyond hashing and zero/hole detection.
304 |
305 | ---
306 |
307 | ## Glossary
308 |
309 | _byte_ – Eight bits; an octet.
310 |
311 | _hash_ – A cryptograghic digest of binary data, via either BLAKE2b-256 or SHA-256.
312 |
313 | _manifest_ – A list of volume data chunks which identifies each chunk by its hash and address (offset within the volume).
314 |
315 | _session_ – A version of a volume during a specific backup session at a specific time; a snapshot copy.
316 |
317 | _volume_ – Any contiguous set of binary blocks, which likely contains a filesystem; a logical volume, disk image or disk partition.
318 |
319 | ---
320 |
321 | ## License
322 |
323 | Licensed under GNU General Public License v3. See file 'LICENSE'.
324 | Permission to redistribute under similar naming "Wyng Archive Format", "Wyng", "wyng backup", etc.
325 | is granted only for un-modified copies (GPLv3 S.7-c).
326 |
--------------------------------------------------------------------------------
/media/become_a_patron_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tasket/wyng-backup/e9777b797cf458d2704f06e642712887aef67423/media/become_a_patron_button.png
--------------------------------------------------------------------------------
/media/buymeacoffee_57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tasket/wyng-backup/e9777b797cf458d2704f06e642712887aef67423/media/buymeacoffee_57.png
--------------------------------------------------------------------------------
/media/ko-fi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tasket/wyng-backup/e9777b797cf458d2704f06e642712887aef67423/media/ko-fi.png
--------------------------------------------------------------------------------
/media/lp_donate.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/misc/convert-dir-to-subvol.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Simple non-destructive conversion of a directory to a Btrfs subvolume.
4 |
5 | set -e
6 |
7 | if ! [ $(id -u) = 0 ]; then
8 | echo Must be root user. Exiting.
9 | exit 1
10 | fi
11 |
12 | dir=$(realpath "$1")
13 | echo $dir
14 | if [ -z "$dir" ]; then
15 | echo Please specify a directory to convert.
16 | exit 1
17 | fi
18 |
19 | if ! [ -d ${dir} ]; then
20 | echo Not a directory: $dir
21 | exit 1
22 | fi
23 |
24 | if [ $(stat --printf %i ${dir}) = 256 ]; then
25 | echo Path is already a subvolume.
26 | exit 10
27 | fi
28 |
29 | echo
30 | echo Convert \"$dir\" to a Btrfs subvolume
31 | read -p "ARE YOU SURE? (Y/N): " ans
32 | case $ans in
33 | [Yy] ) echo Starting... ;;
34 | * ) exit 1;;
35 | esac
36 |
37 | tsuffix=$(date +%s)
38 | btrfs subvolume create "$dir"-$tsuffix
39 | shopt -s dotglob
40 | mv -v "$dir"/* "$dir"-$tsuffix
41 | rmdir "$dir"
42 | echo
43 | mv -vT "$dir"-$tsuffix "$dir"
44 |
45 | echo Done.
46 |
--------------------------------------------------------------------------------
/pubkey:
--------------------------------------------------------------------------------
1 | -----BEGIN PGP PUBLIC KEY BLOCK-----
2 |
3 | mQINBFicZFsBEADQavdG0JDVd1yp/F2rMfEFuCTdiGwkjyANHepZHwSIvSJqTvQO
4 | kcDSqh+kRn6nbDWKO160BFiaamLoaT2HZs9BdKiLttVkaNfiyMxzrhUIE2xRRPZH
5 | lx0uMGgCOEF8fD8CJZMkuMcL+MGblbqVLpZ5ztdwyy6EchjG13Pj+J3a1i1uaCar
6 | xv4+5GgSKkLpPrAgcQOqrepiTSJFLh2/LDhTERB6UYb7r6oiPY4nzWJNm/lNi5M1
7 | X4bnEskN9+zYrdXA/xVV7INXbdbNJyB5nz7AkQbIPHuBK7VtvrZPbKS6joCQ2oLu
8 | U8r5sBqNW8qOJqj8B3/zDSf2tcZwHzXFka0qrQd31AYU7XU4rd7jmBrFOWU9PfI1
9 | YsGzSdmZXMW4zFY4u9g7gfILxJzVFHQukdka227N5QJw9fTOkQS5aarQw5/MTURA
10 | +tjcu1XfqDTy4WfvyMiivevmzCcrPu5mJgN6MRpqhs8ykd8CuJPRseDBfrkw/fgi
11 | 5QbD0Nn5S0LZpc3NPgkNQB7QEGQVhFIR3OfeEUHE3pypTHDStOwPEV/AOhLxlGqO
12 | CtoVMxwI98jQEPg8TufvrXTn8If6ySt1mYUYeZe7AQpzFvOXVyAKqJGCw/QpSx7R
13 | jx/3M6joEXOV++JiC0YsdNjS3S0RxeQ+60as/NNFlq2TlyvfxMjCyU3YqQARAQAB
14 | tCtDaHJpc3RvcGhlciBMYXByaXNlIDx0YXNrZXRAcHJvdG9ubWFpbC5jb20+iQJO
15 | BBMBCAA4FiEEvuIgxTVudkpz60qzHcTRBvB/GIYFAlicZFsCGwMFCwkIBwIGFQgJ
16 | CgsCBBYCAwECHgECF4AACgkQHcTRBvB/GIaYPg//fHcuzL7KFZl0DYNBxPGAtUO/
17 | 91Ov1FDgpbaMDfGTV1NI+OsbCQy+85jMhDTYCa0JY6AzMduAs03TuOyUoPAqMp4f
18 | sc0zBF9qlaWyhTGIBZyXhdRgOtW/tjAyGxUmDtvOiKsKh70bseuvKh9u2YIxRFMf
19 | gv/xQoSu5QBMtj1jfH2B0IIHBf4jDJdLsN2OzIaqRelh6e2ghxR4Yheyf7HWUoEy
20 | w7uxeD0/tkcgzsf0KWUdxh0k5ON8zVkJvW1/u2HDU8K9bowa+GSCkgBxuehvHbTJ
21 | OQ3vN/zXE3pgcE5wOjnHKChwbrk/4AXfN1vx7cnCE2/uGYD2VjGlygLHE04/7Gsv
22 | Ha7BtwPoRTZAV4QdDljtAOF2Ag8S+2mhC8Vye9Ksq3D2YdbYPti6liGFrz/ER/fG
23 | Ci12+/XcBa0Z5PhuSnOIjrTP4hjTPH6R3jcLuDa36FpAh9ys2eTDi8K91Pk+5bhi
24 | Qf4saEtJ2POCb1mWvFx1lkq/HuCZXh4ZrI3ypNTOn8jQ2zU09qkHTNJDWm+t1Q59
25 | XQ18Mmw6i95SkdRQvlUgiQPxnOoIhi8NVYyYqvF3DSi5TG8RsLzmetQuzgkAShUk
26 | mEgRoltKJBTq87uRsi3b3pQ3h5UMAT382l6BBzoevJXT7Tf5/oX57HJfo6yMOAeG
27 | opIop5AbXDURFTiXQXK0J0NocmlzdG9waGVyIExhcHJpc2UgPHRhc2tldEBwb3N0
28 | ZW8ubmV0PokCTgQTAQgAOBYhBL7iIMU1bnZKc+tKsx3E0QbwfxiGBQJaVwREAhsD
29 | BQsJCAcCBhUICQoLAgQWAgMBAh4BAheAAAoJEB3E0QbwfxiGCPEP+QHCv0ubVdEQ
30 | 0rhQ+glBSLV+XKqy24oHkM+3/Vi1bPflkkouiWwF10Trd2mERX9o0aaje+CwovRB
31 | xkg+LdPwsUn8QKxQILwHzWsqZCw7NoPId7fe2Dq1UOrwhZ/mjYE1mNL02qDkqKDM
32 | 9Pd0Hw4bXnSSIhXzsPRqs3fnQQ+CyEShZVTcbrJBSBbIL/9QEoVwyT81YsgJxyyd
33 | 9UIhcL7Bz8N/OvcyQ/K/sKwogYE34IvVtA1fx1+Y4WNDtKsiil5JrOJYYqz93Ett
34 | YmBlB1bSEsnc9Mn4oAB10r2FswN4tS3iAovgRzVEZMfEFb3BfRnSAoFqAqwLaWF8
35 | w1wSiU5vr3ydUaJsMq6AM5S12pVhDeHqm+3psugV5r7L2L2R8J9/f8Cy0k3L99OZ
36 | CdXT0pZCwjnr4yGRWhayD0UKZ2cGxELMhvU4AJqotReRMpROcaQ4I9LWXF4XPIOX
37 | U8nnBTnORJxGcsOFHrKrl2VCi98hBdZJl63KnWaGeQn3M9EVZ2PvXj5eU7mlqQRX
38 | /kGJbm3oXsHpKAg43t8cAy34Ed4Kudz1HxccM4XZZ/ZRNIudMwhTZkM4Crwy2WIr
39 | klEtyXcvT1wa9kFHJz6TpRjqyxq19Hy/Lz1o3+wysn4yEdovQOGdhNloNQyEIrki
40 | 4CWTleVBd12ZoDimF0Rdj5R6mC/XX20fuQINBFicZTsBEADhngV3g/PuB53xbdmP
41 | fk90KU7qxe8MhU4kJvpaOctJRaQjMWTHv2h1AeOnywrG1lEW/dkh/YtfpOoMoqUL
42 | qjq/AQ7LLc0KztDg3dt3GXeFbgDyjmVsmb4t0zX4/OwBBz8HqU1fyPOm1HInjaJM
43 | MPZI2mGjedW4vwF4gaSnJce91UyiZYS4guH398LpcrVdLE2vO58djR/VMTQ9oTfB
44 | LbUWQheCALRSIrGqaA2IO9rHN1rClBAOIP2jxm87Ne04jG83HyifdHAlqYWjYf0k
45 | +Ar1oAzz28Zzh2hU2rx4zBU5h6+igrTe8533X8PdDIf+Qykz1eSee4p73Px7xYBN
46 | HjTizbCcVhpnXvIplciV09liZWnG+96BxmPAMQq1veburvhEO75j254wDj1BnxRm
47 | GEf7u+qKs7Ty9JXoZyjKrnTQn7s2FrYiVmHb0HgfRwTtn1kKwSkihJNvoqHXRAVh
48 | 70xpKuRwT3hfqF6WefRzsnUC7sheXZogfnajv/a9EMadOvYWsFQy8eMwTkKCATsJ
49 | yQvUJkGoJlwtmp1CAxEWUzR1pvNQgEgAfEqiRubPc9YJDQWLTkSHrBDrGMgFtppu
50 | kyYUViHljUMWQ0GcGcac7dcw2h010v4OlJM/uXiF/adnvj06JpLWKI7CGY5HfcGU
51 | MOBAyPlNF13st6sFkbcDQHVHNwARAQABiQRsBBgBCAAgFiEEvuIgxTVudkpz60qz
52 | HcTRBvB/GIYFAlicZTsCGwICQAkQHcTRBvB/GIbBdCAEGQEIAB0WIQQFc9H2NBKv
53 | BDxHuMhEhWjIsoHJUgUCWJxlOwAKCRBEhWjIsoHJUoHsD/4h073UFPzgtiQtFQ4I
54 | pq0GQ6ui/eVyWVODcbxscOyTYvlXpbH4YRgyo7GchPTfF3beBFa8APaN+gdUcpoS
55 | shib08Yge0eN2NxiQaba8fpLOJrp6P6N8Mm6RKh5HaNZ4d+YvYgLnjji1mN6Huf1
56 | r6jbMNPrRE0mkRQtNMkE9gYoOL0lLRKL6zJbVfMsXD/AlOWhy0K36q2Q5Mj6TRWl
57 | vdYUQU438ZiSiJ/NiH8tkmVsGOjn/zq0pLi/SaeJs9xu5irfi/S0XNt/CNVheWBs
58 | m5bGDzjiIHNLjnQL8vQNQV3Y0LJ1BOXh2KYmrZxrVISECLkdTykF9LAR+RLAhfzR
59 | f0La8GBoYluopBmeKR+juNtYgENhTTa+FP8d04Dg81HdHWPMQG4kB91iYP47iAgj
60 | D2dE11ajwUF6l0mTIPeDpQdrp1uHnP9A2cfhA6nAbmdR7hUd+Kp/XL8eUVOxXgMu
61 | 4tRoEHzLwmjV3I5VK2Sdc0C8McS/AaCUVpB2Y2dQbWijgftHKBRCevq6C5VCM45k
62 | RfFTc8/EdMvKrh7qa3qy7dGdNpK3pj4UGRmve24Y/fUEPfylJTRbGz1CiNQGtd1x
63 | KuS1qiK9p5rDLMmLBSHgvisRUquIjC3JWwqE9ysZM1BFXnba3qmcOx2Lw4dniZsc
64 | w8afKuAwCwamg0QBykdrGHF3VXEOD/9IzTH8/9w8/rHu+wSuSbsUDtZHfqzSNCrc
65 | DMPQ9I+RQa9XU4IIQuo7Z6PutNJ/7GFIAqnej0pBx8uBKqzNb5/nt07l2F6d+p/4
66 | y/NhPV0D3P1QgDfF7MNhR/5OAZ7oONnWZEJyJIQoc5HDwZLYs1Plt6e6lFg41h+k
67 | J0Ci/2v6MpUJt/hJjCmyecSVRgrbXFHBFZm/iP+aCMDXPu5PYQVV4231BI3t1WGN
68 | EC4EEY/n551Hx2qKi024FThj+9os1wh8T0MMBYPI9h1pW/OQVWg1qT9o43uGoO6o
69 | r8SOGo8+W6RLtVFQL4AuL3IUh859eAq00u3oYlV9tLKsSV+om4Bcr/KSaixYHfEY
70 | mtq33PMxaMQ499g5PiTBd7XIZhAx0oczaQ91dAgL1/nZOInKjJPrbAvtHMLU7BrA
71 | 0xYVy4y1up8jORIKW8Jl4rNsPx38JyIYNAxIwUfWA+jwgat9odkeCZhKnokeaDPs
72 | PQvzfbFw4yBeHqzdIO44qx7VCU5cEHmaL8MYuweCal1GMtArUg0q/SqdnjVc9Xho
73 | jQEx8V+X6v0FT58woaPkbeHdxtzwnVIQ7UmYBQs4qLcqTq68Sn4YfXWD5xLUQ1iw
74 | paIn2Zt4YMmkA03U7Zs8s+xwujsyQrUk41GDqb8QSMVGkiLpM1oxnfc0UOHerSxf
75 | qYv65joHFQ==
76 | =EBIL
77 | -----END PGP PUBLIC KEY BLOCK-----
78 |
--------------------------------------------------------------------------------
/src/wyng.gpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tasket/wyng-backup/e9777b797cf458d2704f06e642712887aef67423/src/wyng.gpg
--------------------------------------------------------------------------------
/tests/lvm_setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | # lvm_setup.sh creates an LVM volume group 'lvmtest-vg' & thin pool 'pool1'
5 | # in a loop device.
6 |
7 | # needs root.
8 |
9 | # Usage: lvm_setup /path/to/loopfile/dir [--new]
10 |
11 | # make the loop device
12 | lvdir="$1"
13 | lvprefix=lvmtest
14 | mkdir -p $lvdir
15 | if [ "$1" = 'new' ]; then
16 | rm -f $lvdir/pv1
17 | truncate --size 150M $lvdir/pv1
18 | fi
19 | lodev=$(losetup --show -f $lvdir/pv1)
20 |
21 | # make new lvm thin pool
22 | if [ "$2" = '--new' ]; then
23 | pvcreate $lodev
24 | vgcreate ${lvprefix}-vg $lodev
25 | lvcreate -n ${lvprefix}-vg/pool1 -L 100M
26 | lvcreate -n ${lvprefix}-vg/pool1meta -L 8M
27 | lvconvert --type thin-pool --poolmetadata ${lvprefix}-vg/pool1meta ${lvprefix}-vg/pool1
28 | lvcreate -T -V 50M ${lvprefix}-vg/pool1 -n thin1
29 | #mkfs.ext4 /dev/vg1/thin1
30 | fi
31 |
32 | # add random data to 'thin1' volume
33 | #dd if=/dev/urandom of=/dev/${lvprefix}-vg/thin1 bs=1024 count=10000
34 |
--------------------------------------------------------------------------------