[Borgbackup] recommended check option

Boris Kirkorowicz bkborg at kirk.de
Wed May 10 10:51:40 EDT 2023


Hello,

Am 10.05.23 um 16:27 schrieb Bzzzz:
> On Wed, 10 May 2023 12:31:07 +0200
> Boris Kirkorowicz <bkborg at kirk.de> wrote:
> 
> Hi,
> 
>> first, I tried with one of the smaller repos that were not affected:
>>> # borg check --repository-only /mnt/rs1219a/usrlocal/
>>> Failed to create/acquire the lock /mnt/rs1219a/usrlocal/lock
>>> (timeout).
>>
>> It is the same with all repos. The repos are not encrypted. So I
>> wonder what is meant with the failing lock. All I found was
>> break-lock, and so I tried
>>
>>> # borg break-lock /mnt/rs1219a/usrlocal/
>>> # borg -v check --repository-only /mnt/rs1219a/usrlocal/
>>> Starting repository check
>>> Local Exception
>>> Traceback (most recent call last):
>>>    File "/usr/lib64/python3.10/site-packages/borg/archiver.py", line
>>> 5213, in main exit_code = archiver.run(args)
>>>    File "/usr/lib64/python3.10/site-packages/borg/archiver.py", line
>>> 5144, in run return set_ec(func(args))
>>>    File "/usr/lib64/python3.10/site-packages/borg/archiver.py", line
>>> 183, in wrapper return method(self, args, repository=repository,
>>> **kwargs) File
>>> "/usr/lib64/python3.10/site-packages/borg/archiver.py", line 343,
>>> in do_check if not repository.check(repair=args.repair,
>>> save_space=args.save_space, max_duration=args.max_duration): File
>>> "/usr/lib64/python3.10/site-packages/borg/repository.py", line
>>> 1026, in check self.save_config(self.path, self.config) File
>>> "/usr/lib64/python3.10/site-packages/borg/repository.py", line 332,
>>> in save_config secure_erase(old_config_path,
>>> avoid_collateral_damage=True) File
>>> "/usr/lib64/python3.10/site-packages/borg/helpers/fs.py", line 199,
>>> in secure_erase with open(path, 'r+b') as fd: OSError: [Errno 5]
>>> Input/output error: '/mnt/rs1219a/usrlocal/config.old'
>                                                 ^^^^^^^^^^
> Apparently, you have a problem on the above file, very possibly a bad
> sector which renders it unreadable, this might be bad for the rest of
> the repo.

that seems not to be the case, since I can read it using cat and edit it 
using vi. The error remains the same. The text file contains some info 
about the repo:
> [repository]
> version = 1
> segments_per_dir = 1000
> max_segment_size = 524288000
> append_only = 0
> storage_quota = 0
> additional_free_space = 0
> id = 180ba330d0a627f2259f0ec4132fef7a45d135cf774b6c41ec75755744d5bdf9

Could the error be that e.g. the id string is wrong, or something similar?


> This is a problem as it could have two origin: a random bad sector on a
> big disk, which needs to be fixed before removing the file to avoid to
> hit on a BB file in the future, or it can be your disk dying.

The disks are brand new, initialized using ext4 just before running borg.


> So, fix the bad sector, copy the repo on another disk (where you'll run
> the BB check) and do what's needed for the original disk (smart long
> test and formatting in ext4 with destructive patterns, which can take
> a looong time if the disk is big).

AFAICS it applies to all repos. The backup took about four months to 
complete, so formatting would not be that significant. So I hope that 
the cause is something different and it could be repaired by another method.


> I don't know for the rest as I only use NFS, which have the advantage
> of putting things on hold if the repo isn't available anymore (eg:
> reboot for some reason) and takes back where it was when the repo is
> back online.

Here, the disks are connected via iSCSI.


-- 
Mit freundlichem Gruß                                 Best regards
                                  Kirkorowicz


More information about the Borgbackup mailing list