| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 | 
							- .\" Man page generated from reStructuredText.
 
- .
 
- .
 
- .nr rst2man-indent-level 0
 
- .
 
- .de1 rstReportMargin
 
- \\$1 \\n[an-margin]
 
- level \\n[rst2man-indent-level]
 
- level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
- -
 
- \\n[rst2man-indent0]
 
- \\n[rst2man-indent1]
 
- \\n[rst2man-indent2]
 
- ..
 
- .de1 INDENT
 
- .\" .rstReportMargin pre:
 
- . RS \\$1
 
- . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
 
- . nr rst2man-indent-level +1
 
- .\" .rstReportMargin post:
 
- ..
 
- .de UNINDENT
 
- . RE
 
- .\" indent \\n[an-margin]
 
- .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
- .nr rst2man-indent-level -1
 
- .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
- .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 
- ..
 
- .TH "BORG-REPO-CREATE" 1 "2024-11-16" "" "borg backup tool"
 
- .SH NAME
 
- borg-repo-create \- Create a new, empty repository
 
- .SH SYNOPSIS
 
- .sp
 
- borg [common options] repo\-create [options]
 
- .SH DESCRIPTION
 
- .sp
 
- This command creates a new, empty repository. A repository is a \fBborgstore\fP store
 
- containing the deduplicated data from zero or more archives.
 
- .sp
 
- Repository creation can be quite slow for some kinds of stores (e.g. for \fBsftp:\fP) \-
 
- this is due to borgstore pre\-creating all directories needed, making usage of the
 
- store faster.
 
- .SS Encryption mode TLDR
 
- .sp
 
- The encryption mode can only be configured when creating a new repository \- you can
 
- neither configure it on a per\-archive basis nor change the mode of an existing repository.
 
- This example will likely NOT give optimum performance on your machine (performance
 
- tips will come below):
 
- .INDENT 0.0
 
- .INDENT 3.5
 
- .sp
 
- .nf
 
- .ft C
 
- borg repo\-create \-\-encryption repokey\-aes\-ocb
 
- .ft P
 
- .fi
 
- .UNINDENT
 
- .UNINDENT
 
- .sp
 
- Borg will:
 
- .INDENT 0.0
 
- .IP 1. 3
 
- Ask you to come up with a passphrase.
 
- .IP 2. 3
 
- Create a borg key (which contains some random secrets. See \fIkey_files\fP).
 
- .IP 3. 3
 
- Derive a \(dqkey encryption key\(dq from your passphrase
 
- .IP 4. 3
 
- Encrypt and sign the key with the key encryption key
 
- .IP 5. 3
 
- Store the encrypted borg key inside the repository directory (in the repo config).
 
- This is why it is essential to use a secure passphrase.
 
- .IP 6. 3
 
- Encrypt and sign your backups to prevent anyone from reading or forging them unless they
 
- have the key and know the passphrase. Make sure to keep a backup of
 
- your key \fBoutside\fP the repository \- do not lock yourself out by
 
- \(dqleaving your keys inside your car\(dq (see \fIborg_key_export\fP).
 
- The encryption is done locally \- if you use a remote repository, the remote machine
 
- never sees your passphrase, your unencrypted key or your unencrypted files.
 
- Chunking and id generation are also based on your key to improve
 
- your privacy.
 
- .IP 7. 3
 
- Use the key when extracting files to decrypt them and to verify that the contents of
 
- the backups have not been accidentally or maliciously altered.
 
- .UNINDENT
 
- .SS Picking a passphrase
 
- .sp
 
- Make sure you use a good passphrase. Not too short, not too simple. The real
 
- encryption / decryption key is encrypted with / locked by your passphrase.
 
- If an attacker gets your key, he can\(aqt unlock and use it without knowing the
 
- passphrase.
 
- .sp
 
- Be careful with special or non\-ascii characters in your passphrase:
 
- .INDENT 0.0
 
- .IP \(bu 2
 
- Borg processes the passphrase as unicode (and encodes it as utf\-8),
 
- so it does not have problems dealing with even the strangest characters.
 
- .IP \(bu 2
 
- BUT: that does not necessarily apply to your OS / VM / keyboard configuration.
 
- .UNINDENT
 
- .sp
 
- So better use a long passphrase made from simple ascii chars than one that
 
- includes non\-ascii stuff or characters that are hard/impossible to enter on
 
- a different keyboard layout.
 
- .sp
 
- You can change your passphrase for existing repos at any time, it won\(aqt affect
 
- the encryption/decryption key or other secrets.
 
- .SS Choosing an encryption mode
 
- .sp
 
- Depending on your hardware, hashing and crypto performance may vary widely.
 
- The easiest way to find out about what\(aqs fastest is to run \fBborg benchmark cpu\fP\&.
 
- .sp
 
- \fIrepokey\fP modes: if you want ease\-of\-use and \(dqpassphrase\(dq security is good enough \-
 
- the key will be stored in the repository (in \fBrepo_dir/config\fP).
 
- .sp
 
- \fIkeyfile\fP modes: if you want \(dqpassphrase and having\-the\-key\(dq security \-
 
- the key will be stored in your home directory (in \fB~/.config/borg/keys\fP).
 
- .sp
 
- The following table is roughly sorted in order of preference, the better ones are
 
- in the upper part of the table, in the lower part is the old and/or unsafe(r) stuff:
 
- .\" nanorst: inline-fill
 
- .
 
- .TS
 
- center;
 
- |l|l|l|l|.
 
- _
 
- T{
 
- Mode (K = keyfile or repokey)
 
- T}	T{
 
- ID\-Hash
 
- T}	T{
 
- Encryption
 
- T}	T{
 
- Authentication
 
- T}
 
- _
 
- T{
 
- K\-blake2\-chacha20\-poly1305
 
- T}	T{
 
- BLAKE2b
 
- T}	T{
 
- CHACHA20
 
- T}	T{
 
- POLY1305
 
- T}
 
- _
 
- T{
 
- K\-chacha20\-poly1305
 
- T}	T{
 
- HMAC\-SHA\-256
 
- T}	T{
 
- CHACHA20
 
- T}	T{
 
- POLY1305
 
- T}
 
- _
 
- T{
 
- K\-blake2\-aes\-ocb
 
- T}	T{
 
- BLAKE2b
 
- T}	T{
 
- AES256\-OCB
 
- T}	T{
 
- AES256\-OCB
 
- T}
 
- _
 
- T{
 
- K\-aes\-ocb
 
- T}	T{
 
- HMAC\-SHA\-256
 
- T}	T{
 
- AES256\-OCB
 
- T}	T{
 
- AES256\-OCB
 
- T}
 
- _
 
- T{
 
- authenticated\-blake2
 
- T}	T{
 
- BLAKE2b
 
- T}	T{
 
- none
 
- T}	T{
 
- BLAKE2b
 
- T}
 
- _
 
- T{
 
- authenticated
 
- T}	T{
 
- HMAC\-SHA\-256
 
- T}	T{
 
- none
 
- T}	T{
 
- HMAC\-SHA256
 
- T}
 
- _
 
- T{
 
- none
 
- T}	T{
 
- SHA\-256
 
- T}	T{
 
- none
 
- T}	T{
 
- none
 
- T}
 
- _
 
- .TE
 
- .\" nanorst: inline-replace
 
- .
 
- .sp
 
- \fInone\fP mode uses no encryption and no authentication. You\(aqre advised NOT to use this mode
 
- as it would expose you to all sorts of issues (DoS, confidentiality, tampering, ...) in
 
- case of malicious activity in the repository.
 
- .sp
 
- If you do \fBnot\fP want to encrypt the contents of your backups, but still want to detect
 
- malicious tampering use an \fIauthenticated\fP mode. It\(aqs like \fIrepokey\fP minus encryption.
 
- To normally work with \fBauthenticated\fP repos, you will need the passphrase, but
 
- there is an emergency workaround, see \fBBORG_WORKAROUNDS=authenticated_no_key\fP docs.
 
- .SS Creating a related repository
 
- .sp
 
- You can use \fBborg repo\-create \-\-other\-repo ORIG_REPO ...\fP to create a related repository
 
- that uses the same secret key material as the given other/original repository.
 
- .sp
 
- By default, only the ID key and chunker secret will be the same (these are important
 
- for deduplication) and the AE crypto keys will be newly generated random keys.
 
- .sp
 
- Optionally, if you use \fB\-\-copy\-crypt\-key\fP you can also keep the same crypt_key
 
- (used for authenticated encryption). Might be desired e.g. if you want to have less
 
- keys to manage.
 
- .sp
 
- Creating related repositories is useful e.g. if you want to use \fBborg transfer\fP later.
 
- .SS Creating a related repository for data migration from borg 1.2 or 1.4
 
- .sp
 
- You can use \fBborg repo\-create \-\-other\-repo ORIG_REPO \-\-from\-borg1 ...\fP to create a related
 
- repository that uses the same secret key material as the given other/original repository.
 
- .sp
 
- Then use \fBborg transfer \-\-other\-repo ORIG_REPO \-\-from\-borg1 ...\fP to transfer the archives.
 
- .SH OPTIONS
 
- .sp
 
- See \fIborg\-common(1)\fP for common options of Borg commands.
 
- .SS optional arguments
 
- .INDENT 0.0
 
- .TP
 
- .BI \-\-other\-repo \ SRC_REPOSITORY
 
- reuse the key material from the other repository
 
- .TP
 
- .B  \-\-from\-borg1
 
- other repository is borg 1.x
 
- .TP
 
- .BI \-e \ MODE\fR,\fB \ \-\-encryption \ MODE
 
- select encryption key mode \fB(required)\fP
 
- .TP
 
- .B  \-\-append\-only
 
- 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.
 
- .TP
 
- .BI \-\-storage\-quota \ QUOTA
 
- Set storage quota of the new repository (e.g. 5G, 1.5T). Default: no quota.
 
- .TP
 
- .B  \-\-make\-parent\-dirs
 
- create the parent directories of the repository directory, if they are missing.
 
- .TP
 
- .B  \-\-copy\-crypt\-key
 
- copy the crypt_key (used for authenticated encryption) from the key of the other repo (default: new random key).
 
- .UNINDENT
 
- .SH EXAMPLES
 
- .INDENT 0.0
 
- .INDENT 3.5
 
- .sp
 
- .nf
 
- .ft C
 
- # Local repository
 
- $ export BORG_REPO=/path/to/repo
 
- # recommended repokey AEAD crypto modes
 
- $ borg repo\-create \-\-encryption=repokey\-aes\-ocb
 
- $ borg repo\-create \-\-encryption=repokey\-chacha20\-poly1305
 
- $ borg repo\-create \-\-encryption=repokey\-blake2\-aes\-ocb
 
- $ borg repo\-create \-\-encryption=repokey\-blake2\-chacha20\-poly1305
 
- # no encryption, not recommended
 
- $ borg repo\-create \-\-encryption=authenticated
 
- $ borg repo\-create \-\-encryption=authenticated\-blake2
 
- $ borg repo\-create \-\-encryption=none
 
- # Remote repository (accesses a remote borg via ssh)
 
- $ export BORG_REPO=ssh://user@hostname/~/backup
 
- # repokey: stores the (encrypted) key into <REPO_DIR>/config
 
- $ borg repo\-create \-\-encryption=repokey\-aes\-ocb
 
- # keyfile: stores the (encrypted) key into ~/.config/borg/keys/
 
- $ borg repo\-create \-\-encryption=keyfile\-aes\-ocb
 
- .ft P
 
- .fi
 
- .UNINDENT
 
- .UNINDENT
 
- .SH SEE ALSO
 
- .sp
 
- \fIborg\-common(1)\fP, \fIborg\-repo\-delete(1)\fP, \fIborg\-repo\-list(1)\fP, \fIborg\-check(1)\fP, \fIborg\-benchmark\-cpu(1)\fP, \fIborg\-key\-import(1)\fP, \fIborg\-key\-export(1)\fP, \fIborg\-key\-change\-passphrase(1)\fP
 
- .SH AUTHOR
 
- The Borg Collective
 
- .\" Generated by docutils manpage writer.
 
- .
 
 
  |