Adding Local Storage Repository
When attempting to add a local SR on an XCP-NG server, we kept getting this error:
SR_BACKEND_FAILURE_77(, Logical Volume group creation failed, )
No amount of partition manipulation could make any difference. The 1 TB drive we were trying to add worked fine to install XCP-NG onto, but then we couldn’t create an SR on the same drive (although we might have been able to start over, partition the 1 TB and reinstall XCP-NG on the first partition, and maybe(?) add an SR on the second partition), so we added a second small drive for XCP-NG. However even though the installer found /dev/sda and /dev/sdb, we couldn’t get past this error when we tried to create the SR via XO or CLI.
This gave us a clue:
I managed to figure it out. It was because the drive was previously a member of a zfs setup. I haven’t read about how raid tags the drives but as soon as I could strip that data away it worked….
A little more digging gave us this solution:
Sometimes a hardware RAID controller or fakeraid (BIOS) can leave metadata that makes it impossible to install Windows or Linux….The only method I could find to delete the metadata *quickly* is to zero out the last 512KB of data on the disk using the following command:dd if=/dev/zero of=$YOUR_DEV bs=512 seek=$(( $(blockdev –getsz $YOUR_DEV) – 1024 )) count=1024
Replace $YOUR_DEV with the physical device, such as /dev/sda
You could just zero the whole disk, but that could take hours. This command executes in less than a second.