Virstor provider lost metadata. Rescue possible?

Ivan Voras ivoras at freebsd.org
Mon Oct 12 07:44:45 UTC 2009


Frank Beckmann wrote:
> Hello,
> 
> one of my virstor providers lost its metadata. It looks like the sector got filled with random data. it is the second last filled sector in that virstor. Executing the command "gvirstor list", "gvirstor status" or "sysctl -a" resulted in a kernel panic.
> 
> I handcrafted the destroyed sector assuming that all chunks of that provider were used and setting the flags to 0. Now the kernel doesn't panic anymore but I get the error message:
> 
> GEOM_VIRSTOR[1]: virstor_check_and_run: Invalid entry 100542 in map for vs3
> GEOM_VIRSTOR[1]: virstor_check_and_run: provider_no: 25, n_components: 33 provider_chunk: 512, chunk_count 512
> 
> Provider 25 is the one which lost its metadata.
> 
> The version of FreeBSD is: 7.2-RC1
> 
> Is it possible to revive that virstor to rescue some of its data?

This is a serious problem, but as long as the first component of the
virstor is alive and, as you say, only the metadata is damaged on
component 25 (of 33), there is a chance.

It looks like chunk_count is wrong for provider 25 - it holds the number
of chunks (of default 4 MiB) on the device. You could calculate
device_size/4194304 and write it in the chunk_count field of the
reconstructed metadata - see if that helps (reference
/sys/geom/virstor/g_virstor_md.h).

You should make a backup of the first couple of chunks on the first
components (the actual number depends on your virstor virtual size - 16
MiB should be enough for most) and the metadata of all other components
before experimenting like this.

Do you have any idea how the metadata got damaged?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20091012/c9d99873/signature.pgp


More information about the freebsd-geom mailing list