faq.rst 54 KB

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