multiple source_directories broken since version 1.5.5 #333

Closed
opened 2020-06-19 18:11:53 +00:00 by WladyX · 8 comments

Hi,
From borgmatic version 1.5.5 borgmatic does not back up the secong folder.
/ is backed up, but /media/ssd is not backed up.
Version 1.5.4 worked as expected.

Thank you!

I have the following config file:

egrep -v '#|^$' /etc/borgmatic/config.yaml

location:
    source_directories:
        - /
        - /media/ssd
    repositories:
        - borg@tyrion.redact:pandora
        - borg@pandora.redact:pandora
    one_file_system: true
    numeric_owner: true
    atime: false
    exclude_patterns:
        - /proc
        - /dev
        - /tmp
        - /sys
        - /media/self
        - /var/spool/squid3
storage:
    ssh_command: ssh -i /root/.ssh/borg_rsa
    unknown_unencrypted_repo_access_is_ok: true
retention:
    keep_daily: 7
    keep_monthly: 6
    keep_yearly: 1
consistency:
    checks:
        - repository
        - data
        - extract
    prefix: ''
hooks:
    before_backup:
        - echo "*** Starting pandora backup ***"
        - curl -sX POST redact
    after_backup:
        - echo "******** END OF PANDORA ********"
        - curl -sX POST redact
    on_error:
        - echo "******** !!! ERROR ON PANDORA !!! ********"
        - curl -sX POST redact

same problem with this config:

    source_directories:
        - /media/xps2
        - /media/xps2/Pictures
        - /media/xps2/images
Hi, From borgmatic version 1.5.5 borgmatic does not back up the secong folder. / is backed up, but /media/ssd is not backed up. Version 1.5.4 worked as expected. Thank you! I have the following config file: ``` egrep -v '#|^$' /etc/borgmatic/config.yaml location: source_directories: - / - /media/ssd repositories: - borg@tyrion.redact:pandora - borg@pandora.redact:pandora one_file_system: true numeric_owner: true atime: false exclude_patterns: - /proc - /dev - /tmp - /sys - /media/self - /var/spool/squid3 storage: ssh_command: ssh -i /root/.ssh/borg_rsa unknown_unencrypted_repo_access_is_ok: true retention: keep_daily: 7 keep_monthly: 6 keep_yearly: 1 consistency: checks: - repository - data - extract prefix: '' hooks: before_backup: - echo "*** Starting pandora backup ***" - curl -sX POST redact after_backup: - echo "******** END OF PANDORA ********" - curl -sX POST redact on_error: - echo "******** !!! ERROR ON PANDORA !!! ********" - curl -sX POST redact ``` same problem with this config: ``` source_directories: - /media/xps2 - /media/xps2/Pictures - /media/xps2/images ```
Owner

Yikes! Thank you for reporting this. I have an idea of what might be going on here: borgmatic 1.5.5 started de-duplicating source directories to prevent Borg from scanning the same source directories twice, which can cause hangs in certain cases. So for instance, source directories of /foo and /foo/bar would get de-duplicated down to just /foo.. because /foo contains /foo/bar, and therefore Borg will implicitly backup both.

Something similiar is going on here: / contains /media/ssd, and so borgmatic is de-duplicating that down to just /. Now it sounds like that might be problematic because you have one_file_system set to true (a totally legitimate setting to have), and therefore Borg doesn't traverse from / to /media/ssd when scanning for files.

I assume that your backup archives contained the contents of /media/ssd before borgmatic 1.5.5, and /media/ssd is missing from archives afterwards? I'm just trying to understand how one_file_system interacts with multiple Borg source directories. Thanks.

Yikes! Thank you for reporting this. I have an idea of what might be going on here: borgmatic 1.5.5 started de-duplicating source directories to prevent Borg from scanning the same source directories twice, which can cause hangs in certain cases. So for instance, source directories of `/foo` and `/foo/bar` would get de-duplicated down to just `/foo`.. because `/foo` contains `/foo/bar`, and therefore Borg will implicitly backup both. Something similiar is going on here: `/` contains `/media/ssd`, and so borgmatic is de-duplicating that down to just `/`. Now it sounds like that might be problematic because you have `one_file_system` set to `true` (a totally legitimate setting to have), and therefore Borg doesn't traverse from `/` to `/media/ssd` when scanning for files. I assume that your backup archives contained the contents of `/media/ssd` before borgmatic 1.5.5, and `/media/ssd` is missing from archives afterwards? I'm just trying to understand how `one_file_system` interacts with multiple Borg source directories. Thanks.
witten added the
bug
label 2020-06-19 18:20:29 +00:00
Author

Wow, fastest issue reply ever :) Thanks for that.

Yes, I confirm having /media/ssd in earlier backups.

Wow, fastest issue reply ever :) Thanks for that. Yes, I confirm having /media/ssd in earlier backups.
Owner

If only the implementation of the fix could be so speedy! I'll have to think about what I can do here without regressing #316.

If only the implementation of the fix could be so speedy! I'll have to think about what I can do here without regressing #316.
witten added the
data loss
label 2020-06-19 19:25:09 +00:00
Owner

Okay, I've got an apparent fix in master. borgmatic now checks if two source directories are on the same filesystem before trying to de-duplicate them. If they're on different filesystems, as is the case with your first example, then borgmatic passes both of them to Borg.

Thanks again for bringing this to my attention. I'll add a note here when there's a release with this fix.

same problem with this config:

source_directories:
    - /media/xps2
    - /media/xps2/Pictures
    - /media/xps2/images

A question about this. Are /media/xps2 and its sub-directories on the same filesystem? In any case, I would expect borgmatic 1.5.5/1.5.6 to de-duplicate them down to just /media/xps2 when passing them to Borg. But if they are all on the same filesystem, then Borg should implicitly backup both /media/xps2 and all of its sub-directories.

Is that consistent with what you're seeing in the resulting archive? For instance, is /media/xps2/Pictures present there?

Okay, I've got an apparent fix in master. borgmatic now checks if two source directories are on the same filesystem before trying to de-duplicate them. If they're on different filesystems, as is the case with your first example, then borgmatic passes both of them to Borg. Thanks again for bringing this to my attention. I'll add a note here when there's a release with this fix. > same problem with this config: > > source_directories: > - /media/xps2 > - /media/xps2/Pictures > - /media/xps2/images A question about this. Are `/media/xps2` and its sub-directories on the same filesystem? In any case, I would expect borgmatic 1.5.5/1.5.6 to de-duplicate them down to just `/media/xps2` when passing them to Borg. But if they are all on the same filesystem, then Borg *should* implicitly backup both `/media/xps2` and all of its sub-directories. Is that consistent with what you're seeing in the resulting archive? For instance, is `/media/xps2/Pictures` present there?
Author

Hey,
Thank you also for trying to fix this so quickly and also for this amazing wrapper :)
/media/xps2 = ext4 fs
/media/xps2/Pictures and /media/xps2/images = encfs mounts. So they should be considered different filesystems.
Once you have a release with this fix i can test both cases.
/media/xps2/Pictures is present but empty in the faulty backups.

Hey, Thank you also for trying to fix this so quickly and also for this amazing wrapper :) /media/xps2 = ext4 fs /media/xps2/Pictures and /media/xps2/images = encfs mounts. So they should be considered different filesystems. Once you have a release with this fix i can test both cases. /media/xps2/Pictures is present but empty in the faulty backups.
Owner

Great, that sounds like that case should be handled!

Great, that sounds like that case should be handled!
Owner

I'll add a note here when the fix is released (hopefully soon!).

I'll add a note here when the fix is released (hopefully soon!).
Owner

Released in borgmatic 1.5.7!

Released in borgmatic 1.5.7!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#333
No description provided.