Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is my configuration wrong? I keep getting snapshots in the wrong folder #575

Open
msmafra opened this issue Dec 6, 2023 · 6 comments
Open

Comments

@msmafra
Copy link

msmafra commented Dec 6, 2023

What I think it should be doing is putting the snapshots inside /btrfs_pool/btrbk_snapshots, but its sending some also to /btrfs_pool/ instead.
My config

transaction_log            /var/log/btrbk_timemachine.log
lockfile                   /var/lock/btrbk_timemachine.lock
timestamp_format           long-iso
backend_local_user         btrfs-progs-doas
#stream_buffer              64m
btrfs_commit_delete        yes
#
# Snapshots rules
snapshot_preserve_min      latest
snapshot_preserve          3d 1w
# Set archiving rules
archive_preserve_min       latest
archive_preserve           6d 4w 6m

incremental_prefs          "defaults,sao,san,aro,arn"
incremental_clones         yes
incremental                yes

#preserve_hour_of_day       0
#preserve_day_of_week       sunday


# Where the subvolumes are
# home/personal data
volume /btrfs_pool
group fullsystem
  snapshot_dir btrbk_snapshots
  snapshot_create onchange
  subvolume home
  subvolume root
# Archive
# Backups destination
volume /btrfs_pool
group fullsystem
#   snapshot_create onchange
#   snapshot_dir btrbk_snapshots
  target_preserve_min        latest
  target_preserve            6d 3w 2m
  subvolume                  home
  subvolume                  root
  target send-receive        /btrbk_backups

btrbk-maybe-bug-2023-12-06_11-47

I'm on Fedora 39 Workstation

@RustyNova016
Copy link

Maybe try a full path instead?

@msmafra
Copy link
Author

msmafra commented Jan 25, 2024

Maybe try a full path instead?

Sorry about the delay.
I imagine that is a bug since it is putting the backups inside and outside that volume. Trying with the full path gives me errors since /btrfs_pool is already at / and /btrfs_pool/btrbk_snapshots will point to a folder inside that sub-volume.

WARNING: Skipping subvolume "/btrfs_pool/btrbk_snapshots/home": Failed to fetch subvolume detail
WARNING: ... Command execution failed (exitcode=1)
WARNING: ... sh: readlink -v -e '/btrfs_pool/btrbk_snapshots/home'
WARNING: ... readlink: /btrfs_pool/btrbk_snapshots/home: No such file or directory
WARNING: Skipping subvolume "/btrfs_pool/btrbk_snapshots/root": Failed to fetch subvolume detail
WARNING: ... Command execution failed (exitcode=1)
WARNING: ... sh: readlink -v -e '/btrfs_pool/btrbk_snapshots/root'
WARNING: ... readlink: /btrfs_pool/btrbk_snapshots/root: No such file or directory
WARNING: Skipping subvolume "/btrfs_pool/btrbk_snapshots/home": Failed to fetch subvolume detail
WARNING: Skipping subvolume "/btrfs_pool/btrbk_snapshots/root": Failed to fetch subvolume detail
TRANSACTION LOG
---------------
TYPE             STATUS   TARGET_SUBVOLUME                  SOURCE_SUBVOLUME  PARENT_SUBVOLUME
startup          v0.32.6  -                                 -                 -
abort_subvolume  ABORT    /btrfs_pool/btrbk_snapshots/home  -                 -
abort_subvolume  ABORT    /btrfs_pool/btrbk_snapshots/root  -                 -
abort_subvolume  ABORT    /btrfs_pool/btrbk_snapshots/home  -                 -
abort_subvolume  ABORT    /btrfs_pool/btrbk_snapshots/root  -                 -
finished         partial  -    

@msmafra
Copy link
Author

msmafra commented Jan 25, 2024

My system is using a /home and /root btrfs subvolumes structure. I mount subvolid=5 in /btrbk_pool for the snapshots.

❯ tree -dx /btrfs_pool/
/btrfs_pool/
├── btrbk_snapshots
│   ├── home.20240122T180001-0300
│   ├── home.20240123T000002-0300
│   ├── home.20240124T000002-0300
│   ├── home.20240124T020001-0300
│   ├── root.20240122T180001-0300
│   ├── root.20240123T000002-0300
│   ├── root.20240124T000002-0300
│   └── root.20240124T020001-0300
├── home
├── home.20240122T180001-0300
├── home.20240123T000002-0300
├── home.20240124T000002-0300
├── home.20240124T020001-0300
├── root
├── root.20240122T180001-0300
├── root.20240123T000002-0300
├── root.20240124T000002-0300
└── root.20240124T020001-0300

20 directories

My timemachine.conf file

# Globals (??)
transaction_log            /var/log/btrbk_timemachine.log
lockfile                   /var/lock/btrbk_timemachine.lock
timestamp_format           long-iso
backend_local_user         btrfs-progs-doas
#stream_buffer              64m
btrfs_commit_delete        yes
#
# Snapshots rules
snapshot_preserve_min      latest
snapshot_preserve          3d 1w
# Set archiving rules
archive_preserve_min       latest
archive_preserve           6d 4w 6m

incremental_prefs          "defaults,sao,san,aro,arn"
incremental_clones         yes
incremental                yes

#preserve_hour_of_day       0
#preserve_day_of_week       sunday


# Where the subvolumes are
# home/personal data
volume /btrfs_pool
group fullsystem
  snapshot_dir btrbk_snapshots
  snapshot_create onchange
  subvolume home
  subvolume root
# Archive
# Backups destination
volume /btrfs_pool
group fullsystem
  snapshot_create onchange
  # snapshot_dir btrbk_snapshots
  target_preserve_min        latest
  target_preserve            6d 3w 2m
  subvolume                  home
  subvolume                  root
  target send-receive        /btrbk_backups/

Running it for testing purposes:

❯ doas btrbk dryrun --config=/home/marcelo/Projects/rest-o/btrbk_timemachine.conf --progress --format=table
TRANSACTION LOG
---------------
TYPE             STATUS          TARGET_SUBVOLUME                                       SOURCE_SUBVOLUME                       PARENT_SUBVOLUME
startup          v0.32.6         -                                                      -                                      -
snapshot         dryrun_success  /btrfs_pool/btrbk_snapshots/home.20240125T104616-0300  /btrfs_pool/home                       -
snapshot         dryrun_success  /btrfs_pool/btrbk_snapshots/root.20240125T104616-0300  /btrfs_pool/root                       -
snapshot         dryrun_success  /btrfs_pool/home.20240125T104616-0300                  /btrfs_pool/home                       -
snapshot         dryrun_success  /btrfs_pool/root.20240125T104616-0300                  /btrfs_pool/root                       -
send-receive     dryrun_success  /btrbk_backups/root.20240125T104616-0300               /btrfs_pool/root.20240125T104616-0300  /btrfs_pool/root.20240124T000002-0300
delete_snapshot  dryrun_success  /btrfs_pool/btrbk_snapshots/home.20240124T020001-0300  -                                      -
delete_snapshot  dryrun_success  /btrfs_pool/btrbk_snapshots/root.20240124T020001-0300  -                                      -
delete_snapshot  dryrun_success  /btrfs_pool/home.20240124T020001-0300                  -                                      -
delete_snapshot  dryrun_success  /btrfs_pool/root.20240124T020001-0300                  -                                      -
finished         success         -                                                      -                                      -

@msmafra
Copy link
Author

msmafra commented Jan 25, 2024

Making some changes to the configuration seems to solve it (I think). At least the dry run seems to be correct:

# Globals (??)
transaction_log            /var/log/btrbk_timemachine.log
lockfile                   /var/lock/btrbk_timemachine.lock
timestamp_format           long-iso
backend_local_user         btrfs-progs-doas
#stream_buffer              64m
btrfs_commit_delete        yes
#
# Snapshots rules
snapshot_preserve_min      latest
snapshot_preserve          3d 1w
# Set archiving rules
archive_preserve_min       latest
archive_preserve           6d 4w 6m

incremental_prefs          "defaults,sao,san,aro,arn"
incremental_clones         yes
incremental                yes

#preserve_hour_of_day       0
#preserve_day_of_week       sunday


# Where the subvolumes are
# home/personal data
volume /btrfs_pool
group home_snapshots
  snapshot_dir btrbk_snapshots
  snapshot_create onchange
  subvolume home
    snapshot_name homesnaped
# root no home
volume /btrfs_pool
group root_snapshots
  snapshot_dir btrbk_snapshots
  snapshot_create onchange
  subvolume root
    snapshot_name rootsnaped
# Archive
# Backups destination
volume /btrfs_pool
group fullsystem
  snapshot_create onchange
  snapshot_dir btrbk_snapshots
  target_preserve_min        latest
  target_preserve            6d 3w 2m
  subvolume                  home
  subvolume                  root
  target send-receive        /btrbk_backups/

❯ doas btrbk dryrun --config=/home/marcelo/Projects/rest-o/btrbk_timemachine.conf --progress --format=table
TRANSACTION LOG
---------------
TYPE             STATUS          TARGET_SUBVOLUME                                             SOURCE_SUBVOLUME                                       PARENT_SUBVOLUME
startup          v0.32.6         -                                                            -                                                      -
snapshot         dryrun_success  /btrfs_pool/btrbk_snapshots/homesnaped.20240125T111212-0300  /btrfs_pool/home                                       -
snapshot         dryrun_success  /btrfs_pool/btrbk_snapshots/rootsnaped.20240125T111212-0300  /btrfs_pool/root                                       -
snapshot         dryrun_success  /btrfs_pool/btrbk_snapshots/home.20240125T111212-0300        /btrfs_pool/home                                       -
snapshot         dryrun_success  /btrfs_pool/btrbk_snapshots/root.20240125T111212-0300        /btrfs_pool/root                                       -
send-receive     dryrun_success  /btrbk_backups/root.20240122T180001-0300                     /btrfs_pool/btrbk_snapshots/root.20240122T180001-0300  -
send-receive     dryrun_success  /btrbk_backups/root.20240123T000002-0300                     /btrfs_pool/btrbk_snapshots/root.20240123T000002-0300  /btrfs_pool/btrbk_snapshots/root.20240122T180001-0300
send-receive     dryrun_success  /btrbk_backups/root.20240124T020001-0300                     /btrfs_pool/btrbk_snapshots/root.20240124T020001-0300  /btrfs_pool/btrbk_snapshots/root.20240123T000002-0300
send-receive     dryrun_success  /btrbk_backups/root.20240125T111212-0300                     /btrfs_pool/btrbk_snapshots/root.20240125T111212-0300  /btrfs_pool/btrbk_snapshots/root.20240124T020001-0300
delete_snapshot  dryrun_success  /btrfs_pool/btrbk_snapshots/home.20240124T020001-0300        -                                                      -
finished         success         -

@msmafra
Copy link
Author

msmafra commented Jan 25, 2024

Seems that that fixed it

❯ doas btrbk run --config=/home/marcelo/Projects/rest-o/btrbk_timemachine.conf --progress --format=table
Creating backup: /btrbk_backups/root.20240122T180001-0300
in @  0.0 kiB/s, out @  328 MiB/s, 26.8 GiB total, buffer   1% full
summary: 26.8 GiByte in  7min 55.5sec - average of 57.7 MiB/s
Creating backup: /btrbk_backups/root.20240123T000002-0300
in @  0.0 kiB/s, out @  0.0 kiB/s,  0.0 kiB total, buffer   6% full
summary: 18.0 MiByte in 11.9sec - average of 1543 kiB/s
Creating backup: /btrbk_backups/root.20240124T020001-0300
in @  0.0 kiB/s, out @ 63.9 MiB/s, 3180 MiB total, buffer   6% full
summary: 3201 MiByte in  1min 38.3sec - average of 32.6 MiB/s
Creating backup: /btrbk_backups/root.20240125T112454-0300
in @  0.0 kiB/s, out @ 12.0 MiB/s, 1716 MiB total, buffer   1% full
summary: 1719 MiByte in  1min 08.9sec - average of 24.9 MiB/s
TRANSACTION LOG
---------------
TYPE             STATUS   TARGET_SUBVOLUME                                             SOURCE_SUBVOLUME                                       PARENT_SUBVOLUME
startup          v0.32.6  -                                                            -                                                      -
snapshot         success  /btrfs_pool/btrbk_snapshots/homesnaped.20240125T112454-0300  /btrfs_pool/home                                       -
snapshot         success  /btrfs_pool/btrbk_snapshots/rootsnaped.20240125T112454-0300  /btrfs_pool/root                                       -
snapshot         success  /btrfs_pool/btrbk_snapshots/home.20240125T112454-0300        /btrfs_pool/home                                       -
snapshot         success  /btrfs_pool/btrbk_snapshots/root.20240125T112454-0300        /btrfs_pool/root                                       -
send-receive     success  /btrbk_backups/root.20240122T180001-0300                     /btrfs_pool/btrbk_snapshots/root.20240122T180001-0300  -
send-receive     success  /btrbk_backups/root.20240123T000002-0300                     /btrfs_pool/btrbk_snapshots/root.20240123T000002-0300  /btrfs_pool/btrbk_snapshots/root.20240122T180001-0300
send-receive     success  /btrbk_backups/root.20240124T020001-0300                     /btrfs_pool/btrbk_snapshots/root.20240124T020001-0300  /btrfs_pool/btrbk_snapshots/root.20240123T000002-0300
send-receive     success  /btrbk_backups/root.20240125T112454-0300                     /btrfs_pool/btrbk_snapshots/root.20240125T112454-0300  /btrfs_pool/btrbk_snapshots/root.20240124T020001-0300
delete_snapshot  success  /btrfs_pool/btrbk_snapshots/home.20240124T020001-0300        -                                                      -
finished         success  -                                                            -                                                      -

/btrfs_pool🔒 took 13m58s
 .858ns fsh ❯ doas btrbk snapshot --config=/home/marcelo/Projects/rest-o/btrbk_timemachine.conf --progress --format=table
TRANSACTION LOG
---------------
TYPE      STATUS   TARGET_SUBVOLUME                                             SOURCE_SUBVOLUME  PARENT_SUBVOLUME
startup   v0.32.6  -                                                            -                 -
snapshot  success  /btrfs_pool/btrbk_snapshots/homesnaped.20240125T114223-0300  /btrfs_pool/home  -
snapshot  success  /btrfs_pool/btrbk_snapshots/rootsnaped.20240125T114223-0300  /btrfs_pool/root  -
snapshot  success  /btrfs_pool/btrbk_snapshots/home.20240125T114223-0300        /btrfs_pool/home  -
snapshot  success  /btrfs_pool/btrbk_snapshots/root.20240125T114223-0300        /btrfs_pool/root  -
finished  success  -                                                            -                 -

@msmafra msmafra closed this as completed Jan 25, 2024
@msmafra
Copy link
Author

msmafra commented Feb 5, 2024

It actually did not solved. If really had read my own post, the only thing that happened was the renaming of the snapshot.

@msmafra msmafra reopened this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants