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

btrbk fails on empty target subvolume #4

Closed
grondinm opened this issue Mar 20, 2015 · 8 comments
Closed

btrbk fails on empty target subvolume #4

grondinm opened this issue Mar 20, 2015 · 8 comments
Assignees
Labels

Comments

@grondinm
Copy link

I'm pretty sure i have everything setup right so here is the problem:

config file:

cat /etc/btrbk/btrbk.conf.example

snapshot_dir @BackuPs

snapshot_create_always yes

incremental no

preserve_day_of_week sunday

snapshot_preserve_daily all
snapshot_preserve_weekly 4
snapshot_preserve_monthly 1

target_preserve_daily all
target_preserve_weekly 4
target_preserve_monthly 1

btrfs_commit_delete after

receive_log no

volume /mnt/btrfsroot
subvolume @Home
target send-receive /media/Storage3/@HomeSnaps

btrfs subvolume list /media/Storage3/@HomeSnaps
ID 5683 gen 51069 top level 5 path @HomeSnaps
btrfs subvolume show /media/Storage3/@HomeSnaps
/media/Storage3/@HomeSnaps
Name: @HomeSnaps
uuid: 1bb1ed43-5c5d-7542-9a6e-87b36eae5f48
Parent uuid: -
Creation time: 2015-03-19 17:43:48
Object ID: 5683
Generation (Gen): 51069
Gen at creation: 51069
Parent: 5
Top Level: 5
Flags: -
Snapshot(s):

btrbk -c /etc/btrbk/btrbk.conf.example dryrun
WARNING: Skipping target: Failed to read btrfs subvolume list for "/media/Storage3/@HomeSnaps"

WARNING: Skipping cleanup of snapshots for subvolume "/mnt/btrfsroot/@Home", as at least one target aborted earlier

Backup Summary (btrbk command line client, version 0.13)

Date:   Fri Mar 20 12:24:14 2015
Config: /etc/btrbk/btrbk.conf.example

/mnt/btrfsroot/@Home
+++ /mnt/btrfsroot/@Backups/@Home.20150320
!!! Target "/media/Storage3/@HomeSnaps" aborted: Failed to read btrfs subvolume list for "/media/Storage3/@HomeSnaps"

NOTE: Some errors occurred, which may result in missing backups!
Please check warning and error messages above.

NOTE: Dryrun was active, none of the operations above were actually executed!

i've tried creating the subvol with and without @. At first i was creating it at /media/Storage3/Backup/HomeSnaps but even moving it to the root of the FS i have the same problem. I am using arch linux with kernel 3.19.1-1-ck and btrfs-progs v3.19. Is it something i am doing wrong or a bug?

@digint
Copy link
Owner

digint commented Mar 20, 2015

Is /media/Storage3/@HomeSnaps already present on your filesystem? Note that btrbk does not create the backup target subvolume (as well as the snapshot directory specified by snapshot_dir).
If it is not, run btrfs subvolume create /media/Storage3/@HomeSnaps prior to running btrbk.

If it is already present, you might have found a bug. Could you please re-run btrbk with debug output enabled:

btrbk -l debug -c /etc/btrbk/btrbk.conf.example dryrun > /tmp/btrbk_debug.log

@digint digint self-assigned this Mar 20, 2015
@grondinm
Copy link
Author

haha i was already running with debug on when you posted your reply. Here is the output:

btrbk -c /etc/btrbk/btrbk.conf.example -l debug dryrun
btrbk command line client, version 0.13 (Fri Mar 20 12:53:54 2015)
config: parsing file: /etc/btrbk/btrbk.conf.example
config: adding option "snapshot_dir=@Backups/" to root context
config: adding option "snapshot_create_always=yes" to root context
config: adding option "incremental=no" to root context
config: adding option "preserve_day_of_week=sunday" to root context
config: adding option "snapshot_preserve_daily=all" to root context
config: adding option "snapshot_preserve_weekly=4" to root context
config: adding option "snapshot_preserve_monthly=1" to root context
config: adding option "target_preserve_daily=all" to root context
config: adding option "target_preserve_weekly=4" to root context
config: adding option "target_preserve_monthly=1" to root context
config: adding option "btrfs_commit_delete=after" to root context
config: adding option "receive_log=no" to root context
config: context forced to: root
config: adding volume "/mnt/btrfsroot" to root context
config: adding subvolume "@Home" to volume context: /mnt/btrfsroot
config: adding target "/media/Storage3/@HomeSnaps" (type=send-receive) to subvolume context: /mnt/btrfsroot/@Home

/sbin/btrfs subvolume show /mnt/btrfsroot 2>/dev/null

Command execution successful
found btrfs root: /mnt/btrfsroot

/sbin/btrfs subvolume list -a -c -u -q -R /mnt/btrfsroot

Command execution successful
parsed 3 total subvolumes for filesystem at: /mnt/btrfsroot

/sbin/btrfs subvolume show /media/Storage3/@HomeSnaps 2>/dev/null

Command execution successful
parsed 10 subvolume detail items: /media/Storage3/@HomeSnaps

/sbin/btrfs subvolume list -a -c -u -q -R /media/Storage3/@HomeSnaps

Command execution successful
parsed 1 total subvolumes for filesystem at: /media/Storage3/@HomeSnaps
No subvolumes found in: /media/Storage3/@HomeSnaps
WARNING: Skipping target: Failed to read btrfs subvolume list for "/media/Storage3/@HomeSnaps"
Creating subvolume snapshot for: /mnt/btrfsroot/@Home
[btrfs] snapshot (ro):
[btrfs] source: /mnt/btrfsroot/@Home
[btrfs] target: /mnt/btrfsroot/@Backups/@Home.20150320

/mnt/btrfsroot/@Backups/@Home.20150320

(dryrun) /sbin/btrfs subvolume snapshot -r /mnt/btrfsroot/@Home /mnt/btrfsroot/@Backups/@Home.20150320

WARNING: Skipping cleanup of snapshots for subvolume "/mnt/btrfsroot/@Home", as at least one target aborted earlier

Completed within: 0s (Fri Mar 20 12:53:54 2015)

Backup Summary (btrbk command line client, version 0.13)

Date:   Fri Mar 20 12:53:54 2015
Config: /etc/btrbk/btrbk.conf.example

/mnt/btrfsroot/@Home
+++ /mnt/btrfsroot/@Backups/@Home.20150320
!!! Target "/media/Storage3/@HomeSnaps" aborted: Failed to read btrfs subvolume list for "/media/Storage3/@HomeSnaps"

NOTE: Some errors occurred, which may result in missing backups!
Please check warning and error messages above.

NOTE: Dryrun was active, none of the operations above were actually executed!

And the output of the command that executes just before the failure in case it is to blame...
http://pastebin.com/GW6taHKh

Had to put it in pasetbin since git was removing part of the output...

@digint
Copy link
Owner

digint commented Mar 20, 2015

Thanks, I identified a bug introduced in commit: 14e675b

btrbk now has problems with empty backup subvolumes. As a workaround, simply create a dummy subvolume:

btrfs subvolume create /media/Storage3/@HomeSnaps/dummy

...while I'm fixing...

@digint digint added the bug label Mar 20, 2015
@grondinm
Copy link
Author

great thank you

@digint digint changed the title Failed to read btrfs subvolume list for btrbk fails on empty target subvolume Mar 20, 2015
@digint
Copy link
Owner

digint commented Mar 20, 2015

fixed in d17d0ab

@digint
Copy link
Owner

digint commented Mar 20, 2015

fixed in btrbk v0.14

@digint digint closed this as completed Mar 20, 2015
@grondinm
Copy link
Author

Thank you for moving so quick on this.

@digint
Copy link
Owner

digint commented Mar 20, 2015

It's always nice to see that other people are also using btrbk. I hope it turns out to be useful for you as it is for me! Don't hesitate to create feature requests or ask for help, every feedback helps me improving this project.
Also don't forget to "star" this project if you like it, so that other people can find it more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants