How to remove an old-school EXT3 Storage Repository and create a local LVM based SR with RAID 1

With newer XenServer Version (> 5.x) you cannot longer use the old EXT3 based local storage repositories to store your virtual disks. Citrix has introduced LVM based storage repositories instead.

Caution: Make a backup before executing the following steps, otherwise you’ll lose all your data on the disk!

I assume, we already have a configured RAID1 mirror with a XSLocalEXT storage repository due to a XenServer upgrade. If you want to create a new software mirror with two new installed local disks, you have to create a new md-device with mdadm (this is not part of this documentation).

First, identify the status and devices of the mirror

If the RAID is in “rebuild” status, wait until it’s in “active” status.

Get more details about the Software Mirror

 

Identify and remove old logical volume from RAID1

We want to remove the device /dev/XSLocalEXT …

First deactivate the LV if not already done

Now you can remove the LV. You must add the metadata_read_only option, because Xenserver sets a read-only flag.

Remove also the empty volume group

Check also, that the physical volume has no more corresponding logical volume

 

Reusing the local RAID1 by creating a new local storage repository with type=lvm

First, identify the MD-Partition with it’s uuid

Then create the new LVM based storage repository

Check, that the SR was successfully created

You can now use the new created SR in Xencenter to store your VMs.