0

I want to create a backup of a LVM volume (Xen DomU's), however a LVM volume can have multiple partitions and those are dynamic (I cannot guarantee LVM #1 has 1 partition and LVM #2 has 3 etcetera).

I'm using kpartx to mount a LVM volume, however it will create multiple mappings (1 for each partition + 1 swap) and I want to use rdiff-backup to backup the volume. But as I don't know how many partitions a volume has I cannot rely on this.

Now my question is: is there any way to let kpartx map all partitions but within the same "file"? For examply only /dev/mapper/lvm1 instead of /dev/mapper/lvm1, /dev/mapper/lvm2, /dev/mapper/lvm3 /dev/mapper/lvm5 (1 to 3 are partitions and 5 is swap).

I need this to use rdiff-backup to backup and restore a complete LVM volume

Devator
  • 1,463
  • 4
  • 17
  • 35

3 Answers3

2

I wonder if it would be possible for you to take another approach and use guestfish for accessing the domU file system(s).

Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78
1

The answer to your question is short: No - there in no way to let kpartx map all partitions but within the same "file"?

Remark: kpartx does not mount anything, it creates device maps.

From your questions it is not clear if the domu is running when the backup should be done. Therefore it's hard to give any further advice.

Andreas Florath
  • 284
  • 1
  • 6
0

You can use fsarchiver to backup your lvm. You can start from here http://www.fsarchiver.org/QuickStart

proy
  • 1,179
  • 8
  • 10
  • 1
    I'd rather not archive it. As I cannot use `rdiff-backup`, I need to see all individual files, archiving it will only create one (big) file. – Devator Mar 13 '12 at 12:31