borg-init.1 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH BORG-INIT 1 "2019-02-24" "" "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. But be careful with the key / the passphrase:
  47. .sp
  48. If you want "passphrase\-only" security, use one of the repokey modes. The
  49. key will be stored inside the repository (in its "config" file). In above
  50. mentioned attack scenario, the attacker will have the key (but not the
  51. passphrase).
  52. .sp
  53. If you want "passphrase and having\-the\-key" security, use one of the keyfile
  54. modes. The key will be stored in your home directory (in .config/borg/keys).
  55. In the attack scenario, the attacker who has just access to your repo won\(aqt
  56. have the key (and also not the passphrase).
  57. .sp
  58. Make a backup copy of the key file (keyfile mode) or repo config file
  59. (repokey mode) and keep it at a safe place, so you still have the key in
  60. case it gets corrupted or lost. Also keep the passphrase at a safe place.
  61. The backup that is encrypted with that key won\(aqt help you with that, of course.
  62. .sp
  63. Make sure you use a good passphrase. Not too short, not too simple. The real
  64. encryption / decryption key is encrypted with / locked by your passphrase.
  65. If an attacker gets your key, he can\(aqt unlock and use it without knowing the
  66. passphrase.
  67. .sp
  68. Be careful with special or non\-ascii characters in your passphrase:
  69. .INDENT 0.0
  70. .IP \(bu 2
  71. Borg processes the passphrase as unicode (and encodes it as utf\-8),
  72. so it does not have problems dealing with even the strangest characters.
  73. .IP \(bu 2
  74. BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
  75. .UNINDENT
  76. .sp
  77. So better use a long passphrase made from simple ascii chars than one that
  78. includes non\-ascii stuff or characters that are hard/impossible to enter on
  79. a different keyboard layout.
  80. .sp
  81. You can change your passphrase for existing repos at any time, it won\(aqt affect
  82. the encryption/decryption key or other secrets.
  83. .SS Encryption modes
  84. .\" nanorst: inline-fill
  85. .
  86. .TS
  87. center;
  88. |l|l|l|l|.
  89. _
  90. T{
  91. Hash/MAC
  92. T} T{
  93. Not encrypted
  94. no auth
  95. T} T{
  96. Not encrypted,
  97. but authenticated
  98. T} T{
  99. Encrypted (AEAD w/ AES)
  100. and authenticated
  101. T}
  102. _
  103. T{
  104. SHA\-256
  105. T} T{
  106. none
  107. T} T{
  108. \fIauthenticated\fP
  109. T} T{
  110. repokey
  111. keyfile
  112. T}
  113. _
  114. T{
  115. BLAKE2b
  116. T} T{
  117. n/a
  118. T} T{
  119. \fIauthenticated\-blake2\fP
  120. T} T{
  121. \fIrepokey\-blake2\fP
  122. \fIkeyfile\-blake2\fP
  123. T}
  124. _
  125. .TE
  126. .\" nanorst: inline-replace
  127. .
  128. .sp
  129. \fIMarked modes\fP are new in Borg 1.1 and are not backwards\-compatible with Borg 1.0.x.
  130. .sp
  131. On modern Intel/AMD CPUs (except very cheap ones), AES is usually
  132. hardware\-accelerated.
  133. BLAKE2b is faster than SHA256 on Intel/AMD 64\-bit CPUs
  134. (except AMD Ryzen and future CPUs with SHA extensions),
  135. which makes \fIauthenticated\-blake2\fP faster than \fInone\fP and \fIauthenticated\fP\&.
  136. .sp
  137. On modern ARM CPUs, NEON provides hardware acceleration for SHA256 making it faster
  138. than BLAKE2b\-256 there. NEON accelerates AES as well.
  139. .sp
  140. Hardware acceleration is always used automatically when available.
  141. .sp
  142. \fIrepokey\fP and \fIkeyfile\fP use AES\-CTR\-256 for encryption and HMAC\-SHA256 for
  143. authentication in an encrypt\-then\-MAC (EtM) construction. The chunk ID hash
  144. is HMAC\-SHA256 as well (with a separate key).
  145. These modes are compatible with Borg 1.0.x.
  146. .sp
  147. \fIrepokey\-blake2\fP and \fIkeyfile\-blake2\fP are also authenticated encryption modes,
  148. but use BLAKE2b\-256 instead of HMAC\-SHA256 for authentication. The chunk ID
  149. hash is a keyed BLAKE2b\-256 hash.
  150. These modes are new and \fInot\fP compatible with Borg 1.0.x.
  151. .sp
  152. \fIauthenticated\fP mode uses no encryption, but authenticates repository contents
  153. through the same HMAC\-SHA256 hash as the \fIrepokey\fP and \fIkeyfile\fP modes (it uses it
  154. as the chunk ID hash). The key is stored like \fIrepokey\fP\&.
  155. This mode is new and \fInot\fP compatible with Borg 1.0.x.
  156. .sp
  157. \fIauthenticated\-blake2\fP is like \fIauthenticated\fP, but uses the keyed BLAKE2b\-256 hash
  158. from the other blake2 modes.
  159. This mode is new and \fInot\fP compatible with Borg 1.0.x.
  160. .sp
  161. \fInone\fP mode uses no encryption and no authentication. It uses SHA256 as chunk
  162. ID hash. Not recommended, rather consider using an authenticated or
  163. authenticated/encrypted mode. This mode has possible denial\-of\-service issues
  164. when running \fBborg create\fP on contents controlled by an attacker.
  165. Use it only for new repositories where no encryption is wanted \fBand\fP when compatibility
  166. with 1.0.x is important. If compatibility with 1.0.x is not important, use
  167. \fIauthenticated\-blake2\fP or \fIauthenticated\fP instead.
  168. This mode is compatible with Borg 1.0.x.
  169. .SH OPTIONS
  170. .sp
  171. See \fIborg\-common(1)\fP for common options of Borg commands.
  172. .SS arguments
  173. .INDENT 0.0
  174. .TP
  175. .B REPOSITORY
  176. repository to create
  177. .UNINDENT
  178. .SS optional arguments
  179. .INDENT 0.0
  180. .TP
  181. .BI \-e \ MODE\fP,\fB \ \-\-encryption \ MODE
  182. select encryption key mode \fB(required)\fP
  183. .TP
  184. .B \-\-append\-only
  185. 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.
  186. .TP
  187. .BI \-\-storage\-quota \ QUOTA
  188. Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
  189. .TP
  190. .B \-\-make\-parent\-dirs
  191. create the parent directories of the repository directory, if they are missing.
  192. .UNINDENT
  193. .SH EXAMPLES
  194. .INDENT 0.0
  195. .INDENT 3.5
  196. .sp
  197. .nf
  198. .ft C
  199. # Local repository, repokey encryption, BLAKE2b (often faster, since Borg 1.1)
  200. $ borg init \-\-encryption=repokey\-blake2 /path/to/repo
  201. # Local repository (no encryption)
  202. $ borg init \-\-encryption=none /path/to/repo
  203. # Remote repository (accesses a remote borg via ssh)
  204. $ borg init \-\-encryption=repokey\-blake2 user@hostname:backup
  205. # Remote repository (store the key your home dir)
  206. $ borg init \-\-encryption=keyfile user@hostname:backup
  207. .ft P
  208. .fi
  209. .UNINDENT
  210. .UNINDENT
  211. .SH SEE ALSO
  212. .sp
  213. \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
  214. .SH AUTHOR
  215. The Borg Collective
  216. .\" Generated by docutils manpage writer.
  217. .