ZFS dataset is treated as a different filesystem - careful with option 'one_file_system' #570

Closed
opened 2022-07-30 19:00:47 +00:00 by zenlord · 5 comments

What I'm trying to do and why

Never waste a good crisis: I had to restore data from my borgmatic-backups and came to the conclusion that the contents of the /home// folders had not been included in the backup.

Steps to reproduce (if a bug)

My config file (or extracts from):

location:
  source_directories:
    [...]
  - /home

repositories:
  - xxx.repo.borgbase.com:repo

exclude_patterns:
  - /home/*/.cache/
  - /home/*/.zfs/

one_file_system: true
exclude_caches: true

Actual behavior (if a bug)

The archives contain all source_directories, and the contents is complete, with the exception of the /home directory: this directory only includes the 'first depth' directories, not the contents.

I have been reading up on the 'borg help patterns', and even tried to experiment with "borg create --dry-run", but I cannot find the root cause for this missing data in my archives?

Environment

borgmatic version:
# borgmatic --version
1.5.13.dev0
# apt policy borgmatic
borgmatic:
Geïnstalleerd: 1.5.12-2
Kandidaat: 1.5.12-2
Versietabel:
*** 1.5.12-2 500

borgmatic installation method:
Debian package (bullseye)

Borg version:
# borg --version
borg 1.1.16

Python version:
# python3 --version
Python 3.9.2

Database version (if applicable):
N/A

operating system and version:
Debian Bullseye (up-to-date)

#### What I'm trying to do and why Never waste a good crisis: I had to restore data from my borgmatic-backups and came to the conclusion that the contents of the /home/<usernames>/ folders had not been included in the backup. #### Steps to reproduce (if a bug) My config file (or extracts from): location: source_directories: [...] - /home repositories: - xxx.repo.borgbase.com:repo exclude_patterns: - /home/*/.cache/ - /home/*/.zfs/ one_file_system: true exclude_caches: true #### Actual behavior (if a bug) The archives contain all source_directories, and the contents is complete, with the exception of the /home directory: this directory only includes the 'first depth' directories, not the contents. I have been reading up on the 'borg help patterns', and even tried to experiment with "borg create --dry-run", but I cannot find the root cause for this missing data in my archives? #### Environment **borgmatic version:** # borgmatic --version 1.5.13.dev0 # apt policy borgmatic borgmatic: Geïnstalleerd: 1.5.12-2 Kandidaat: 1.5.12-2 Versietabel: *** 1.5.12-2 500 **borgmatic installation method:** Debian package (bullseye) **Borg version:** # borg --version borg 1.1.16 **Python version:** # python3 --version Python 3.9.2 **Database version (if applicable):** N/A **operating system and version:** Debian Bullseye (up-to-date)
Owner

Looking at your configuration, I'm not sure what's going on.. I have similar glob excludes in my own configuration, and they appear to work as expected. A few thoughts though:

  • Is this issue reproducible by just running Borg by itself without borgmatic? You can run borgmatic --verbosity 2 to get most of the borg command-line, although that won't show you the excludes in particular, because those are passed in via a separate temporary file.
  • one_file_system: true is making my spidey sense tingle. Is /home mounted on a different filesystem, perhaps?
  • How are you inspecting the contents of the archive to see whether the /home contents are present? Something like borgmatic list --archive latest?
  • It looks like you're using a two-year-old version of borgmatic. I recommend upgrading if you can!
Looking at your configuration, I'm not sure what's going on.. I have similar glob excludes in my own configuration, and they appear to work as expected. A few thoughts though: * Is this issue reproducible by just running Borg by itself without borgmatic? You can run `borgmatic --verbosity 2` to get most of the `borg` command-line, although that won't show you the excludes in particular, because those are passed in via a separate temporary file. * `one_file_system: true` is making my spidey sense tingle. Is `/home` mounted on a different filesystem, perhaps? * How are you inspecting the contents of the archive to see whether the `/home` contents are present? Something like `borgmatic list --archive latest`? * It looks like you're using a two-year-old version of borgmatic. I recommend upgrading if you can!
witten added the
question / support
label 2022-08-01 17:03:37 +00:00
Author

Thank you for your fast response!

1: I'll try that tomorrow evening and report back
2: I had the same hunch (and appreciate the Spiderman refrence :p)- /home is a dataset in a ZFS pool, just like /share, but the difference is that I have created a separate dataset for each of the users inside /home. All of them are however local filesystems
3: No, I first used a 'borgmatic extract' command and once I noticed the data was missing, I also used 'borgmatic mount' with several archives.
4: well noted. I try to stick as much as possible to the stable repository, but principles are there to be broken, I guess.

Thank you for your fast response! 1: I'll try that tomorrow evening and report back 2: I had the same hunch (and appreciate the Spiderman refrence :p)- /home is a dataset in a ZFS pool, just like /share, but the difference is that I have created a separate dataset for each of the users inside /home. All of them are however local filesystems 3: No, I first used a 'borgmatic extract' command and once I noticed the data was missing, I also used 'borgmatic mount' with several archives. 4: well noted. I try to stick as much as possible to the stable repository, but principles are there to be broken, I guess.
Owner

2: I had the same hunch (and appreciate the Spiderman refrence :p)- /home is a dataset in a ZFS pool, just like /share, but the difference is that I have created a separate dataset for each of the users inside /home. All of them are however local filesystems

Interesting. I'm not super familiar with ZFS, but I'd bet that a mounted ZFS pool is treated as a separate filesystem by Borg, and therefore one_file_system is preventing Borg from backing up anything in /home. Have you tried setting one_file_system to false to see if that "fixes" the problem of /home contents not getting included?

3: No, I first used a 'borgmatic extract' command and once I noticed the data was missing, I also used 'borgmatic mount' with several archives.

Either of those seems like a reliable away to test archive contents.

> 2: I had the same hunch (and appreciate the Spiderman refrence :p)- /home is a dataset in a ZFS pool, just like /share, but the difference is that I have created a separate dataset for each of the users inside /home. All of them are however local filesystems Interesting. I'm not super familiar with ZFS, but I'd bet that a mounted ZFS pool is treated as a separate filesystem by Borg, and therefore `one_file_system` is preventing Borg from backing up anything in `/home`. Have you tried setting `one_file_system` to `false` to see if that "fixes" the problem of `/home` contents not getting included? > 3: No, I first used a 'borgmatic extract' command and once I noticed the data was missing, I also used 'borgmatic mount' with several archives. Either of those seems like a reliable away to test archive contents.
Author

Interesting. I'm not super familiar with ZFS, but I'd bet that a mounted ZFS pool is treated as a separate filesystem by Borg, and therefore one_file_system is preventing Borg from backing up anything in /home. Have you tried setting one_file_system to false to see if that "fixes" the problem of /home contents not getting included?

That did the trick - I have changed the configuration and the latest archive indeed contains the contents of the /home/ source_location.
I'll edit the title of this issue for future reference, and this can be closed.

Thank you!!
(and I promise, from now on, to test my backup archives periodically - "with great power comes great responsibility" ;))

> Interesting. I'm not super familiar with ZFS, but I'd bet that a mounted ZFS pool is treated as a separate filesystem by Borg, and therefore `one_file_system` is preventing Borg from backing up anything in `/home`. Have you tried setting `one_file_system` to `false` to see if that "fixes" the problem of `/home` contents not getting included? That did the trick - I have changed the configuration and the latest archive indeed contains the contents of the /home/ source_location. I'll edit the title of this issue for future reference, and this can be closed. Thank you!! (and I promise, from now on, to test my backup archives periodically - "with great power comes great responsibility" ;))
zenlord changed title from Missing data in archive: Confused by exclude_patterns? to ZFS dataset is treated as a different filesystem - careful with option 'one_file_system' 2022-08-02 13:19:06 +00:00
Owner

I'm glad to hear that did it!

I'm glad to hear that did it!
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#570
No description provided.