[DRBD-user] formatting a DRBD resource

Digimer lists at alteeve.ca
Thu Jan 30 01:57:08 CET 2014

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

On 29/01/14 06:40 PM, Paul O'Rorke wrote:
> Hi all,
> a quick question.  I have a DRBD resource that was once used as a drive
> for a Linux machine that used LVM.  I want to create a new VM (KVM
> based) that uses this resource.  I can start the installation OK - the
> installer 'sees' the 300GB drive (/dev/drbd/by-res/<resource>) but when
> I try using the partition manager in the Debian (guest) installer it
> complains that there is already LVM data on there and it won't allow me
> to use the drive without first cleaning up the LVM config on there.
> Is it possible to mount the resource in the host and use the command
> line LVM tools to 'clean' that up?  I was thinking that maybe I could
> use *dd* to clone a new clean resource of the same size but that seems
> silly.
> Does anyone have any suggestions for 'formatting' this resource so that
> it looks again like a clean un-partitioned disk?
> Thanks in advance.

Simplest would be to write zeros to the device;

dd if=/dev/zero of=/dev/drbd/by-res/<resource> bs=4M

If you know that the LVM metadata is at the first or end of the drive, 
you can limit the dd to count=X or use of offset to hit the end of the 

Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?

More information about the drbd-user mailing list