borg-init.1 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH BORG-INIT 1 "2021-05-11" "" "borg backup tool"
  4. .SH NAME
  5. borg-init \- Initialize an empty repository
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH SYNOPSIS
  34. .sp
  35. borg [common options] init [options] [REPOSITORY]
  36. .SH DESCRIPTION
  37. .sp
  38. This command initializes an empty repository. A repository is a filesystem
  39. directory containing the deduplicated data from zero or more archives.
  40. .sp
  41. Encryption can be enabled at repository init time. It cannot be changed later.
  42. .sp
  43. It is not recommended to work without encryption. Repository encryption protects
  44. you e.g. against the case that an attacker has access to your backup repository.
  45. .sp
  46. Borg relies on randomly generated key material and uses that for chunking, id
  47. generation, encryption and authentication. The key material is encrypted using
  48. the passphrase you give before it is stored on\-disk.
  49. .sp
  50. You need to be careful with the key / the passphrase:
  51. .sp
  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. .sp
  57. If you want "passphrase and having\-the\-key" security, use one of the keyfile
  58. modes. The key will be stored in your home directory (in .config/borg/keys).
  59. In the attack scenario, the attacker who has just access to your repo won\(aqt
  60. have the key (and also not the passphrase).
  61. .sp
  62. Make a backup copy of the key file (keyfile mode) or repo config file
  63. (repokey mode) and keep it at a safe place, so you still have the key in
  64. case it gets corrupted or lost. Also keep the passphrase at a safe place.
  65. The backup that is encrypted with that key won\(aqt help you with that, of course.
  66. .sp
  67. Make sure you use a good passphrase. Not too short, not too simple. The real
  68. encryption / decryption key is encrypted with / locked by your passphrase.
  69. If an attacker gets your key, he can\(aqt unlock and use it without knowing the
  70. passphrase.
  71. .sp
  72. Be careful with special or non\-ascii characters in your passphrase:
  73. .INDENT 0.0
  74. .IP \(bu 2
  75. Borg processes the passphrase as unicode (and encodes it as utf\-8),
  76. so it does not have problems dealing with even the strangest characters.
  77. .IP \(bu 2
  78. BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
  79. .UNINDENT
  80. .sp
  81. So better use a long passphrase made from simple ascii chars than one that
  82. includes non\-ascii stuff or characters that are hard/impossible to enter on
  83. a different keyboard layout.
  84. .sp
  85. You can change your passphrase for existing repos at any time, it won\(aqt affect
  86. the encryption/decryption key or other secrets.
  87. .SS Encryption modes
  88. .sp
  89. You can choose from the encryption modes seen in the table below on a per\-repo
  90. basis. The mode determines encryption algorithm, hash/MAC algorithm and also the
  91. key storage location.
  92. .sp
  93. Example: \fIborg init \-\-encryption repokey ...\fP
  94. .\" nanorst: inline-fill
  95. .
  96. .TS
  97. center;
  98. |l|l|l|l|.
  99. _
  100. T{
  101. Hash/MAC
  102. T} T{
  103. Not encrypted
  104. no auth
  105. T} T{
  106. Not encrypted,
  107. but authenticated
  108. T} T{
  109. Encrypted (AEAD w/ AES)
  110. and authenticated
  111. T}
  112. _
  113. T{
  114. SHA\-256
  115. T} T{
  116. none
  117. T} T{
  118. \fIauthenticated\fP
  119. T} T{
  120. repokey
  121. keyfile
  122. T}
  123. _
  124. T{
  125. BLAKE2b
  126. T} T{
  127. n/a
  128. T} T{
  129. \fIauthenticated\-blake2\fP
  130. T} T{
  131. \fIrepokey\-blake2\fP
  132. \fIkeyfile\-blake2\fP
  133. T}
  134. _
  135. .TE
  136. .\" nanorst: inline-replace
  137. .
  138. .sp
  139. Modes \fImarked like this\fP in the above table are new in Borg 1.1 and are not
  140. backwards\-compatible with Borg 1.0.x.
  141. .sp
  142. On modern Intel/AMD CPUs (except very cheap ones), AES is usually
  143. hardware\-accelerated.
  144. BLAKE2b is faster than SHA256 on Intel/AMD 64\-bit CPUs
  145. (except AMD Ryzen and future CPUs with SHA extensions),
  146. which makes \fIauthenticated\-blake2\fP faster than \fInone\fP and \fIauthenticated\fP\&.
  147. .sp
  148. On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster
  149. than BLAKE2b\-256 there. NEON accelerates AES as well.
  150. .sp
  151. Hardware acceleration is always used automatically when available.
  152. .sp
  153. \fIrepokey\fP and \fIkeyfile\fP use AES\-CTR\-256 for encryption and HMAC\-SHA256 for
  154. authentication in an encrypt\-then\-MAC (EtM) construction. The chunk ID hash
  155. is HMAC\-SHA256 as well (with a separate key).
  156. These modes are compatible with Borg 1.0.x.
  157. .sp
  158. \fIrepokey\-blake2\fP and \fIkeyfile\-blake2\fP are also authenticated encryption modes,
  159. but use BLAKE2b\-256 instead of HMAC\-SHA256 for authentication. The chunk ID
  160. hash is a keyed BLAKE2b\-256 hash.
  161. These modes are new and \fInot\fP compatible with Borg 1.0.x.
  162. .sp
  163. \fIauthenticated\fP mode uses no encryption, but authenticates repository contents
  164. through the same HMAC\-SHA256 hash as the \fIrepokey\fP and \fIkeyfile\fP modes (it uses it
  165. as the chunk ID hash). The key is stored like \fIrepokey\fP\&.
  166. This mode is new and \fInot\fP compatible with Borg 1.0.x.
  167. .sp
  168. \fIauthenticated\-blake2\fP is like \fIauthenticated\fP, but uses the keyed BLAKE2b\-256 hash
  169. from the other blake2 modes.
  170. This mode is new and \fInot\fP compatible with Borg 1.0.x.
  171. .sp
  172. \fInone\fP mode uses no encryption and no authentication. It uses SHA256 as chunk
  173. ID hash. This mode is not recommended, you should rather consider using an authenticated
  174. or authenticated/encrypted mode. This mode has possible denial\-of\-service issues
  175. when running \fBborg create\fP on contents controlled by an attacker.
  176. Use it only for new repositories where no encryption is wanted \fBand\fP when compatibility
  177. with 1.0.x is important. If compatibility with 1.0.x is not important, use
  178. \fIauthenticated\-blake2\fP or \fIauthenticated\fP instead.
  179. This mode is compatible with Borg 1.0.x.
  180. .SH OPTIONS
  181. .sp
  182. See \fIborg\-common(1)\fP for common options of Borg commands.
  183. .SS arguments
  184. .INDENT 0.0
  185. .TP
  186. .B REPOSITORY
  187. repository to create
  188. .UNINDENT
  189. .SS optional arguments
  190. .INDENT 0.0
  191. .TP
  192. .BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE
  193. select encryption key mode \fB(required)\fP
  194. .TP
  195. .B \-\-append\-only
  196. create an append\-only mode repository. Note that this only affects the low level structure of the repository, and running \fIdelete\fP or \fIprune\fP will still be allowed. See \fIappend_only_mode\fP in Additional Notes for more details.
  197. .TP
  198. .BI \-\-storage\-quota \ QUOTA
  199. Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
  200. .TP
  201. .B \-\-make\-parent\-dirs
  202. create the parent directories of the repository directory, if they are missing.
  203. .UNINDENT
  204. .SH EXAMPLES
  205. .INDENT 0.0
  206. .INDENT 3.5
  207. .sp
  208. .nf
  209. .ft C
  210. # Local repository, repokey encryption, BLAKE2b (often faster, since Borg 1.1)
  211. $ borg init \-\-encryption=repokey\-blake2 /path/to/repo
  212. # Local repository (no encryption)
  213. $ borg init \-\-encryption=none /path/to/repo
  214. # Remote repository (accesses a remote borg via ssh)
  215. # repokey: stores the (encrypted) key into <REPO_DIR>/config
  216. $ borg init \-\-encryption=repokey\-blake2 user@hostname:backup
  217. # Remote repository (accesses a remote borg via ssh)
  218. # keyfile: stores the (encrypted) key into ~/.config/borg/keys/
  219. $ borg init \-\-encryption=keyfile user@hostname:backup
  220. .ft P
  221. .fi
  222. .UNINDENT
  223. .UNINDENT
  224. .SH SEE ALSO
  225. .sp
  226. \fIborg\-common(1)\fP, \fIborg\-create(1)\fP, \fIborg\-delete(1)\fP, \fIborg\-check(1)\fP, \fIborg\-list(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP
  227. .SH AUTHOR
  228. The Borg Collective
  229. .\" Generated by docutils manpage writer.
  230. .