[DRBD-user] Multi-disk devices possible?

Sebastian spa at syntec.co.uk
Fri Jun 3 19:33:59 CEST 2011

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


Summary: help with dd!

Felix Frank wrote:
> On 06/03/2011 11:06 AM, Sebastian wrote:
>> I presume that to do this I would need to break my existing DRBD
>> set-up and possibly lose all the data on it?  How can I do this
>> without losing the data?  Can I make the cluster stand-alone,
>> reconfigure one of the nodes to use an LVM Volume as my backing
>> device, make that one the primary, wait until it resyncs, do the
>> same on the other node, then extend the DRBD device, and then extend
>> the filesystem? 
> 
> What is the current layout and DRBD usage?

<reposted this part (sizes slightly edited) for ease of reference>

DRBD is being used as part of Openfiler to produce a HA cluster for NAS
storage.  The current layout on node1 is:
/dev/sda ~ 8 GB - O/S disk
/dev/sdb1 ~ 512 MB - /dev/drbd0 - used for cluster_metadata
/dev/sdb2 ~ 1TB-512MB - /dev/drbd1 (actually LVM so
/dev/mapper/vg0drbd-filer) - used for NAS
/dev/sdc1 ~ 1 TB - /dev/mapper/tempnas-tempnasv LV - temporary storage, has
90% of the data contained on /dev/sdb2 - I want to reformat this disk and
add it to /dev/drbd1, well /dev/mapper/vg0drbd-filer.

The current layout on node2 is:
/dev/sda ~ 8 GB - O/S disk
/dev/sdb1 ~ 512 MB - /dev/drbd0 - used for cluster_metadata
/dev/sdb2 ~ 1TB-512MB - /dev/drbd1 (actually LVM so
/dev/mapper/vg0drbd-filer) - used for NAS
/dev/sdc1 ~ 1 TB - unformatted.

</end repost>

> You could get away with doing this online.
> 
> 1. Create VG on secondary (with free disks, assuming you have those)
> 2. take secondary offline, dd everything to an LV in the new VG

I've done #1, took secondary offline, and trying dd:

[root at Openfiler2 etc]# dd if=/dev/vg0drbd/filer of=/dev/local/r1
dd: opening `/dev/vg0drbd/filer': No such file or directory

I tried making the old vg (vg0drbd) available, but that didn't help:

[root at Openfiler2 etc]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/local/r1
  VG Name                local
  LV UUID                e61tb2-FkVu-j3mv-OLJ5-EFOl-ClWY-xx59RN
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                975.93 GiB
  Current LE             249837
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/vg0drbd/filer
  VG Name                vg0drbd
  LV UUID                eSuNJr-yFDC-WCET-sIgi-IgTf-JRYz-Ack7oe
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                975.41 GiB
  Current LE             249704
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

N.B. The difference in size is due to the 512 MB partition in sdb1.  So sdc1
is larger than sdb2 by around 512 MB.  Given this difference in size, am I
ok to clone using dd?  I presume I will need to resize the filesystem to the
slightly larger partition size (and then I will need to do it again after
adding the other LV).

Instead of the above dd, do I need to use something like:
[root at Openfiler2 etc]# dd if=/dev/sdb2 of=/dev/sdc1
?  Or will that clone the LVM stuff like the LV UUID and whatever else LVM
writes? The examples I have seen are like this:
[root at Openfiler2 etc]# dd if=/dev/sdb of=/dev/sdc
But I don't need to clone the entire drive.  sdb1 is fine how it is.  It is
being used as /cluster_metadata under a separate DRBD resource.

> 3. bring secondary back, using the new LVM backing device
> 4. promote secondary, repeat on former primary
> 5. scrub former backing devices, include in VG and expand LVs
> as desired
> 6. resize the DRBD as explained in the User's Guide
> 
> Cheers,
> Felix


Kind regards,

Sebastian




More information about the drbd-user mailing list