On 07/24/2012 06:28 AM, Bastian Friedrich wrote:
> Hi,
>
> we are using Bacula's raw block device backup features for backing up virtual
> machines that use raw devices (logical volumes, or DRBD) as their storage. As
> advised by the bacula documentation (obviously, for the purpose of sparing
> storage space), we set "sparse = yes" for the respective file sets.
>
> Recently, we discovered a problem with systems backed up in this way.
>
> Bacula does not only back up sparse data; it also restores the data in such a
> way, which can result in problems. Imagine a virtual machine that has a (non-
> sparse!) file with large chunks of zero data in its file system. When these
> data are backed up, these null data are stored as a sparse stream.
>
> During restore, however, this can result in a problem: The sparse data (all
> zeros) are not written to the disk; instead, the respective chunk is just
> skipped (via seek). As a result, the virtual machine now has random data in
> its (formerly all-zero) file.
>
> While Bacula's auto-detection of sparse (32k-)blocks is more than welcome in
> our scenario, it can result in real data corruption. The solution -- as
> configured and implemented by us, though -- is flawed.
>
> Would you regard this behavior as a bug?
No.  If you set Sparse = yes, then you must either have a true sparse
file or you must have a file where zeros can be skipped.  If zeros in
a file or filesystem are important for you, do not use Bacula's sparse
file feature.

> Restored data are not identical with
> what was backed up. Or is this inteded behavior (which one should, I guess,
> document in a better fashion), and we are using the technology in a wrong way?

Restored data will not be identical with Bacula's sparse feature, but 
that is
not a problem with real sparse file.

>
> Btw: When restoring a block device that has a number of zeros at its end into
> a file (e.g., by pre-creating such a file -- see mail thread "Behavior w.r.t.
> block device backup and restore", March 2011, for more information) differs
> from a file created e.g. by "dd if=/dev/foo of=output" directly. That being
> said, zeroing a raw block device before restoring is not a solution for all
> cases.
>
> Any solution you'd propose?

Do not use Bacula's sparse option for such files.

Best regards,
Kern

>
> Best
>     Bastian
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to