<pre style="margin: 0em;">This helped me a great deal. Thanks. I just have a few questions...<br><br>1) is it best to unmount the /mnt/lvfoo/ before or after kpartx -d? because you have it in your procedure list both before and after kpartx -d. <br>
2) is it possible to explore this dump file by either mounting it or some other method?<br>3) what is the best procedure to replace this dump file in case of a disk failure? i.e. just install xen and use virt-install?<br>
4) is this the best possible method of backing up a domU?<br><br>Thanks.<br><br>Gerd Hoffmann wrote:<br></pre><blockquote style="border-left: 0.2em solid rgb(85, 85, 238); margin: 0em; padding-left: 0.85em;"><pre style="margin: 0em;">
Anne Facq wrote:<br></pre><blockquote style="border-left: 0.2em solid rgb(85, 85, 238); margin: 0em; padding-left: 0.85em;"><pre style="margin: 0em;">Because in Dom0 the device for a paravirt Domu (/dev/vg00/lvfoo in my<br>
case) is mapped to a virtual disk /dev/xvda (I created the Domu with<br>virt-install), and the only way I found to mount this Domu filesystem,<br>is to :<br>- get the size of the boot sector of /dev/vg00/lvfoo<br>    (with fdisk -ul /dev/vg00/lvfoo)<br>
    = 63<br>- compute the offset (multiply by block size)<br>- specify this offset to the mount command :<br>mount -o offset=32256 /dev/vg00/lvfoo /mnt/<br></pre></blockquote><pre style="margin: 0em;">Uh, oh, quite complicated and error prone.  Can be done much easier.<br>
<br>Option (1): Use kpartx, it will create device mapper mappings for your<br>partitions.  Try "kpartx -v -a /dev/vg00/lvfoo", should give you<br>/dev/vg00/lvfoop[1234].  "kpartx -d ... " removes the mappings.<br>
<br>Option (2): (works only with xen kernel): Configure the device as<br>virtual disk *in Domain-0*: "xm block-attach 0 phy:/dev/vg00/lvfoo xvda<br>w".  Gives you /dev/xvda[1234].  "xm block-detach ..." removes it.<br>
</pre></blockquote><pre style="margin: 0em;">Many thanks for this solution, it helps me a lot.<br><br></pre><tt>If this can help someone, here are the steps to backup a Domu 
</tt><tt>(filesystem on LVM in backend and on xvda in frontend) with the dump 
</tt><tt>command from Dom0 (Fedora 8), using one of the 2 solutions you advised, 
</tt><tt>kpartx :
</tt><pre style="margin: 0em;">----------------------------------------------------------------<br><br># The DomU named "foo" must be stopped before dump<br>xm shutdown -w foo<br><br></pre><tt># Creates device mapper mappings /dev/mapper/lvfoop[1234] for 
</tt><tt>/dev/vg00/lvfoo
</tt><pre style="margin: 0em;">kpartx -v -a /dev/vg00/lvfoo<br><br># Mounts temporarly the filesystem to backup<br>mount /dev/mapper/lvfoop1 /mnt/lvfoo/<br><br># Launches the dump<br>/sbin/dump 0 -L FULL_foo -f /BACKUP-XEN/foo.colddump /mnt/lvfoo/<br>
<br># Umount the filesystem<br>umount /mnt/lvfoo/<br><br># Removes the mappings<br>kpartx -d /dev/vg00/lvfoo<br><br># Unmount the filesystem<br>umount /mnt/lvfoo<br><br># The DomU can now be restarted<br>xm create --config /var/lib/xend/....<br>
<br>----------------------------------------------------------------<br><br>Regards,<br><br>Anne Facq<br><br></pre>