[Clonezilla-live] Bug found in lvm restoration, patch for this & test new lives CD
A partition and disk imaging/cloning program
Brought to you by:
steven_shiau
From: Gerald H. <ghe...@as...> - 2008-02-14 10:38:30
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hello Steven,<br> <br> Thanks for your very good job in Clonezilla.<br> <br> I find a pb in lvm restoration in some case.<br> The problem:<br> - Restoration process seems good, but kernel can't find his root (in LVM).<br> <br> Analyse :<br> - pvdisplay => PV is created<br> - vgdisplay => No VG is created<br> My source data (/home/partimage) are remote on a samba server.<br> in ocs-functions (and ocs-onthefly) the section is <br> <br> <tt> # create PV first<br> echo "Creating the PV... "<br> while read vg dev uuid; do<br> pvcreate -ff --yes --uuid $uuid $dev<br> done < $PV_PARSE_CONF<br> echo "done!"<br> <br> # Restore the vg conf<br> echo "Restoring the VG config... "<br> while read vg dev uuid; do<br> vgcfgrestore -f <font color="#ff0000"><b>$target_dir/lvm_$vg.conf</b></font> $vg 2>/dev/null<br> done < $PV_PARSE_CONF<br> echo "done!"<br> #</tt><br> <br> I notice 2 things :<br> <ul> <li>vgcfgrestor -f <tt>$target_dir/lvm_$vg.conf $vg => Use system function mmap for read the file, and this mmap function is not available on every remote filesystem (not in samba in my case). Then because of this call failed, and restoration of vg failed.<br> </tt></li> <li>It could be better to use : pvcreate -ff --yes --uuid $uuid ---restorefile /tmp/lvm_$vg.conf $dev, because, pvcreate in this case, create pv much identical than without (same topology if possible - see man pvcreate). pvcreate use mmap syustem call to.<br> </li> </ul> Patchs :<br> -<tt>-- ocs-functions-ORIG 2008-02-14 08:50:36.732643764 +0000<br> +++ ocs-functions 2008-02-14 09:42:13.013189303 +0000<br> @@ -3307,14 +3307,20 @@<br> # create PV first<br> echo "Creating the PV... "<br> while read vg dev uuid; do<br> - pvcreate -ff --yes --uuid $uuid $dev<br> + cp $target_dir/lvm_$vg.conf /tmp/ # mmap not available on remote disk<br> + pvcreate -ff --yes --uuid $uuid --zero y --restorefile /tmp/lvm_$vg.conf $dev<br> + rm /tmp/lvm_$vg.conf<br> done < $PV_PARSE_CONF<br> echo "done!"<br> <br> # Restore the vg conf<br> echo "Restoring the VG config... "<br> while read vg dev uuid; do<br> - vgcfgrestore -f $target_dir/lvm_$vg.conf $vg 2>/dev/null<br> + cp $target_dir/lvm_$vg.conf /tmp # mmap failed on some network fs<br> + vgcfgrestore -f /tmp/lvm_$vg.conf $vg 2>/dev/null<br> + rm /tmp/lvm_$vg.conf<br> done < $PV_PARSE_CONF<br> echo "done!"<br> #</tt><br> <br> Same patch should be apply to ocs-onthefly.<br> With this, all things is OK. I only copy localy file before starting commands, and after remote temporary file.<br> Don't you think it could be good to add command exit code for stop restoration if pre-requires are not done ? [I know it could be difficult in bash, but...]<br> <br> <br> I test both new .iso images : <br> -clonezilla-live-1.0.9-8.iso => kernel is to old, and my nic carte e1000 (last model in HP desktop), is not recognize.<br> -clonezilla-live-20080211-hardy-experimental.iso => Work well, and my e1000, is well seen.<br> <br> Thanks.<br> <br> Gerald<br> <br> <pre class="moz-signature" cols="72">-- ASTREL "Raison & Télécom" <a class="moz-txt-link-abbreviated" href="mailto:ghe...@as...">ghe...@as...</a> - <a class="moz-txt-link-freetext" href="http://www.astrel.fr">http://www.astrel.fr</a> </pre> </body> </html> |