Hi,

bacula is able to back up data from block devices by listing them as dedicated 
files in filesets. During restore, data is expected to be dumped back to these 
devices.

However, this results in ambiguities when restoring to a location ("where" 
statement) other than the system root. E.g., restoring to a temporary 
directory/location (I'm using /tmp in this example) results in the device file 
being created in the respective location, and the data being fed to that 
device -- possibly resulting the data being written to the "original" space. 
E.g., if a device /dev/sda1 was backed up, a device file /tmp/dev/sda1 will be 
created with the major/minor pair of /dev/sda1 -- and data being written to 
that device file will overwrite the system's /dev/sda1 -- not in an 
alternative location, as the user might expect.

Interestingly, if a (file!) /tmp/dev/sda1 pre-exists, data is written into 
that file; the block device is not recreated. That file can e.g. be an empty 
file (touch /tmp/dev/sda1), or a loopback device (dd if=/dev/zero of=foo...; 
mknod /tmp/dev/sda1 b 7 1; losetup /tmp/dev/sda1 foo).

I am unhappy with that situation; restoring with a given "where" location 
should never ever write data into the system's devices. At the same time, I 
was only able to restore data that was originally stored in a device to a file 
by the "hack" described above.

As a side note, interestingly, the linux kernel happily accepted data for a 
block device that it did not have an appropriate module for during a restore. 
I was handling DRBD devices; after a backup of a DRBD device on one machine, I 
did not encounter any error messages on a machine that did not have an 
appropriate DRBD setup during restore. Data was never restored, however.

What do you think? Is the behavior as it is the way you'd expect it to be? 
Would you rather think that the current behavior should be changed and 
documented in a better way?

>From my point of view, it would be sensible to
a) _always_ create files (instead of block devices) for restored data when an
   alternative location is given during restore
and/or
b) having a separate restore flag ("dump to file" vs. "dump to device") for
   block device restore behavior

Thx
   Bastian

-- 
Collax GmbH . Basler Str. 115a . 79115 Freiburg . Germany
p: +49 (0) 89-990 157-28        www.collax.com

Geschäftsführer: Bernd Bönte, Boris Nalbach
AG München HRB 173695. Ust.-IdNr: DE270819312

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to