mirror of
https://github.com/borgbackup/borg.git
synced 2026-10-12 02:11:36 +00:00
276 lines
12 KiB
Groff
276 lines
12 KiB
Groff
.\" Man page generated from reStructuredText
|
|
.\" by the Docutils 0.22.4 manpage writer.
|
|
.
|
|
.
|
|
.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" "2026-09-27" "" "borg backup tool"
|
|
.SH Name
|
|
borg-repo-create \- Creates 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 TL;DR
|
|
.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
|
|
.EX
|
|
borg repo\-create \-\-encryption aes256\-ocb \-\-key\-location repokey
|
|
.EE
|
|
.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 in the repository (as an object in the \fBkeys/\fP
|
|
namespace of the store). 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, they cannot 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 characters than one that
|
|
includes non\-ASCII stuff or characters that are hard or impossible to enter on
|
|
a different keyboard layout.
|
|
.sp
|
|
You can change your passphrase for existing repositories at any time; it will not affect
|
|
the encryption/decryption key or other secrets.
|
|
.sp
|
|
Borg also accepts an empty passphrase. The repository is still encrypted with a random
|
|
key then, but that key is not protected: with \fBrepokey\fP storage, anybody who can read
|
|
the repository can also unlock the key, which is as good as no encryption at all (with
|
|
\fBkeyfile\fP storage, the key is only on your client, so an empty passphrase may be
|
|
acceptable if e.g. the client\(aqs disk is encrypted). You can add a passphrase later with
|
|
\fBborg key change\-passphrase\fP\&. \fBborg repo\-info\fP shows whether the key has an empty
|
|
passphrase.
|
|
.SS Choosing a crypto suite
|
|
.sp
|
|
Depending on your hardware, hashing and crypto performance may vary widely.
|
|
The easiest way to find out what is fastest is to run \fBborg benchmark cpu\fP\&.
|
|
.sp
|
|
\fB\-\-encryption\fP (\fBrequired\fP) selects the mode:
|
|
.INDENT 0.0
|
|
.IP \(bu 2
|
|
\fBaes256\-ocb\fP: AES256 in OCB mode (encryption + authentication).
|
|
.IP \(bu 2
|
|
\fBchacha20\-poly1305\fP: ChaCha20 + Poly1305 (encryption + authentication).
|
|
.IP \(bu 2
|
|
\fBauthenticated\-sha256\fP / \fBauthenticated\-blake3\fP: no encryption, but authentication
|
|
(tamper detection) using HMAC\-SHA\-256 resp. keyed BLAKE3.
|
|
.UNINDENT
|
|
.sp
|
|
\fB\-\-id\-hash\fP selects the id hash function of the \fBencrypted\fP modes:
|
|
.INDENT 0.0
|
|
.IP \(bu 2
|
|
\fBsha256\fP (default): HMAC\-SHA\-256.
|
|
.IP \(bu 2
|
|
\fBblake3\fP: BLAKE3. Often faster on CPUs without SHA hardware acceleration.
|
|
.UNINDENT
|
|
.sp
|
|
For the modes that do not encrypt, the hash is not just used for the chunk ids, it also is
|
|
what protects your data \- therefore it is part of the mode name there and \fB\-\-id\-hash\fP
|
|
does not apply to them.
|
|
.sp
|
|
\fB\-\-key\-location\fP selects where the key is stored (orthogonal to the crypto suite):
|
|
.INDENT 0.0
|
|
.IP \(bu 2
|
|
\fBrepokey\fP (default): the key is stored in the repository (under \fBkeys/\fP). Pick this
|
|
if you want ease\-of\-use and \(dqpassphrase\(dq security is good enough.
|
|
.IP \(bu 2
|
|
\fBkeyfile\fP: the key is stored in your home directory (in \fB~/.config/borg/keys\fP). Pick
|
|
this if you want \(dqpassphrase and having\-the\-key\(dq security.
|
|
.UNINDENT
|
|
.sp
|
|
You can move the key between these locations later with \fBborg key change\-location\fP\&.
|
|
This also applies to the \fBauthenticated\-*\fP modes: they do not encrypt your data, but they
|
|
still have a key (used for the id hash and the authentication), so \fB\-\-key\-location\fP
|
|
selects where that key is stored, just like for the encrypted modes.
|
|
.sp
|
|
If you do \fBnot\fP want to encrypt the contents of your backups, but still want to detect
|
|
malicious tampering, use \fB\-\-encryption authenticated\-sha256\fP (or \fB\-blake3\fP). These
|
|
modes are like an encrypted mode minus the data encryption.
|
|
To normally work with \fBauthenticated\-*\fP repositories, you will need the passphrase, but
|
|
there is an emergency workaround; see \fBBORG_WORKAROUNDS=authenticated_no_key\fP docs.
|
|
.SS Repository defaults
|
|
.sp
|
|
\fB\-\-compression\fP sets the repository\(aqs default compression: the commands that compress
|
|
data (\fBborg create\fP, \fBborg recreate\fP, \fBborg import\-tar\fP, \fBborg transfer\fP,
|
|
\fBborg repo\-compress\fP) use it if no compression was given via \fB\-\-compression\fP, the
|
|
environment or the default config file (\fBdefault.yaml\fP). Without a repository default,
|
|
they use lz4. See \fBborg help compression\fP for the compression specs.
|
|
.sp
|
|
\fB\-\-chunker\-params\fP sets the repository\(aqs default chunker parameters: \fBborg create\fP and
|
|
\fBborg import\-tar\fP use them if no chunker parameters were given (in the same ways as above).
|
|
\fBborg recreate\fP and \fBborg transfer\fP only rechunk if \fB\-\-chunker\-params\fP is given, with
|
|
\fB\-\-chunker\-params default\fP, they rechunk to the repository\(aqs default chunker parameters.
|
|
Without a repository default, the built\-in default chunker parameters are used.
|
|
.sp
|
|
This is useful if several clients back up into the same repository or if some commands are
|
|
run manually: they all compress and chunk the same way without having to give these options.
|
|
Using the same chunker parameters is important for deduplication.
|
|
\fBborg repo\-info\fP shows the defaults.
|
|
.sp
|
|
The defaults are stored in the repository and protected by the repository key: changing them
|
|
(e.g. removing an \fBobfuscate\fP compression) needs the key. The defaults object is always
|
|
written, also when no default was given, so removing it is noticed, too: the commands refuse
|
|
to run if it is missing or fails the authentication. \fBborg check\fP reports such an object,
|
|
\fBborg check \-\-repair\fP replaces it by empty defaults (the built\-in defaults are used then).
|
|
.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). This might be desired, for example, if you want to have fewer
|
|
keys to manage.
|
|
.sp
|
|
Creating related repositories is useful, for example, 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 options
|
|
.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 \ ENCRYPTION\fR,\fB \ \-\-encryption \ ENCRYPTION
|
|
select the mode: \(aqaes256\-ocb\(aq, \(aqchacha20\-poly1305\(aq, \(aqauthenticated\-sha256\(aq or \(aqauthenticated\-blake3\(aq \fB(required)\fP
|
|
.TP
|
|
.BI \-i \ HASH\fR,\fB \ \-\-id\-hash \ HASH
|
|
select the id hash function of the encrypted modes: \(aqsha256\(aq or \(aqblake3\(aq. The \(aqauthenticated\-sha256\(aq and \(aqauthenticated\-blake3\(aq modes name their hash themselves.
|
|
.TP
|
|
.BI \-\-key\-location \ LOCATION
|
|
where to store the key: \(aqrepokey\(aq (in the repository, default) or \(aqkeyfile\(aq (in the local keys directory).
|
|
.TP
|
|
.BI \-C \ COMPRESSION\fR,\fB \ \-\-compression \ COMPRESSION
|
|
set the default compression of the repository, see the output of the \(dqborg help compression\(dq command for details. Default: no repository default (lz4 is used).
|
|
.TP
|
|
.BI \-\-chunker\-params \ PARAMS
|
|
set the default chunker parameters of the repository (same format as for borg create). Default: no repository default (fastcdc,19,23,21,2 is used).
|
|
.TP
|
|
.B \-\-copy\-crypt\-key
|
|
copy the crypt_key (used for authenticated encryption) from the key of the other repository (default: new random key).
|
|
.UNINDENT
|
|
.SH EXAMPLES
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.EX
|
|
# Local repository
|
|
$ export BORG_REPO=/path/to/repo
|
|
# Recommended AEAD cryptographic modes (key stored in the repository by default)
|
|
$ borg repo\-create \-\-encryption=aes256\-ocb
|
|
$ borg repo\-create \-\-encryption=chacha20\-poly1305
|
|
# No encryption, only authentication (not recommended)
|
|
$ borg repo\-create \-\-encryption=authenticated\-sha256
|
|
|
|
# For the encrypted modes, \-\-encryption (the cipher / AE algorithm) and \-\-id\-hash
|
|
# (the id hash function) are chosen independently. \-\-id\-hash defaults to sha256;
|
|
# use blake3 if it is faster on your hardware (run \(aqborg benchmark cpu\(aq to find out).
|
|
$ borg repo\-create \-\-encryption=aes256\-ocb \-\-id\-hash=blake3
|
|
$ borg repo\-create \-\-encryption=chacha20\-poly1305 \-\-id\-hash=blake3
|
|
|
|
# The \(aqauthenticated\-*\(aq modes name their id hash themselves, so they
|
|
# do not take a separate \-\-id\-hash.
|
|
$ borg repo\-create \-\-encryption=authenticated\-blake3
|
|
|
|
# Where the key is stored (\-\-key\-location) is also chosen independently.
|
|
# \-\-key\-location defaults to repokey.
|
|
# repokey: stores the encrypted key inside the repository
|
|
$ borg repo\-create \-\-encryption=aes256\-ocb \-\-key\-location=repokey
|
|
# keyfile: stores the encrypted key in the config dir\(aqs keys/ subdir
|
|
# (e.g. ~/.config/borg/keys/ on Linux, ~/Library/Application Support/borg/keys/ on macOS)
|
|
$ borg repo\-create \-\-encryption=aes256\-ocb \-\-key\-location=keyfile
|
|
.EE
|
|
.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
|
|
.\" End of generated man page.
|