My question is going to have some prelude because any step of those leading to the final situation could be important.
We're using bareos with vmware plugin to backup our VMs from ESXi hosts. Not so long ago we totally lost a data center and I got a weird backup at my hands. Because the vCenter it was fetched from is gone now the only remaining way to retrieve the backup was to pull VMDK image out of it which we succeed with only to realize that:
By introspecting the flat VMDK I managed to find all 4 ZFS labels. All 4 are seemingly intact. But apparently the two located at the end of the disk cannot be found.
At this point I'm currently stuck. What is almost clear to me is that somehow bareos skipped (419425020-417341440)=2083580 sectors. When I padded the flat data with zeroes it did help the system to handle the GPT tables but certainly didn't help in finding the last two ZFS labels.
I'm looking for any, even craziest, ideas as to how I can help the system find and mount the ZFS partition. I have good grounds to expect most if not all the data be there just waiting to be accessed.
One thing I'm thinking about is relocating the second two labels to where ZFS expects to find them. If I'm lucky then the sectors skipped by bareos are located somewhere between the actual files on the FS and the labels. Unfortunately, I don't know how to calculate the correct offsets. Aside of that, maybe something could be done to bareos itself to make it restore the full disk? Or something else I just can't think about at the moment.
We're using bareos with vmware plugin to backup our VMs from ESXi hosts. Not so long ago we totally lost a data center and I got a weird backup at my hands. Because the vCenter it was fetched from is gone now the only remaining way to retrieve the backup was to pull VMDK image out of it which we succeed with only to realize that:
- The resulting file is neither flat VMDK, nor monolithic one. I.e. it has some kind of descriptor data included, but it's in a binary form instead of text. And the file doesn't start with KDMV signature.
- The file size is less than it should be. The disk geometry 26108 cyl, 255 heads, 63 sec suggests at least 214745610240 bytes or 419425020 sectors; but in fact bareos came up with 213678818262 bytes which makes 417341440 sectors without the header.
zdb -l
results in this kind of report:
Code:
------------------------------------
LABEL 0
------------------------------------
version: 5000
name: 'zroot'
state: 0
txg: 20194798
pool_guid: 5321062894320895639
hostid: 2270722292
hostname: ''
top_guid: 2824987660710126592
guid: 2824987660710126592
vdev_children: 1
vdev_tree:
type: 'disk'
id: 0
guid: 2824987660710126592
path: '/dev/da0p3'
whole_disk: 1
metaslab_array: 37
metaslab_shift: 30
ashift: 12
asize: 201856647168
is_log: 0
create_txg: 4
features_for_read:
com.delphix:hole_birth
com.delphix:embedded_data
------------------------------------
LABEL 1
------------------------------------
version: 5000
name: 'zroot'
state: 0
txg: 20194798
pool_guid: 5321062894320895639
hostid: 2270722292
hostname: ''
top_guid: 2824987660710126592
guid: 2824987660710126592
vdev_children: 1
vdev_tree:
type: 'disk'
id: 0
guid: 2824987660710126592
path: '/dev/da0p3'
whole_disk: 1
metaslab_array: 37
metaslab_shift: 30
ashift: 12
asize: 201856647168
is_log: 0
create_txg: 4
features_for_read:
com.delphix:hole_birth
com.delphix:embedded_data
------------------------------------
LABEL 2
------------------------------------
failed to unpack label 2
------------------------------------
LABEL 3
------------------------------------
failed to unpack label 3
By introspecting the flat VMDK I managed to find all 4 ZFS labels. All 4 are seemingly intact. But apparently the two located at the end of the disk cannot be found.
At this point I'm currently stuck. What is almost clear to me is that somehow bareos skipped (419425020-417341440)=2083580 sectors. When I padded the flat data with zeroes it did help the system to handle the GPT tables but certainly didn't help in finding the last two ZFS labels.
I'm looking for any, even craziest, ideas as to how I can help the system find and mount the ZFS partition. I have good grounds to expect most if not all the data be there just waiting to be accessed.
One thing I'm thinking about is relocating the second two labels to where ZFS expects to find them. If I'm lucky then the sectors skipped by bareos are located somewhere between the actual files on the FS and the labels. Unfortunately, I don't know how to calculate the correct offsets. Aside of that, maybe something could be done to bareos itself to make it restore the full disk? Or something else I just can't think about at the moment.