[DRBD-user] How does this look? Vserver on DRBD on RAID1 on a Gentoo system

Evert evert at poboxes.info
Fri Feb 3 13:58:38 CET 2006

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


Hi all!

I got the following useful pointers in reply to my posting:


Diego Julian Remolina wrote:
>> The plan:
>>
>> * Edit /etc/fstab on server A so that /dev/sda[X] gets mounted, 
>> instead of /dev/md[X].
>> * Power down
>> * Take out /dev/sdb (and put aside just in case of a major FUBAR) and 
> 
> Before you take out /dev/sdb make sure that it has grub installed and 
> that you can boot from it. Most of the times people create linux 
> software raid 1, but only installs grub on hard drive on, and so when 
> hard drive 2 fails, they cannot boot until they install grub on it as well.

Good point!  :-)
Is grub the only way to do this, or can I use dd to copy the boot-sector from the active boot disk to the other one?


>> replace it with an empty disk
>> * Boot up from /dev/sda
>> * Partition /dev/sdb as follows:
>>         /boot        100M
>>         [root]        25G
>>         /var        20G
>>         [swap]        5G
>>         /vservers    [remainder]
>           /dev/sdb7     1G  For drbd metadata.
> 
> It is *highly* recommended that you put your metadata in a separate 
> partition. This will eliminate a few headaches later down the road.

Good idea! Will 1GB always be enough? Current docs say 128MB will be used per drbd-partition. Will this remain so?

And, something I maybe overlooked in the docs, but: how should the metadata-partition be formatted? will any fs do? which one is recommended?


>> On to server B:
>> * Power down server A move 1 of its drives to server B. Put an empty 
>> drive in server A. Reboot server A & resync the RAID partitions 
>> on-the-fly.
>>
> 
> Sounds like a good plan, but why not leave server A up and running and 
> since your took Drive2 out of server A, then you simply copy the 
> partitions to one drive in server B and start setting everything up in 
> server B.  That way you are not working on your production server 
> (server A) putting it at risk of being damaged if you make a mistake.  
> You can always mount Drive2 from server A read only while in server B if 
> you are worried about damaging or altering the data and then use rsync 
> or parted to copy the partitions.

So my choices here are:
	*using mdadm to sync make md-partitions & sync in that way if I feel adventurous (1 typo & the syncing goes in the wrong direction...)
	* or use rsync/parted with the source-partitions mounted read-only?
		(I'm not that experienced with parted, but it looks like all I need is equal-sized partitions & the cp-command?)
and that is all partitions, except for the vservers & metadata partitions?

> At some point when both servers A and 
> B are up, you rsync all data partitions only (your vservers partition) 
> from server A to server B and now configure B to be your production 
> server.  You then work on server A to get it the same as B and then 
> finally start drbd making which ever has current data primary.

I'm not sure about the last part here. What work should I have to do on server A...?
Or... do you mean I should not do any repartitioning/configuring on server A in the beginning and only take out a drive & resync, and then  fully prepare server B?
Will rsyncing the data partition, which also contains mysql-databases, cause any problems?

Since server B has been made production server, the final step would be telling drbd that Server B = primary & Server A = secondary? That should get vservers/metadata partitions in sync, right?

I hope I have formulated my questions/remarks clearly. I'm looking forward to any/all comments!  :-)


Regards,
   Evert




More information about the drbd-user mailing list