faq.rst 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183
  1. .. include:: global.rst.inc
  2. .. highlight:: none
  3. .. _faq:
  4. Frequently asked questions
  5. ==========================
  6. Usage & Limitations
  7. ###################
  8. What is the difference between a repo on an external hard drive vs. repo on a server?
  9. -------------------------------------------------------------------------------------
  10. If Borg is running in client/server mode, the client uses SSH as a transport to
  11. talk to the remote agent, which is another Borg process (Borg is installed on
  12. the server, too) started automatically by the client. The Borg server is doing
  13. storage-related low-level repo operations (get, put, commit, check, compact),
  14. while the Borg client does the high-level stuff: deduplication, encryption,
  15. compression, dealing with archives, backups, restores, etc., which reduces the
  16. amount of data that goes over the network.
  17. When Borg is writing to a repo on a locally mounted remote file system, e.g.
  18. SSHFS, the Borg client only can do file system operations and has no agent
  19. running on the remote side, so *every* operation needs to go over the network,
  20. which is slower.
  21. Can I back up from multiple servers into a single repository?
  22. ------------------------------------------------------------
  23. In order for the deduplication used by Borg to work, it
  24. needs to keep a local cache containing checksums of all file
  25. chunks already stored in the repository. This cache is stored in
  26. ``~/.cache/borg/``. If Borg detects that a repository has been
  27. modified since the local cache was updated it will need to rebuild
  28. the cache. This rebuild can be quite time consuming.
  29. So, yes it's possible. But it will be most efficient if a single
  30. repository is only modified from one place. Also keep in mind that
  31. Borg will keep an exclusive lock on the repository while creating
  32. or deleting archives, which may make *simultaneous* backups fail.
  33. Can I back up to multiple, swapped backup targets?
  34. --------------------------------------------------
  35. It is possible to swap your backup disks if each backup medium is assigned its
  36. own repository by creating a new one with :ref:`borg_rcreate`.
  37. Can I copy or synchronize my repo to another location?
  38. ------------------------------------------------------
  39. If you want to have redundant backup repositories (preferably at separate
  40. locations), the recommended way to do that is like this:
  41. - ``borg rcreate repo1 --encryption=X``
  42. - ``borg rcreate repo2 --encryption=X --other-repo=repo1``
  43. - maybe do a snapshot to have stable and same input data for both borg create.
  44. - client machine ---borg create---> repo1
  45. - client machine ---borg create---> repo2
  46. This will create distinct (different repo ID), but related repositories.
  47. Related means using the same chunker secret and the same id_key, thus producing
  48. the same chunks / the same chunk ids if the input data is the same.
  49. The 2 independent borg create invocations mean that there is no error propagation
  50. from repo1 to repo2 when done like that.
  51. An alternative way would be to use ``borg transfer`` to copy backup archives
  52. from repo1 to repo2. Likely a bit more efficient and the archives would be identical,
  53. but suffering from potential error propagation.
  54. Warning: using borg with multiple repositories with identical repository ID (like when
  55. creating 1:1 repository copies) is not supported and can lead to all sorts of issues,
  56. like e.g. cache coherency issues, malfunction, data corruption.
  57. "this is either an attack or unsafe" warning
  58. --------------------------------------------
  59. About the warning:
  60. Cache, or information obtained from the security directory is newer than
  61. repository - this is either an attack or unsafe (multiple repos with same ID)
  62. "unsafe": If not following the advice from the previous section, you can easily
  63. run into this by yourself by restoring an older copy of your repository.
  64. "attack": maybe an attacker has replaced your repo by an older copy, trying to
  65. trick you into AES counter reuse, trying to break your repo encryption.
  66. If you'ld decide to ignore this and accept unsafe operation for this repository,
  67. you could delete the manifest-timestamp and the local cache:
  68. ::
  69. borg config id # shows the REPO_ID
  70. rm ~/.config/borg/security/REPO_ID/manifest-timestamp
  71. borg rdelete --cache-only
  72. This is an unsafe and unsupported way to use borg, you have been warned.
  73. Which file types, attributes, etc. are *not* preserved?
  74. -------------------------------------------------------
  75. * UNIX domain sockets (because it does not make sense - they are
  76. meaningless without the running process that created them and the process
  77. needs to recreate them in any case). So, don't panic if your backup
  78. misses a UDS!
  79. * The precise on-disk (or rather: not-on-disk) representation of the holes
  80. in a sparse file.
  81. Archive creation has no special support for sparse files, holes are
  82. backed up as (deduplicated and compressed) runs of zero bytes.
  83. Archive extraction has optional support to extract all-zero chunks as
  84. holes in a sparse file.
  85. * Some filesystem specific attributes, like btrfs NOCOW, see :ref:`platforms`.
  86. Are there other known limitations?
  87. ----------------------------------
  88. - borg extract supports restoring only into an empty destination. After extraction,
  89. the destination will have exactly the contents of the extracted archive.
  90. If you extract into a non-empty destination, borg will (for example) not
  91. remove files which are in the destination, but not in the archive.
  92. See :issue:`4598` for a workaround and more details.
  93. .. _checkpoints_parts:
  94. If a backup stops mid-way, does the already-backed-up data stay there?
  95. ----------------------------------------------------------------------
  96. Yes, Borg supports resuming backups.
  97. During a backup, a special checkpoint archive named ``<archive-name>.checkpoint``
  98. is saved at every checkpoint interval (the default value for this is 30
  99. minutes) containing all the data backed-up until that point.
  100. This checkpoint archive is a valid archive,
  101. but it is only a partial backup (not all files that you wanted to back up are
  102. contained in it). Having it in the repo until a successful, full backup is
  103. completed is useful because it references all the transmitted chunks up
  104. to the checkpoint. This means that in case of an interruption, you only need to
  105. retransfer the data since the last checkpoint.
  106. If a backup was interrupted, you normally do not need to do anything special,
  107. just invoke ``borg create`` as you always do. If the repository is still locked,
  108. you may need to run ``borg break-lock`` before the next backup. You may use the
  109. same archive name as in previous attempt or a different one (e.g. if you always
  110. include the current datetime), it does not matter.
  111. Borg always does full single-pass backups, so it will start again
  112. from the beginning - but it will be much faster, because some of the data was
  113. already stored into the repo (and is still referenced by the checkpoint
  114. archive), so it does not need to get transmitted and stored again.
  115. Once your backup has finished successfully, you can delete all
  116. ``<archive-name>.checkpoint`` archives. If you run ``borg prune``, it will
  117. also care for deleting unneeded checkpoints.
  118. Note: the checkpointing mechanism creates hidden, partial files in an archive,
  119. so that checkpoints even work while a big file is being processed.
  120. They are named ``<filename>.borg_part_<N>`` and all operations usually ignore
  121. these files, but you can make them considered by giving the option
  122. ``--consider-part-files``. You usually only need that option if you are
  123. really desperate (e.g. if you have no completed backup of that file and you'ld
  124. rather get a partial file extracted than nothing). You do **not** want to give
  125. that option under any normal circumstances.
  126. How can I back up huge file(s) over a unstable connection?
  127. ---------------------------------------------------------
  128. Yes. For more details, see :ref:`checkpoints_parts`.
  129. How can I restore huge file(s) over an unstable connection?
  130. -----------------------------------------------------------
  131. If you cannot manage to extract the whole big file in one go, you can extract
  132. all the part files and manually concatenate them together.
  133. For more details, see :ref:`checkpoints_parts`.
  134. How can I switch append-only mode on and off?
  135. -----------------------------------------------------------------------------------------------------------------------------------
  136. You could do that (via borg config REPO append_only 0/1), but using different
  137. ssh keys and different entries in ``authorized_keys`` is much easier and also
  138. maybe has less potential of things going wrong somehow.
  139. My machine goes to sleep causing `Broken pipe`
  140. ----------------------------------------------
  141. While backing up your data over the network, your machine should not go to sleep.
  142. On macOS you can use `caffeinate` to avoid that.
  143. How can I compare contents of an archive to my local filesystem?
  144. -----------------------------------------------------------------
  145. You can instruct ``export-tar`` to send a tar stream to the stdout, and
  146. then use ``tar`` to perform the comparison:
  147. ::
  148. borg export-tar archive-name - | tar --compare -f - -C /path/to/compare/to
  149. Can Borg add redundancy to the backup data to deal with hardware malfunction?
  150. -----------------------------------------------------------------------------
  151. No, it can't. While that at first sounds like a good idea to defend against
  152. some defect HDD sectors or SSD flash blocks, dealing with this in a
  153. reliable way needs a lot of low-level storage layout information and
  154. control which we do not have (and also can't get, even if we wanted).
  155. So, if you need that, consider RAID or a filesystem that offers redundant
  156. storage or just make backups to different locations / different hardware.
  157. See also :issue:`225`.
  158. Can Borg verify data integrity of a backup archive?
  159. ---------------------------------------------------
  160. Yes, if you want to detect accidental data damage (like bit rot), use the
  161. ``check`` operation. It will notice corruption using CRCs and hashes.
  162. If you want to be able to detect malicious tampering also, use an encrypted
  163. repo. It will then be able to check using CRCs and HMACs.
  164. Can I use Borg on SMR hard drives?
  165. ----------------------------------
  166. SMR (shingled magnetic recording) hard drives are very different from
  167. regular hard drives. Applications have to behave in certain ways or
  168. performance will be heavily degraded.
  169. Borg ships with default settings suitable for SMR drives,
  170. and has been successfully tested on *Seagate Archive v2* drives
  171. using the ext4 file system.
  172. Some Linux kernel versions between 3.19 and 4.5 had various bugs
  173. handling device-managed SMR drives, leading to IO errors, unresponsive
  174. drives and unreliable operation in general.
  175. For more details, refer to :issue:`2252`.
  176. .. _faq-integrityerror:
  177. I get an IntegrityError or similar - what now?
  178. ----------------------------------------------
  179. A single error does not necessarily indicate bad hardware or a Borg
  180. bug. All hardware exhibits a bit error rate (BER). Hard drives are typically
  181. specified as exhibiting fewer than one error every 12 to 120 TB
  182. (one bit error in 10e14 to 10e15 bits). The specification is often called
  183. *unrecoverable read error rate* (URE rate).
  184. Apart from these very rare errors there are two main causes of errors:
  185. (i) Defective hardware: described below.
  186. (ii) Bugs in software (Borg, operating system, libraries):
  187. Ensure software is up to date.
  188. Check whether the issue is caused by any fixed bugs described in
  189. :ref:`important_notes`.
  190. .. rubric:: Finding defective hardware
  191. .. note::
  192. Hardware diagnostics are operating system dependent and do not
  193. apply universally. The commands shown apply for popular Unix-like
  194. systems. Refer to your operating system's manual.
  195. Checking hard drives
  196. Find the drive containing the repository and use *findmnt*, *mount* or *lsblk*
  197. to learn the device path (typically */dev/...*) of the drive.
  198. Then, smartmontools can retrieve self-diagnostics of the drive in question::
  199. # smartctl -a /dev/sdSomething
  200. The *Offline_Uncorrectable*, *Current_Pending_Sector* and *Reported_Uncorrect*
  201. attributes indicate data corruption. A high *UDMA_CRC_Error_Count* usually
  202. indicates a bad cable.
  203. I/O errors logged by the system (refer to the system journal or
  204. dmesg) can point to issues as well. I/O errors only affecting the
  205. file system easily go unnoticed, since they are not reported to
  206. applications (e.g. Borg), while these errors can still corrupt data.
  207. Drives can corrupt some sectors in one event, while remaining
  208. reliable otherwise. Conversely, drives can fail completely with no
  209. advance warning. If in doubt, copy all data from the drive in
  210. question to another drive -- just in case it fails completely.
  211. If any of these are suspicious, a self-test is recommended::
  212. # smartctl -t long /dev/sdSomething
  213. Running ``fsck`` if not done already might yield further insights.
  214. Checking memory
  215. Intermittent issues, such as ``borg check`` finding errors
  216. inconsistently between runs, are frequently caused by bad memory.
  217. Run memtest86+ (or an equivalent memory tester) to verify that
  218. the memory subsystem is operating correctly.
  219. Checking processors
  220. Processors rarely cause errors. If they do, they are usually overclocked
  221. or otherwise operated outside their specifications. We do not recommend to
  222. operate hardware outside its specifications for productive use.
  223. Tools to verify correct processor operation include Prime95 (mprime), linpack,
  224. and the `Intel Processor Diagnostic Tool
  225. <https://downloadcenter.intel.com/download/19792/Intel-Processor-Diagnostic-Tool>`_
  226. (applies only to Intel processors).
  227. .. rubric:: Repairing a damaged repository
  228. With any defective hardware found and replaced, the damage done to the repository
  229. needs to be ascertained and fixed.
  230. :ref:`borg_check` provides diagnostics and ``--repair`` options for repositories with
  231. issues. We recommend to first run without ``--repair`` to assess the situation.
  232. If the found issues and proposed repairs seem right, re-run "check" with ``--repair`` enabled.
  233. How probable is it to get a hash collision problem?
  234. ---------------------------------------------------
  235. If you noticed, there are some issues (:issue:`170` (**warning: hell**) and :issue:`4884`)
  236. about the probability of a chunk having the same hash as another chunk, making the file
  237. corrupted because it grabbed the wrong chunk. This is called the `Birthday Problem
  238. <https://en.wikipedia.org/wiki/Birthday_problem>`_.
  239. There is a lot of probability in here so, I can give you my interpretation of
  240. such math but it's honestly better that you read it yourself and grab your own
  241. resolution from that.
  242. Assuming that all your chunks have a size of :math:`2^{21}` bytes (approximately 2.1 MB)
  243. and we have a "perfect" hash algorithm, we can think that the probability of collision
  244. would be of :math:`p^2/2^{n+1}` then, using SHA-256 (:math:`n=256`) and for example
  245. we have 1000 million chunks (:math:`p=10^9`) (1000 million chunks would be about 2100TB).
  246. The probability would be around 0.0000000000000000000000000000000000000000000000000000000000043.
  247. A mass-murderer space rock happens about once every 30 million years on average.
  248. This leads to a probability of such an event occurring in the next second to about :math:`10^{-15}`.
  249. That's **45** orders of magnitude more probable than the SHA-256 collision. Briefly stated,
  250. if you find SHA-256 collisions scary then your priorities are wrong. This example was grabbed from
  251. `this SO answer <https://stackoverflow.com/a/4014407/13359375>`_, it's great honestly.
  252. Still, the real question is if Borg tries not to make this happen?
  253. Well... previously it did not check anything until there was a feature added which saves the size
  254. of the chunks too, so the size of the chunks is compared to the size that you got with the
  255. hash and if the check says there is a mismatch it will raise an exception instead of corrupting
  256. the file. This doesn't save us from everything but reduces the chances of corruption.
  257. There are other ways of trying to escape this but it would affect performance so much that
  258. it wouldn't be worth it and it would contradict Borg's design, so if you don't want this to
  259. happen, simply don't use Borg.
  260. Why is the time elapsed in the archive stats different from wall clock time?
  261. ----------------------------------------------------------------------------
  262. Borg needs to write the time elapsed into the archive metadata before finalizing
  263. the archive and committing the repo & cache.
  264. This means when Borg is run with e.g. the ``time`` command, the duration shown
  265. in the archive stats may be shorter than the full time the command runs for.
  266. How do I configure different prune policies for different directories?
  267. ----------------------------------------------------------------------
  268. Say you want to prune ``/var/log`` faster than the rest of
  269. ``/``. How do we implement that? The answer is to back up to different
  270. archive *names* and then implement different prune policies for
  271. different prefixes. For example, you could have a script that does::
  272. borg create --exclude var/log main-$(date +%Y-%m-%d) /
  273. borg create logs-$(date +%Y-%m-%d) /var/log
  274. Then you would have two different prune calls with different policies::
  275. borg prune --verbose --list -d 30 -a 'main-*'
  276. borg prune --verbose --list -d 7 -a 'logs-*'
  277. This will keep 7 days of logs and 30 days of everything else.
  278. How do I remove files from an existing backup?
  279. ----------------------------------------------
  280. A file is only removed from a BorgBackup repository if all archives that contain
  281. the file are deleted and the corresponding data chunks are removed from the
  282. repository There are two ways how to remove files from a repository.
  283. 1. Use :ref:`borg_delete` to remove all archives that contain the files. This
  284. will of course delete everything in the archive, not only some files.
  285. 2. If you really want to remove only some specific files, you can run the
  286. :ref:`borg_recreate` command to rewrite all archives with a different
  287. ``--exclude`` pattern. See the examples in the manpage for more information.
  288. Finally, run :ref:`borg_compact` with the ``--threshold 0`` option to delete the
  289. data chunks from the repository.
  290. Can I safely change the compression level or algorithm?
  291. --------------------------------------------------------
  292. The compression level and algorithm don't affect deduplication. Chunk ID hashes
  293. are calculated *before* compression. New compression settings
  294. will only be applied to new chunks, not existing chunks. So it's safe
  295. to change them.
  296. Security
  297. ########
  298. .. _home_config_borg:
  299. How important is the $HOME/.config/borg directory?
  300. --------------------------------------------------
  301. The Borg config directory has content that you should take care of:
  302. ``security`` subdirectory
  303. Each directory here represents one Borg repository by its ID and contains the last known status.
  304. If a repository's status is different from this information at the beginning of BorgBackup
  305. operation, Borg outputs warning messages and asks for confirmation, so make sure you do not lose
  306. or manipulate these files. However, apart from those warnings, a loss of these files can be
  307. recovered.
  308. ``keys`` subdirectory
  309. All your borg keyfile keys are stored in this directory. Please note that
  310. borg repokey keys are stored inside the repository. You MUST make sure to have an
  311. independent backup of these keyfiles, otherwise you cannot access your backups anymore if you lose
  312. them. You also MUST keep these files secret; everyone who gains access to your repository and has
  313. the corresponding keyfile (and the key passphrase) can extract it.
  314. Make sure that only you have access to the Borg config directory.
  315. .. _cache_security:
  316. Do I need to take security precautions regarding the cache?
  317. -----------------------------------------------------------
  318. The cache contains a lot of metadata information about the files in
  319. your repositories and it is not encrypted.
  320. However, the assumption is that the cache is being stored on the very
  321. same system which also contains the original files which are being
  322. backed up. So someone with access to the cache files would also have
  323. access the original files anyway.
  324. The Internals section contains more details about :ref:`cache`. If you ever need to move the cache
  325. to a different location, this can be achieved by using the appropriate :ref:`env_vars`.
  326. How can I specify the encryption passphrase programmatically?
  327. -------------------------------------------------------------
  328. There are several ways to specify a passphrase without human intervention:
  329. Setting ``BORG_PASSPHRASE``
  330. The passphrase can be specified using the ``BORG_PASSPHRASE`` environment variable.
  331. This is often the simplest option, but can be insecure if the script that sets it
  332. is world-readable.
  333. .. _password_env:
  334. .. note:: Be careful how you set the environment; using the ``env``
  335. command, a ``system()`` call or using inline shell scripts
  336. (e.g. ``BORG_PASSPHRASE=hunter2 borg ...``)
  337. might expose the credentials in the process list directly
  338. and they will be readable to all users on a system. Using
  339. ``export`` in a shell script file should be safe, however, as
  340. the environment of a process is `accessible only to that
  341. user
  342. <https://security.stackexchange.com/questions/14000/environment-variable-accessibility-in-linux/14009#14009>`_.
  343. Using ``BORG_PASSCOMMAND`` with a properly permissioned file
  344. Another option is to create a file with a password in it in your home
  345. directory and use permissions to keep anyone else from reading it. For
  346. example, first create a key::
  347. (umask 0077; head -c 32 /dev/urandom | base64 -w 0 > ~/.borg-passphrase)
  348. Then in an automated script one can put::
  349. export BORG_PASSCOMMAND="cat $HOME/.borg-passphrase"
  350. and Borg will automatically use that passphrase.
  351. Using keyfile-based encryption with a blank passphrase
  352. It is possible to encrypt your repository in ``keyfile`` mode instead of the default
  353. ``repokey`` mode and use a blank passphrase for the key file (simply press Enter twice
  354. when ``borg rcreate`` asks for the password). See :ref:`encrypted_repos`
  355. for more details.
  356. Using ``BORG_PASSCOMMAND`` with macOS Keychain
  357. macOS has a native manager for secrets (such as passphrases) which is safer
  358. than just using a file as it is encrypted at rest and unlocked manually
  359. (fortunately, the login keyring automatically unlocks when you log in). With
  360. the built-in ``security`` command, you can access it from the command line,
  361. making it useful for ``BORG_PASSCOMMAND``.
  362. First generate a passphrase and use ``security`` to save it to your login
  363. (default) keychain::
  364. security add-generic-password -D secret -U -a $USER -s borg-passphrase -w $(head -c 32 /dev/urandom | base64 -w 0)
  365. In your backup script retrieve it in the ``BORG_PASSCOMMAND``::
  366. export BORG_PASSCOMMAND="security find-generic-password -a $USER -s borg-passphrase -w"
  367. Using ``BORG_PASSCOMMAND`` with GNOME Keyring
  368. GNOME also has a keyring daemon that can be used to store a Borg passphrase.
  369. First ensure ``libsecret-tools``, ``gnome-keyring`` and ``libpam-gnome-keyring``
  370. are installed. If ``libpam-gnome-keyring`` wasn't already installed, ensure it
  371. runs on login::
  372. sudo sh -c "echo session optional pam_gnome_keyring.so auto_start >> /etc/pam.d/login"
  373. sudo sh -c "echo password optional pam_gnome_keyring.so >> /etc/pam.d/passwd"
  374. # you may need to relogin afterwards to activate the login keyring
  375. Then add a secret to the login keyring::
  376. head -c 32 /dev/urandom | base64 -w 0 | secret-tool store borg-repository repo-name --label="Borg Passphrase"
  377. If a dialog box pops up prompting you to pick a password for a new keychain, use your
  378. login password. If there is a checkbox for automatically unlocking on login, check it
  379. to allow backups without any user intervention whatsoever.
  380. Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``::
  381. export BORG_PASSCOMMAND="secret-tool lookup borg-repository repo-name"
  382. .. note:: For this to automatically unlock the keychain it must be run
  383. in the ``dbus`` session of an unlocked terminal; for example, running a backup
  384. script as a ``cron`` job might not work unless you also ``export DISPLAY=:0``
  385. so ``secret-tool`` can pick up your open session. `It gets even more complicated`__
  386. when you are running the tool as a different user (e.g. running a backup as root
  387. with the password stored in the user keyring).
  388. __ https://github.com/borgbackup/borg/pull/2837#discussion_r127641330
  389. Using ``BORG_PASSCOMMAND`` with KWallet
  390. KDE also has a keychain feature in the form of KWallet. The command-line tool
  391. ``kwalletcli`` can be used to store and retrieve secrets. Ensure ``kwalletcli``
  392. is installed, generate a passphrase, and store it in your "wallet"::
  393. head -c 32 /dev/urandom | base64 -w 0 | kwalletcli -Pe borg-passphrase -f Passwords
  394. Once the secret is saved, retrieve it in a backup script using ``BORG_PASSCOMMAND``::
  395. export BORG_PASSCOMMAND="kwalletcli -e borg-passphrase -f Passwords"
  396. When backing up to remote encrypted repos, is encryption done locally?
  397. ----------------------------------------------------------------------
  398. Yes, file and directory metadata and data is locally encrypted, before
  399. leaving the local machine. We do not mean the transport layer encryption
  400. by that, but the data/metadata itself. Transport layer encryption (e.g.
  401. when ssh is used as a transport) applies additionally.
  402. When backing up to remote servers, do I have to trust the remote server?
  403. ------------------------------------------------------------------------
  404. Yes and No.
  405. No, as far as data confidentiality is concerned - if you use encryption,
  406. all your files/dirs data and metadata are stored in their encrypted form
  407. into the repository.
  408. Yes, as an attacker with access to the remote server could delete (or
  409. otherwise make unavailable) all your backups.
  410. How can I protect against a hacked backup client?
  411. -------------------------------------------------
  412. Assume you back up your backup client machine C to the backup server S and
  413. C gets hacked. In a simple push setup, the attacker could then use borg on
  414. C to delete all backups residing on S.
  415. These are your options to protect against that:
  416. - Do not allow to permanently delete data from the repo, see :ref:`append_only_mode`.
  417. - Use a pull-mode setup using ``ssh -R``, see :ref:`pull_backup` for more information.
  418. - Mount C's filesystem on another machine and then create a backup of it.
  419. - Do not give C filesystem-level access to S.
  420. See :ref:`hosting_repositories` for a detailed protection guide.
  421. How can I protect against a hacked backup server?
  422. -------------------------------------------------
  423. Just in case you got the impression that pull-mode backups are way more safe
  424. than push-mode, you also need to consider the case that your backup server S
  425. gets hacked. In case S has access to a lot of clients C, that might bring you
  426. into even bigger trouble than a hacked backup client in the previous FAQ entry.
  427. These are your options to protect against that:
  428. - Use the standard push-mode setup (see also previous FAQ entry).
  429. - Mount (the repo part of) S's filesystem on C.
  430. - Do not give S file-system level access to C.
  431. - Have your backup server at a well protected place (maybe not reachable from
  432. the internet), configure it safely, apply security updates, monitor it, ...
  433. How can I protect against theft, sabotage, lightning, fire, ...?
  434. ----------------------------------------------------------------
  435. In general: if your only backup medium is nearby the backupped machine and
  436. always connected, you can easily get into trouble: they likely share the same
  437. fate if something goes really wrong.
  438. Thus:
  439. - have multiple backup media
  440. - have media disconnected from network, power, computer
  441. - have media at another place
  442. - have a relatively recent backup on your media
  443. How do I report a security issue with Borg?
  444. -------------------------------------------
  445. Send a private email to the :ref:`security contact <security-contact>`
  446. if you think you have discovered a security issue.
  447. Please disclose security issues responsibly.
  448. Common issues
  449. #############
  450. /path/to/repo is not a valid repository. Check repo config.
  451. -----------------------------------------------------------
  452. There can be many causes of this error. E.g. you have incorrectly specified the repository path.
  453. You will also get this error if you try to access a repository with a key that uses the argon2 key algorithm using an old version of borg.
  454. We recommend upgrading to the latest stable version and trying again. We are sorry. We should have thought about forward
  455. compatibility and implemented a more helpful error message.
  456. Why does Borg extract hang after some time?
  457. -------------------------------------------
  458. When I do a ``borg extract``, after a while all activity stops, no cpu usage,
  459. no downloads.
  460. This may happen when the SSH connection is stuck on server side. You can
  461. configure SSH on client side to prevent this by sending keep-alive requests,
  462. for example in ~/.ssh/config:
  463. ::
  464. Host borg.example.com
  465. # Client kills connection after 3*30 seconds without server response:
  466. ServerAliveInterval 30
  467. ServerAliveCountMax 3
  468. You can also do the opposite and configure SSH on server side in
  469. /etc/ssh/sshd_config, to make the server send keep-alive requests to the client:
  470. ::
  471. # Server kills connection after 3*30 seconds without client response:
  472. ClientAliveInterval 30
  473. ClientAliveCountMax 3
  474. How can I deal with my very unstable SSH connection?
  475. ----------------------------------------------------
  476. If you have issues with lost connections during long-running borg commands, you
  477. could try to work around:
  478. - Make partial extracts like ``borg extract PATTERN`` to do multiple
  479. smaller extraction runs that complete before your connection has issues.
  480. - Try using ``borg mount MOUNTPOINT`` and ``rsync -avH`` from
  481. ``MOUNTPOINT`` to your desired extraction directory. If the connection breaks
  482. down, just repeat that over and over again until rsync does not find anything
  483. to do any more. Due to the way borg mount works, this might be less efficient
  484. than borg extract for bigger volumes of data.
  485. Why do I get "connection closed by remote" after a while?
  486. ---------------------------------------------------------
  487. When doing a backup to a remote server (using a ssh: repo URL), it sometimes
  488. stops after a while (some minutes, hours, ... - not immediately) with
  489. "connection closed by remote" error message. Why?
  490. That's a good question and we are trying to find a good answer in :issue:`636`.
  491. Why am I seeing idle borg serve processes on the repo server?
  492. -------------------------------------------------------------
  493. Maybe the ssh connection between client and server broke down and that was not
  494. yet noticed on the server. Try these settings:
  495. ::
  496. # /etc/ssh/sshd_config on borg repo server - kill connection to client
  497. # after ClientAliveCountMax * ClientAliveInterval seconds with no response
  498. ClientAliveInterval 20
  499. ClientAliveCountMax 3
  500. If you have multiple borg create ... ; borg create ... commands in a already
  501. serialized way in a single script, you need to give them ``--lock-wait N`` (with N
  502. being a bit more than the time the server needs to terminate broken down
  503. connections and release the lock).
  504. .. _disable_archive_chunks:
  505. The borg cache eats way too much disk space, what can I do?
  506. -----------------------------------------------------------
  507. This may especially happen if borg needs to rebuild the local "chunks" index -
  508. either because it was removed, or because it was not coherent with the
  509. repository state any more (e.g. because another borg instance changed the
  510. repository).
  511. To optimize this rebuild process, borg caches per-archive information in the
  512. ``chunks.archive.d/`` directory. It won't help the first time it happens, but it
  513. will make the subsequent rebuilds faster (because it needs to transfer less data
  514. from the repository). While being faster, the cache needs quite some disk space,
  515. which might be unwanted.
  516. There is a temporary (but maybe long lived) hack to avoid using lots of disk
  517. space for chunks.archive.d (see :issue:`235` for details):
  518. ::
  519. # this assumes you are working with the same user as the backup.
  520. cd ~/.cache/borg/$(borg config id)
  521. rm -rf chunks.archive.d ; touch chunks.archive.d
  522. This deletes all the cached archive chunk indexes and replaces the directory
  523. that kept them with a file, so borg won't be able to store anything "in" there
  524. in future.
  525. This has some pros and cons, though:
  526. - much less disk space needs for ~/.cache/borg.
  527. - chunk cache resyncs will be slower as it will have to transfer chunk usage
  528. metadata for all archives from the repository (which might be slow if your
  529. repo connection is slow) and it will also have to build the hashtables from
  530. that data.
  531. chunk cache resyncs happen e.g. if your repo was written to by another
  532. machine (if you share same backup repo between multiple machines) or if
  533. your local chunks cache was lost somehow.
  534. The long term plan to improve this is called "borgception", see :issue:`474`.
  535. Can I back up my root partition (/) with Borg?
  536. ---------------------------------------------
  537. Backing up your entire root partition works just fine, but remember to
  538. exclude directories that make no sense to back up, such as /dev, /proc,
  539. /sys, /tmp and /run, and to use ``--one-file-system`` if you only want to
  540. back up the root partition (and not any mounted devices e.g.).
  541. If it crashes with a UnicodeError, what can I do?
  542. -------------------------------------------------
  543. Check if your encoding is set correctly. For most POSIX-like systems, try::
  544. export LANG=en_US.UTF-8 # or similar, important is correct charset
  545. I can't extract non-ascii filenames by giving them on the commandline!?
  546. -----------------------------------------------------------------------
  547. This might be due to different ways to represent some characters in unicode
  548. or due to other non-ascii encoding issues.
  549. If you run into that, try this:
  550. - avoid the non-ascii characters on the commandline by e.g. extracting
  551. the parent directory (or even everything)
  552. - mount the repo using FUSE and use some file manager
  553. .. _expected_performance:
  554. What's the expected backup performance?
  555. ---------------------------------------
  556. Compared to simply copying files (e.g. with ``rsync``), Borg has more work to do.
  557. This can make creation of the first archive slower, but saves time
  558. and disk space on subsequent runs. Here what Borg does when you run ``borg create``:
  559. - Borg chunks the file (using the relatively expensive buzhash algorithm)
  560. - It then computes the "id" of the chunk (hmac-sha256 (often slow, except
  561. if your CPU has sha256 acceleration) or blake2b (fast, in software))
  562. - Then it checks whether this chunk is already in the repo (local hashtable lookup,
  563. fast). If so, the processing of the chunk is completed here. Otherwise it needs to
  564. process the chunk:
  565. - Compresses (the default lz4 is super fast)
  566. - Encrypts and authenticates (AES-OCB, usually fast if your CPU has AES acceleration as usual
  567. since about 10y, or chacha20-poly1305, fast pure-software crypto)
  568. - Transmits to repo. If the repo is remote, this usually involves an SSH connection
  569. (does its own encryption / authentication).
  570. - Stores the chunk into a key/value store (the key is the chunk id, the value
  571. is the data). While doing that, it computes CRC32 / XXH64 of the data (repo low-level
  572. checksum, used by borg check --repository) and also updates the repo index
  573. (another hashtable).
  574. Subsequent backups are usually very fast if most files are unchanged and only
  575. a few are new or modified. The high performance on unchanged files primarily depends
  576. only on a few factors (like FS recursion + metadata reading performance and the
  577. files cache working as expected) and much less on other factors.
  578. E.g., for this setup:
  579. - server grade machine (4C/8T 2013 Xeon, 64GB RAM, 2x good 7200RPM disks)
  580. - local zfs filesystem (mirrored) containing the backup source data
  581. - repository is remote (does not matter much for unchanged files)
  582. - backup job runs while machine is otherwise idle
  583. The observed performance is that Borg can process about
  584. **1 million unchanged files (and a few small changed ones) in 4 minutes!**
  585. If you are seeing much less than that in similar circumstances, read the next
  586. few FAQ entries below.
  587. .. _slow_backup:
  588. Why is my backup so slow?
  589. --------------------------
  590. If you feel your Borg backup is too slow somehow, here is what you can do:
  591. - Make sure Borg has enough RAM (depends on how big your repo is / how many
  592. files you have)
  593. - Use one of the blake2 modes for --encryption except if you positively know
  594. your CPU (and openssl) accelerates sha256 (then stay with hmac-sha256).
  595. - Don't use any expensive compression. The default is lz4 and super fast.
  596. Uncompressed is often slower than lz4.
  597. - Just wait. You can also interrupt it and start it again as often as you like,
  598. it will converge against a valid "completed" state (see ``--checkpoint-interval``,
  599. maybe use the default, but in any case don't make it too short). It is starting
  600. from the beginning each time, but it is still faster then as it does not store
  601. data into the repo which it already has there from last checkpoint.
  602. - If you don’t need additional file attributes, you can disable them with ``--noflags``,
  603. ``--noacls``, ``--noxattrs``. This can lead to noticeable performance improvements
  604. when your backup consists of many small files.
  605. To see what files have changed and take more time processing, you can also add
  606. ``--list --filter=AME --stats`` to your ``borg create`` call to produce more log output,
  607. including a file list (with file status characters) and also some statistics at
  608. the end of the backup.
  609. Then you do the backup and look at the log output:
  610. - stats: Do you really have little changes or are there more changes than you thought?
  611. In the stats you can see the overall volume of changed data, which needed to be
  612. added to the repo. If that is a lot, that can be the reason why it is slow.
  613. - ``A`` status ("added") in the file list:
  614. If you see that often, you have a lot of new files (files that Borg did not find
  615. in the files cache). If you think there is something wrong with that (the file was there
  616. already in the previous backup), please read the FAQ entries below.
  617. - ``M`` status ("modified") in the file list:
  618. If you see that often, Borg thinks that a lot of your files might be modified
  619. (Borg found them in the files cache, but the metadata read from the filesystem did
  620. not match the metadata stored in the files cache).
  621. In such a case, Borg will need to process the files' contents completely, which is
  622. much slower than processing unmodified files (Borg does not read their contents!).
  623. The metadata values used in this comparison are determined by the ``--files-cache`` option
  624. and could be e.g. size, ctime and inode number (see the ``borg create`` docs for more
  625. details and potential issues).
  626. You can use the ``stat`` command on files to manually look at fs metadata to debug if
  627. there is any unexpected change triggering the ``M`` status.
  628. Also, the ``--debug-topic=files_cache`` option of ``borg create`` provides a lot of debug
  629. output helping to analyse why the files cache does not give its expected high performance.
  630. When borg runs inside a virtual machine, there are some more things to look at:
  631. Some hypervisors (e.g. kvm on proxmox) give some broadly compatible CPU type to the
  632. VM (usually to ease migration between VM hosts of potentially different hardware CPUs).
  633. It is broadly compatible because they leave away modern CPU features that could be
  634. not present in older or other CPUs, e.g. hardware acceleration for AES crypto, for
  635. sha2 hashes, for (P)CLMUL(QDQ) computations useful for crc32.
  636. So, basically you pay for compatibility with bad performance. If you prefer better
  637. performance, you should try to expose the host CPU's misc. hw acceleration features
  638. to the VM which runs borg.
  639. On Linux, check ``/proc/cpuinfo`` for the CPU flags inside the VM.
  640. For kvm check the docs about "Host model" and "Host passthrough".
  641. See also the next few FAQ entries for more details.
  642. .. _a_status_oddity:
  643. I am seeing 'A' (added) status for an unchanged file!?
  644. ------------------------------------------------------
  645. The files cache is used to determine whether Borg already
  646. "knows" / has backed up a file and if so, to skip the file from
  647. chunking. It intentionally *excludes* files that have a timestamp
  648. which is the same as the newest timestamp in the created archive.
  649. So, if you see an 'A' status for unchanged file(s), they are likely the files
  650. with the most recent timestamp in that archive.
  651. This is expected: it is to avoid data loss with files that are backed up from
  652. a snapshot and that are immediately changed after the snapshot (but within
  653. timestamp granularity time, so the timestamp would not change). Without the code that
  654. removes these files from the files cache, the change that happened right after
  655. the snapshot would not be contained in the next backup as Borg would
  656. think the file is unchanged.
  657. This does not affect deduplication, the file will be chunked, but as the chunks
  658. will often be the same and already stored in the repo (except in the above
  659. mentioned rare condition), it will just re-use them as usual and not store new
  660. data chunks.
  661. If you want to avoid unnecessary chunking, just create or touch a small or
  662. empty file in your backup source file set (so that one has the latest timestamp,
  663. not your 50GB VM disk image) and, if you do snapshots, do the snapshot after
  664. that.
  665. Since only the files cache is used in the display of files status,
  666. those files are reported as being added when, really, chunks are
  667. already used.
  668. By default, ctime (change time) is used for the timestamps to have a rather
  669. safe change detection (see also the --files-cache option).
  670. Furthermore, pathnames recorded in files cache are always absolute, even if you
  671. specify source directories with relative pathname. If relative pathnames are
  672. stable, but absolute are not (for example if you mount a filesystem without
  673. stable mount points for each backup or if you are running the backup from a
  674. filesystem snapshot whose name is not stable), borg will assume that files are
  675. different and will report them as 'added', even though no new chunks will be
  676. actually recorded for them. To avoid this, you could bind mount your source
  677. directory in a directory with the stable path.
  678. .. _always_chunking:
  679. It always chunks all my files, even unchanged ones!
  680. ---------------------------------------------------
  681. Borg maintains a files cache where it remembers the timestamp, size and
  682. inode of files. When Borg does a new backup and starts processing a
  683. file, it first looks whether the file has changed (compared to the values
  684. stored in the files cache). If the values are the same, the file is assumed
  685. unchanged and thus its contents won't get chunked (again).
  686. Borg can't keep an infinite history of files of course, thus entries
  687. in the files cache have a "maximum time to live" which is set via the
  688. environment variable BORG_FILES_CACHE_TTL (and defaults to 20).
  689. Every time you do a backup (on the same machine, using the same user), the
  690. cache entries' ttl values of files that were not "seen" are incremented by 1
  691. and if they reach BORG_FILES_CACHE_TTL, the entry is removed from the cache.
  692. So, for example, if you do daily backups of 26 different data sets A, B,
  693. C, ..., Z on one machine (using the default TTL), the files from A will be
  694. already forgotten when you repeat the same backups on the next day and it
  695. will be slow because it would chunk all the files each time. If you set
  696. BORG_FILES_CACHE_TTL to at least 26 (or maybe even a small multiple of that),
  697. it would be much faster.
  698. Besides using a higher BORG_FILES_CACHE_TTL (which also increases memory usage),
  699. there is also BORG_FILES_CACHE_SUFFIX which can be used to have separate (smaller)
  700. files caches for each backup set instead of the default one (big) unified files cache.
  701. Another possible reason is that files don't always have the same path, for
  702. example if you mount a filesystem without stable mount points for each backup
  703. or if you are running the backup from a filesystem snapshot whose name is not
  704. stable. If the directory where you mount a filesystem is different every time,
  705. Borg assumes they are different files. This is true even if you back up these
  706. files with relative pathnames - borg uses full pathnames in files cache regardless.
  707. It is possible for some filesystems, such as ``mergerfs`` or network filesystems,
  708. to return inconsistent inode numbers across runs, causing borg to consider them changed.
  709. A workaround is to set the option ``--files-cache=ctime,size`` to exclude the inode
  710. number comparison from the files cache check so that files with different inode
  711. numbers won't be treated as modified.
  712. Is there a way to limit bandwidth with Borg?
  713. --------------------------------------------
  714. To limit upload (i.e. :ref:`borg_create`) bandwidth, use the
  715. ``--remote-ratelimit`` option.
  716. There is no built-in way to limit *download*
  717. (i.e. :ref:`borg_extract`) bandwidth, but limiting download bandwidth
  718. can be accomplished with pipeviewer_:
  719. Create a wrapper script: /usr/local/bin/pv-wrapper
  720. ::
  721. #!/bin/sh
  722. ## -q, --quiet do not output any transfer information at all
  723. ## -L, --rate-limit RATE limit transfer to RATE bytes per second
  724. RATE=307200
  725. pv -q -L $RATE | "$@"
  726. Add BORG_RSH environment variable to use pipeviewer wrapper script with ssh.
  727. ::
  728. export BORG_RSH='/usr/local/bin/pv-wrapper ssh'
  729. Now Borg will be bandwidth limited. The nice thing about ``pv`` is that you can
  730. change rate-limit on the fly:
  731. ::
  732. pv -R $(pidof pv) -L 102400
  733. .. _pipeviewer: http://www.ivarch.com/programs/pv.shtml
  734. How can I avoid unwanted base directories getting stored into archives?
  735. -----------------------------------------------------------------------
  736. Possible use cases:
  737. - Another file system is mounted and you want to back it up with original paths.
  738. - You have created a BTRFS snapshot in a ``/.snapshots`` directory for backup.
  739. To achieve this, run ``borg create`` within the mountpoint/snapshot directory:
  740. ::
  741. # Example: Some file system mounted in /mnt/rootfs.
  742. cd /mnt/rootfs
  743. borg create rootfs_backup .
  744. I am having troubles with some network/FUSE/special filesystem, why?
  745. --------------------------------------------------------------------
  746. Borg is doing nothing special in the filesystem, it only uses very
  747. common and compatible operations (even the locking is just "rename").
  748. So, if you are encountering issues like slowness, corruption or malfunction
  749. when using a specific filesystem, please try if you can reproduce the issues
  750. with a local (non-network) and proven filesystem (like ext4 on Linux).
  751. If you can't reproduce the issue then, you maybe have found an issue within
  752. the filesystem code you used (not with Borg). For this case, it is
  753. recommended that you talk to the developers / support of the network fs and
  754. maybe open an issue in their issue tracker. Do not file an issue in the
  755. Borg issue tracker.
  756. If you can reproduce the issue with the proven filesystem, please file an
  757. issue in the Borg issue tracker about that.
  758. Why does running 'borg check --repair' warn about data loss?
  759. ------------------------------------------------------------
  760. Repair usually works for recovering data in a corrupted archive. However,
  761. it's impossible to predict all modes of corruption. In some very rare
  762. instances, such as malfunctioning storage hardware, additional repo
  763. corruption may occur. If you can't afford to lose the repo, it's strongly
  764. recommended that you perform repair on a copy of the repo.
  765. In other words, the warning is there to emphasize that Borg:
  766. - Will perform automated routines that modify your backup repository
  767. - Might not actually fix the problem you are experiencing
  768. - Might, in very rare cases, further corrupt your repository
  769. In the case of malfunctioning hardware, such as a drive or USB hub
  770. corrupting data when read or written, it's best to diagnose and fix the
  771. cause of the initial corruption before attempting to repair the repo. If
  772. the corruption is caused by a one time event such as a power outage,
  773. running `borg check --repair` will fix most problems.
  774. Why isn't there more progress / ETA information displayed?
  775. ----------------------------------------------------------
  776. Some borg runs take quite a bit, so it would be nice to see a progress display,
  777. maybe even including a ETA (expected time of "arrival" [here rather "completion"]).
  778. For some functionality, this can be done: if the total amount of work is more or
  779. less known, we can display progress. So check if there is a ``--progress`` option.
  780. But sometimes, the total amount is unknown (e.g. for ``borg create`` we just do
  781. a single pass over the filesystem, so we do not know the total file count or data
  782. volume before reaching the end). Adding another pass just to determine that would
  783. take additional time and could be incorrect, if the filesystem is changing.
  784. Even if the fs does not change and we knew count and size of all files, we still
  785. could not compute the ``borg create`` ETA as we do not know the amount of changed
  786. chunks, how the bandwidth of source and destination or system performance might
  787. fluctuate.
  788. You see, trying to display ETA would be futile. The borg developers prefer to
  789. rather not implement progress / ETA display than doing futile attempts.
  790. See also: https://xkcd.com/612/
  791. Why am I getting 'Operation not permitted' errors when backing up on sshfs?
  792. ---------------------------------------------------------------------------
  793. By default, ``sshfs`` is not entirely POSIX-compliant when renaming files due to
  794. a technicality in the SFTP protocol. Fortunately, it also provides a workaround_
  795. to make it behave correctly::
  796. sshfs -o workaround=rename user@host:dir /mnt/dir
  797. .. _workaround: https://unix.stackexchange.com/a/123236
  798. Can I disable checking for free disk space?
  799. -------------------------------------------
  800. In some cases, the free disk space of the target volume is reported incorrectly.
  801. This can happen for CIFS- or FUSE shares. If you are sure that your target volume
  802. will always have enough disk space, you can use the following workaround to disable
  803. checking for free disk space::
  804. borg config -- additional_free_space -2T
  805. How do I rename a repository?
  806. -----------------------------
  807. There is nothing special that needs to be done, you can simply rename the
  808. directory that corresponds to the repository. However, the next time borg
  809. interacts with the repository (i.e, via ``borg list``), depending on the value
  810. of ``BORG_RELOCATED_REPO_ACCESS_IS_OK``, borg may warn you that the repository
  811. has been moved. You will be given a prompt to confirm you are OK with this.
  812. If ``BORG_RELOCATED_REPO_ACCESS_IS_OK`` is unset, borg will interactively ask for
  813. each repository whether it's OK.
  814. It may be useful to set ``BORG_RELOCATED_REPO_ACCESS_IS_OK=yes`` to avoid the
  815. prompts when renaming multiple repositories or in a non-interactive context
  816. such as a script. See :doc:`deployment` for an example.
  817. The repository quota size is reached, what can I do?
  818. ----------------------------------------------------
  819. The simplest solution is to increase or disable the quota and resume the backup:
  820. ::
  821. borg config /path/to/repo storage_quota 0
  822. If you are bound to the quota, you have to free repository space. The first to
  823. try is running :ref:`borg_compact` to free unused backup space (see also
  824. :ref:`separate_compaction`):
  825. ::
  826. borg compact /path/to/repo
  827. If your repository is already compacted, run :ref:`borg_prune` or
  828. :ref:`borg_delete` to delete archives that you do not need anymore, and then run
  829. ``borg compact`` again.
  830. My backup disk is full, what can I do?
  831. --------------------------------------
  832. Borg cannot work if you really have zero free space on the backup disk, so the
  833. first thing you must do is deleting some files to regain free disk space. See
  834. :ref:`about_free_space` for further details.
  835. Some Borg commands that do not change the repository might work under disk-full
  836. conditions, but generally this should be avoided. If your backup disk is already
  837. full when Borg starts a write command like `borg create`, it will abort
  838. immediately and the repository will stay as-is.
  839. If you run a backup that stops due to a disk running full, Borg will roll back,
  840. delete the new new segment file and thus freeing disk space automatically. There
  841. may be a checkpoint archive left that has been saved before the disk got full.
  842. You can keep it to speed up the next backup or delete it to get back more disk
  843. space.
  844. Miscellaneous
  845. #############
  846. Requirements for the borg single-file binary, esp. (g)libc?
  847. -----------------------------------------------------------
  848. We try to build the binary on old, but still supported systems - to keep the
  849. minimum requirement for the (g)libc low. The (g)libc can't be bundled into
  850. the binary as it needs to fit your kernel and OS, but Python and all other
  851. required libraries will be bundled into the binary.
  852. If your system fulfills the minimum (g)libc requirement (see the README that
  853. is released with the binary), there should be no problem. If you are slightly
  854. below the required version, maybe just try. Due to the dynamic loading (or not
  855. loading) of some shared libraries, it might still work depending on what
  856. libraries are actually loaded and used.
  857. In the borg git repository, there is scripts/glibc_check.py that can determine
  858. (based on the symbols' versions they want to link to) whether a set of given
  859. (Linux) binaries works with a given glibc version.