How to repair a VHD using VHD using vhd-util command ?

How to repair a VHD using VHD using vhd-util command ?

book

Article ID: CTX217757

calendar_today

Updated On:

Description

Sometime the VHD format of a VDI can become corrupt and result in error trying to read the footer. Vhd-util command can be used to recover the corruption to some extend. This article describe the procedure for that


Instructions

  1. Login into the XenServer Command Line using putty

 

  1. Identify the VDI uuid which  we would like to repair using the following command

 

#xe vdi-list name-label=<VDI name label shown in XenCenter>

 

          Note down the UUID of the VM

 

  1. Activate the LVM if its LVM based Storage Repository

 

#lvchange -ay /dev/mapper/<VHD-path>

 

For example

lvchange -ay /dev/mapper/VG_XenStorage--8681cbd1--ad58--210a--b32b--22429aac0571-VHD--ee68b172--024d--4972--aa69--1bc95b8ad181

 

  1. Repair the volume

 

 vhd-util repair -n  /dev/mapper/VG_XenStorage--8681cbd1--ad58--210a--b32b--22429aac0571-VHD--ee68b172--024d--4972--aa69--1bc95b8ad181

 

It should return nothing if it works fine

 

  1. Deactivate the Logical Volume

 

#lvchange -an /dev/mapper/<VHD-path>

 

For example

 

lvchange -an /dev/mapper/VG_XenStorage--8681cbd1--ad58--210a--b32b--22429aac0571-VHD--ee68b172--024d--4972--aa69--1bc95b8ad181