init.rst.inc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_init:
  3. borg init
  4. ---------
  5. .. code-block:: none
  6. borg [common options] init [options] [REPOSITORY]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``REPOSITORY`` | repository to create |
  13. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | **optional arguments** |
  15. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | | ``-e MODE``, ``--encryption MODE`` | select encryption key mode **(required)** |
  17. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--append-only`` | create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details. |
  19. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``--storage-quota QUOTA`` | Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota. |
  21. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``--make-parent-dirs`` | create the parent directories of the repository directory, if they are missing. |
  23. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | .. class:: borg-common-opt-ref |
  25. | |
  26. | :ref:`common_options` |
  27. +-------------------------------------------------------+------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. .. raw:: html
  29. <script type='text/javascript'>
  30. $(document).ready(function () {
  31. $('.borg-options-table colgroup').remove();
  32. })
  33. </script>
  34. .. only:: latex
  35. REPOSITORY
  36. repository to create
  37. optional arguments
  38. -e MODE, --encryption MODE select encryption key mode **(required)**
  39. --append-only create an append-only mode repository. Note that this only affects the low level structure of the repository, and running `delete` or `prune` will still be allowed. See :ref:`append_only_mode` in Additional Notes for more details.
  40. --storage-quota QUOTA Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
  41. --make-parent-dirs create the parent directories of the repository directory, if they are missing.
  42. :ref:`common_options`
  43. |
  44. Description
  45. ~~~~~~~~~~~
  46. This command initializes an empty repository. A repository is a filesystem
  47. directory containing the deduplicated data from zero or more archives.
  48. Encryption can be enabled at repository init time. It cannot be changed later.
  49. It is not recommended to work without encryption. Repository encryption protects
  50. you e.g. against the case that an attacker has access to your backup repository.
  51. But be careful with the key / the passphrase:
  52. If you want "passphrase-only" security, use one of the repokey modes. The
  53. key will be stored inside the repository (in its "config" file). In above
  54. mentioned attack scenario, the attacker will have the key (but not the
  55. passphrase).
  56. If you want "passphrase and having-the-key" security, use one of the keyfile
  57. modes. The key will be stored in your home directory (in .config/borg/keys).
  58. In the attack scenario, the attacker who has just access to your repo won't
  59. have the key (and also not the passphrase).
  60. Make a backup copy of the key file (keyfile mode) or repo config file
  61. (repokey mode) and keep it at a safe place, so you still have the key in
  62. case it gets corrupted or lost. Also keep the passphrase at a safe place.
  63. The backup that is encrypted with that key won't help you with that, of course.
  64. Make sure you use a good passphrase. Not too short, not too simple. The real
  65. encryption / decryption key is encrypted with / locked by your passphrase.
  66. If an attacker gets your key, he can't unlock and use it without knowing the
  67. passphrase.
  68. Be careful with special or non-ascii characters in your passphrase:
  69. - Borg processes the passphrase as unicode (and encodes it as utf-8),
  70. so it does not have problems dealing with even the strangest characters.
  71. - BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
  72. So better use a long passphrase made from simple ascii chars than one that
  73. includes non-ascii stuff or characters that are hard/impossible to enter on
  74. a different keyboard layout.
  75. You can change your passphrase for existing repos at any time, it won't affect
  76. the encryption/decryption key or other secrets.
  77. Encryption modes
  78. ++++++++++++++++
  79. .. nanorst: inline-fill
  80. +----------+---------------+------------------------+--------------------------+
  81. | Hash/MAC | Not encrypted | Not encrypted, | Encrypted (AEAD w/ AES) |
  82. | | no auth | but authenticated | and authenticated |
  83. +----------+---------------+------------------------+--------------------------+
  84. | SHA-256 | none | `authenticated` | repokey |
  85. | | | | keyfile |
  86. +----------+---------------+------------------------+--------------------------+
  87. | BLAKE2b | n/a | `authenticated-blake2` | `repokey-blake2` |
  88. | | | | `keyfile-blake2` |
  89. +----------+---------------+------------------------+--------------------------+
  90. .. nanorst: inline-replace
  91. `Marked modes` are new in Borg 1.1 and are not backwards-compatible with Borg 1.0.x.
  92. On modern Intel/AMD CPUs (except very cheap ones), AES is usually
  93. hardware-accelerated.
  94. BLAKE2b is faster than SHA256 on Intel/AMD 64-bit CPUs
  95. (except AMD Ryzen and future CPUs with SHA extensions),
  96. which makes `authenticated-blake2` faster than `none` and `authenticated`.
  97. On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster
  98. than BLAKE2b-256 there. NEON accelerates AES as well.
  99. Hardware acceleration is always used automatically when available.
  100. `repokey` and `keyfile` use AES-CTR-256 for encryption and HMAC-SHA256 for
  101. authentication in an encrypt-then-MAC (EtM) construction. The chunk ID hash
  102. is HMAC-SHA256 as well (with a separate key).
  103. These modes are compatible with Borg 1.0.x.
  104. `repokey-blake2` and `keyfile-blake2` are also authenticated encryption modes,
  105. but use BLAKE2b-256 instead of HMAC-SHA256 for authentication. The chunk ID
  106. hash is a keyed BLAKE2b-256 hash.
  107. These modes are new and *not* compatible with Borg 1.0.x.
  108. `authenticated` mode uses no encryption, but authenticates repository contents
  109. through the same HMAC-SHA256 hash as the `repokey` and `keyfile` modes (it uses it
  110. as the chunk ID hash). The key is stored like `repokey`.
  111. This mode is new and *not* compatible with Borg 1.0.x.
  112. `authenticated-blake2` is like `authenticated`, but uses the keyed BLAKE2b-256 hash
  113. from the other blake2 modes.
  114. This mode is new and *not* compatible with Borg 1.0.x.
  115. `none` mode uses no encryption and no authentication. It uses SHA256 as chunk
  116. ID hash. Not recommended, rather consider using an authenticated or
  117. authenticated/encrypted mode. This mode has possible denial-of-service issues
  118. when running ``borg create`` on contents controlled by an attacker.
  119. Use it only for new repositories where no encryption is wanted **and** when compatibility
  120. with 1.0.x is important. If compatibility with 1.0.x is not important, use
  121. `authenticated-blake2` or `authenticated` instead.
  122. This mode is compatible with Borg 1.0.x.