[lxc-devel] Error restoring snapshots on btrfs

John Peacock jpeacock at messagesystems.com
Thu Jan 9 20:01:34 UTC 2014


I created a snapshot on a btrfs filesystem and lxc-snapshot correctly
created a btrfs subvolume snapshot.  However when restoring the
snapshot, I got this instead:


> $ sudo lxc-snapshot -n rh65-dev -r snap0
> rsync: writefd_unbuffered failed to write 4 bytes to socket [generator]: Broken pipe (32)
> rsync error: error in rsync protocol data stream (code 12) at io.c(1532) [generator=3.0.9]
> lxc_container: rsyncing /var/lib/lxc/containersnaps/rh65-dev/snap0/rootfs to /var/lib/lxc/container/rh65-dev/rootfs
> 
> lxc_container: Error copying storage
> lxc_container: _recursive_rmdir_onedev: failed to delete /var/lib/lxc/container/rh65-dev
> lxc_container: Error destroying container directory for rh65-dev
> lxc_container: Error restoring snapshot snap0

There are a couple of problems with that:

1) lxc-snapshot is using rsync and not the btrfs snapshot tool, e.g.

btrfs sub del fs
btrfs sub snap snapshot fs
btrfs sub del snapshot

2) lxc-snapshot has now deleted the original filesystem (it doesn't show up in the subvolume
list) in such a way that I can no longer restore to the same path:

> # rm -r /var/lib/lxc/container/rh65-dev/rootfs
> rm: cannot remove ‘/var/lib/lxc/container/rh65-dev/rootfs’: Operation not permitted

I'm not really sure how that was accomplished.

John

-- 
JOHN PEACOCK
senior software build and release engineer
www.messagesystems.com
twitter @MessageSystems

tel 410-872-4910 x239
email john.peacock at messagesystems.com


More information about the lxc-devel mailing list