faq.rst 53 KB

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