rclone: Rclone mount will incorrectly handle data when used with borgbackup
What is the problem you are having with rclone?
borgbackup will fail when writing files to rclone mount’d filesystem
What is your rclone version (output from rclone version)
v1.49.5-236-g2e505430-beta
Which OS you are using and how many bits (eg Windows 7, 64 bit)
FreeBSD 12.0-STABLE amd64
Which cloud storage system are you using? (eg Google Drive)
Google Drive
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone -vv --config /home/cubox/.rclone.conf --vfs-cache-mode full --cache-dir /tmp/rclone mount Gdrive:Onyx/Borg /gdrive | tee output.log
For borg:
<root@Onyx>-<~> λ borg init /gdrive -e repokey-blake2
Failed to securely erase old repository config file (hardlinks not supported>). Old repokey data, if any, might persist on physical storage.
By default repositories initialized with this version will produce security
errors if written to with an older version (up to and including Borg 1.0.8).
If you want to use these older versions, you can disable the check by running:
borg upgrade --disable-tam /gdrive
See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
Use "borg key export" to export the key, optionally in printable format.
Write down the passphrase. Store both at safe place(s).
<root@Onyx>-<~> λ borg create -p -e /root/.cache -C zlib,6 -v /gdrive::Onyx-2019-10-19T00:53 /usr/home /etc /root /www/cubox /www/fbh /usr/local/etc
Creating archive at "/gdrive::Onyx-2019-10-19T00:53"
Local Exceptionents 0%
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/borg/archiver.py", line 4501, in main
exit_code = archiver.run(args)
File "/usr/local/lib/python3.7/site-packages/borg/archiver.py", line 4433, in run
return set_ec(func(args))
File "/usr/local/lib/python3.7/site-packages/borg/archiver.py", line 166, in wrapper
return method(self, args, repository=repository, **kwargs)
File "/usr/local/lib/python3.7/site-packages/borg/archiver.py", line 573, in do_create
create_inner(archive, cache)
File "/usr/local/lib/python3.7/site-packages/borg/archiver.py", line 538, in create_inner
archive.save(comment=args.comment, timestamp=args.timestamp)
File "/usr/local/lib/python3.7/site-packages/borg/archive.py", line 515, in save
self.repository.commit()
File "/usr/local/lib/python3.7/site-packages/borg/repository.py", line 442, in commit
self.compact_segments()
File "/usr/local/lib/python3.7/site-packages/borg/repository.py", line 789, in compact_segments
assert segments[segment] == 0, 'Corrupted segment reference count - corrupted index or hints'
AssertionError: Corrupted segment reference count - corrupted index or hints
Platform: FreeBSD Onyx 12.0-STABLE FreeBSD 12.0-STABLE r347964 GENERIC amd64
Borg: 1.1.10 Python: CPython 3.7.4 msgpack: 0.5.6
PID: 67820 CWD: /root
sys.argv: ['/usr/local/bin/borg', 'create', '-p', '-e', '/root/.cache', '-C', 'zlib,6', '-v', '/gdrive::Onyx-2019-10-19T00:53', '/usr/home', '/etc', '/root', '/www/cubox', '/www/fbh', '/usr/local/etc']
SSH_ORIGINAL_COMMAND: None
A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)
The log is quite big, but I hope this helps
Issue opened with borgbackup https://github.com/borgbackup/borg/issues/4795
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 35 (25 by maintainers)
@Cubox- I am using https://beta.rclone.org/v1.51.0-327-g4006345c-beta/ on amd64 on a 5.4 kernel. Borg 1.1.11.
My remote is a google drive or a wasabi S3 bucket (tested both).
Unmounted, mounted again and tried an extract, worked without issues. Extracting took ~50 seconds.
Maybe you could post your versions and also try running rclone mount with
-vvand post the output you get when trying borg init.All my tests work fine so far!
I’m doing that, I have on my unraid rclone running with mount to Google Drive, I use this rclone mount for my borg backup repository. I found this thread looking for other people’s config, same as this one from borgbackup. In my case, it is working perfectly, no problems so far, I have rclone mount with this config:
rclone mount --cache-dir /mnt/disks/ud1/RClone_Caching_Folder/ --vfs-cache-mode full --max-read-ahead 1024k --allow-other encrypted: /mnt/disks/secure &and then I point my borg repository inside the /mnt/disks/secure folder, so far running borg create works with no issues. This is what I run if it helpsborg create --compression none --one-file-system --read-special --files-cache mtime,size --debug --show-rc --progress /ua_nvme1/testrepo::testrepo-{now} /mnt/user/repo1rclone v1.55.0 borg 1.1.15
What @dragetd explains about reducing the segment size of borgbackup is something I need to try, that way the download from the cloud (in this case with rclone mount) would not take so long, because that’s exactly what it is happening to me, and I’m backing up about 500GB.
The work from RClone developers and Borg developers is amazing, I definitely need to donate something to those guys!
Great work and thank you @ncw!
@anaxonda add
--allow-otherto yourrclone mountcommand. (Check it is allowed in/etc/fuse.conffirst)@segator This option is already available with the VFS rewrite from version 1.53 onwards, specifically the
--vfs-write-backoption