Advertisement
peetaur

Ceph incremental backup

Oct 23rd, 2013
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.05 KB | None | 0 0
  1. This is based on http://ceph.com/dev-notes/incremental-snapshots-with-rbd/ which is incomplete (missing the initial send step).
  2.  
  3.     make sure there is an rbd to mount (-l also lists snapshots/clones):
  4.         rbd ls -l
  5.        
  6.     put some files there (this assumes it is already mounted)::
  7.         cd /mnt/ceph/foo/
  8.         echo snapshot test file1 - before snapshots > snaptest1
  9.        
  10.     snapshot it as "snap1":
  11.         rbd snap create rbd/foo@snap1
  12.        
  13.     clone it to another new rbd:
  14.         # unlike "import", "import-diff" does not create an image automatically, so we create one first
  15.         sudo rbd create foo-bak --size 4096
  16.         rbd export-diff rbd/foo@snap1 - | rbd import-diff - rbd/foo-bak
  17.    
  18.     put more files there:
  19.         echo snapshot test file2, with first snap already done > snaptest2
  20.    
  21.     snapshot it snap2:
  22.         rbd snap create rbd/foo@snap2
  23.    
  24.     do the export and import the changes to the other rbd
  25.  
  26.         rbd export-diff --from-snap snap1 rbd/foo@snap2 - | rbd import-diff - rbd/foo-bak
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement