[Rear-users] Restore problem on REHL5.1 VBox vm.

Dag Wieers dag at wieers.com
Mon Jan 23 20:35:12 CET 2012


On Mon, 16 Jan 2012, Dag Wieers wrote:

> On Mon, 9 Jan 2012, Dag Wieers wrote:
>> On Mon, 9 Jan 2012, shabahang elmian wrote:
>>
>>> seems that we need to destroy the partition table first on recover machine.
>>> It works fine, once I dd some blocks to the beginning of the disk.
>>
>> That makes sense, and we probably should do that as a best practice.
>
> In an unexpected leap of free time I added a small snippet that erases the
> MBR (both bootloader and partitioning table) before 'labeling' it with
> parted.

I have investigated this issue this evening (but not tested). There is a 
patch in Red Hat's parted 1.8.1 starting from 1.8.1-17.el5 (starting from 
RHEL5.2), the patches is named:

     parted-1.8.1-fix-scriptmode.patch

With this inside:

------
diff -up parted-1.8.1/parted/parted.c.scriptmode parted-1.8.1/parted/parted.c
--- parted-1.8.1/parted/parted.c.scriptmode	2007-12-18 19:25:26.000000000 -1000
+++ parted-1.8.1/parted/parted.c	2007-12-18 19:26:20.000000000 -1000
@@ -583,7 +583,7 @@ do_mklabel (PedDevice** dev)
          if (disk) {
                  if (!_disk_warn_busy (disk))
                          goto error_destroy_disk;
-		if (!_disk_warn_loss (disk))
+		if (!opt_script_mode && !_disk_warn_loss (disk))
                  	goto error_destroy_disk;
                  ped_disk_destroy (disk);
          }
@@ -618,7 +618,7 @@ do_mkfs (PedDevice** dev)
          if (!disk)
                  goto error;

-        if  (!_partition_warn_loss())
+        if  (!opt_script_mode && !_partition_warn_loss())
                  goto error_destroy_disk;

          if (!command_line_get_partition (_("Partition number?"), disk, &part))
------

The function _disk_warn_loss() is throwing the exception asking for 
confirmation. This function is called from the do_mklabel() action. 
Red Hat has moved this function around in their 1.8.1 RPM packages, but 
only the above patch influences it being called (when opt_script_mode is 
not set).

There does not seem to be any check of the MBR. So I doubt our change 
makes any difference and if the tests on RHEL5.1 prove to make no 
difference, it's better to revert the patch.

-- 
-- dag wieers, dag at wieers.com, http://dag.wieers.com/
-- dagit linux solutions, info at dagit.net, http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]




More information about the rear-users mailing list