I have created the raw devices using the following command:
Code: Select all
VBoxManage internalcommands createrawvmdk -filename /opt/lv0 -rawdisk /dev/mapper/vg0-lv0 -registerThank you in advance.
Code: Select all
VBoxManage internalcommands createrawvmdk -filename /opt/lv0 -rawdisk /dev/mapper/vg0-lv0 -registerCode: Select all
# cat lv1
# Disk DescriptorFile
version=1
CID=71cae7c6
parentCID=ffffffff
createType="fullDevice"
# Extent description
RW 819200000 FLAT "/dev/mapper/vg0-lv1" 0
# The disk Data Base
#DDB
ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="3c7e5d0c-007b-40e9-9b47-9b98489b108e"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="0d8bc9bf-5955-4cba-8823-72afe9f45197"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"
ddb.geometry.biosCylinders="1024"
ddb.geometry.biosHeads="255"
ddb.geometry.biosSectors="63"Code: Select all
dd if=/dev/vg/lv | bzip2 > /vmbackup/guest.img.gzThat seems like the obvious solution to me.l1x wrote:Another way would be to use the virtualbox clonehd stuff.
Code: Select all
[root@alfa ~]# VBoxManage clonehd /opt/lv0 /opt/backup/lv0_backupCode: Select all
UUID: 4442c7df-8dcb-403d-abec-7bf659267c56
Accessible: yes
Description:
Logical size: 50000 MBytes
Current size on disk: 9553 MBytes
Type: normal (base)
Storage format: VMDK
Location: /opt/backup/lv0_backup
The procedure you just used makes the guest OS fully virtual, the VDI file can be moved to different hosts and there is no reason for a physical copy of the partition to exist. If you change hosts in the future all you need do is create a new VM and mount that VDI in it.l1x wrote:The RAW device to file is working well, I was able to use clonehd to backup the guest to one file. The question is: how to use that file to restore the OS?