rsync block devices?

Discussion in 'Proxmox VE 1.x: Installation and configuration' started by senorsmile, Sep 15, 2010.

  1. senorsmile

    senorsmile New Member

    Jul 23, 2010
    Likes Received:
    I have done a little testing with a particular backup procedure and haven't had any problems, but I would like to get input from others.

    I have a two node proxmox cluster currently running on 1.5. I have each server running with drbd primary:primary with lvm2 for the vm disks. I have all kvm guests. The most important vm running is running windows server 2008 with microsoft sql. I have made a few tests backing up like this:

    take snapshot, use kpartx to recognize partitions in the snapshotted disk and mount it using -o force since the ntfs disk wasn't cleanly shut down.
    lvcreate -L 10G -s -n eec_snapshot /dev/drbdvg/vm-103-disk-1 && \
    kpartx -av /dev/drbdvg/eec_snapshot && \
    ntfs-3g /dev/mapper/drbdvg-eec_snapshot1 /mnt/eec_snapshot/ -o force
    I then do an rsync excluding the hiberfil.sys and pagefile.sys files
    rsync \
    --delete \
    --progress \
    -azvv \
    --partial \
    --stats \
    --exclude="hiberfil.sys" \
    --exclude="pagefile.sys" \
    /mnt/eec_snapshot/ \
    I then umount the snapshot, remove the kpartx bindings and remove the snapshot.
    umount /mnt/eec_snapshot/
    kpartx -d /dev/mapper/drbdvg-eec_snapshot
    lvremove --force /dev/mapper/drbdvg-eec_snapshot
    This has seemed to work so far. If I boot this backed up partition in a new vm it boots and goes through chkdsk etc. All data SEEMS to be intact. The real question is: does using rsync transfer the files correctly and will this ever damage the sql databases such that they would be unusable?

    The reason I don't just take a daily backup is that ideally I need this backup to by offsite. So, mounting the remote image and simply syncing any changes between the two disks would take much less bandwidth. Unless, of course, there is any way to simply sync the two partitions at the block level using some sort of rsync(i.e. only changed blocks) type program.

    Any thoughts?
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice