<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I’m not sure why you wanted to “erase”
/dev/sdb1, but to do so, you’d use dd with an outfile of /dev/sdb1, not
/dev/sdb. You cleared the first megabyte of the disk, and that includes the
partition table. Maybe you wanted to create the metadata and it said metadata
was already there. So, use drbdadm -- --force create-md <res>. dd not
needed and you can’t specify the incorrect device. If the drbd
configuration specification is correct, the proper device will get the
metadata.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>If the disk does not contain data, there is no point in
synchronizing it. Just mark it empty and connect (drbdadm -- --clear-bitmap
new-current-uuid <resource>). It’s instant vs 30 minutes. Details
below.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thirdly, if the disk is dedicated to drbd, why a partition at
all, just use the whole disk, (/dev/sdb vs /dev/sdb1). You just waste space for
the partition table and confuse the issue.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Dan in Atlanta<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
drbd-user-bounces@lists.linbit.com [mailto:drbd-user-bounces@lists.linbit.com] <b>On
Behalf Of </b>Roberto Fastec<br>
<b>Sent:</b> Thursday, July 22, 2010 12:04 PM<br>
<b>To:</b> drbd-user@lists.linbit.com<br>
<b>Subject:</b> [DRBD-user] STRANGE ISSUE - disk partition deleted after resync<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>I'm doing my first tests with
drbd.<br>
My configuration is two pcs with two hdd each.<br>
One drive is xenserver the second is drbd dedicated. On the drbd dedicated
drive, I created /dev/sdb1 which in drbd.conf is assigned to drbd0.<br>
<br>
Well, because it is a test environment, I messed up the things a bit and so I had
to erase drbd0 (which still is not clear to me which is the correct procedure,
but I did it) and, to be sure, I also deleted and recreated /dev/sdb1.<br>
<br>
The idea was to start over with the creation of drbd0 resource.<br>
<br>
The first issue I had was about one error that was exiting the command <b><i>drbdadm
create-md drbd0</i></b>. Googleing I've found the solution was to (I'm not so
strong with dd) issue this command <b><i>dd if=/dev/zero bs=1M count=1
of=/dev/sdb; sync</i></b>, looks like that first 1MB data are moved (?), anyway
this worked.<br>
<br>
Then <b><i>drbdadm create-md drbd0</i></b> worked again and I finished
the sequence<br>
# drbdadm create-md drbd0 #Create device metadata<br>
# drbdadm attach drbd0 #Attach to backing
device<br>
# drbdadm syncer drbd0 #Set
synchronization parameters<br>
# drbdadm connect drbd0 #Connect to peer<br>
<br>
last I launched the primary command and started the sync<br>
# drbdadm -- --overwrite-data-of-peer primary drbd0<br>
<br>
and the sync worked fine, with a final average speed of 81MB/sec, in 35 minutes
the 200GB volume was synced, I also copied and pasted to my notes the cat
/proc/drbd command result while syncing<br>
[root@xenserver-2 dev]# cat /proc/drbd<br>
version: 8.3.8.1 (api:88/proto:86-94)<br>
GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by
root@localhost.localdomain, 2010-07-17 10:04:02<br>
0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----<br>
ns:935040 nr:0 dw:0 dr:11435392 al:0 bm:697 lo:145 pe:0
ua:145 ap:0 ep:1 wo:b oos:183876844<br>
[>...................]
sync'ed: 5.9% (179564/190732)M<br>
finish: 0:34:18 speed: 89,308
(76,232) K/sec<br>
<br>
when finished, it was late night and so I turned off the secondary, last the
primary and I went at home.<br>
<br>
Now I'm here to go on with my tests. Turned on the primary, turned on the
secondary and with my big surprise, I've found this<br>
<br>
[root@xenserver-2 ~]# drbd-overview<br>
0:drbd0 Unconfigured . . . .<br>
<br>
so I also lauched cat /proc/drbd<br>
<br>
[root@xenserver-2 ~]# cat /proc/drbd<br>
version: 8.3.8.1 (api:88/proto:86-94)<br>
GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by
root@localhost.localdomain, 2010-07-17 10:04:02<br>
0: cs:Unconfigured<br>
<br>
so I issued<br>
<br>
[root@xenserver-2 ~]# drbdadm up drbd0<br>
Can not open device '/dev/sdb1': No such file or directory<br>
Command 'drbdsetup 0 disk /dev/sdb1 /dev/sdb1 internal --set-defaults
--create-device --max-bio-bvecs=1 --on-io-error=detach' terminated with exit
code 20<br>
drbdadm attach drbd0: exited with code 20<br>
<br>
and because of the message, I checked with fdisk -l<br>
<br>
[root@xenserver-2 ~]# fdisk -l<br>
<br>
Disk /dev/sda: 500.1 GB, 500107862016 bytes<br>
255 heads, 63 sectors/track, 60801 cylinders<br>
Units = cylinders of 16065 * 512 = 8225280 bytes<br>
<br>
Device Boot
Start
End Blocks Id System<br>
/dev/sda1
*
1 523
4194304 83 Linux<br>
Partition 1 does not end on cylinder boundary.<br>
/dev/sda2
523 1045
4194304 83 Linux<br>
/dev/sda3
1045 60801
479995393 8e Linux LVM<br>
<br>
Disk /dev/sdb: 1000.2 GB, 1000215724032 bytes<br>
255 heads, 63 sectors/track, 121602 cylinders<br>
Units = cylinders of 16065 * 512 = 8225280 bytes<br>
<br>
Disk /dev/sdb doesn't contain a valid partition table<br>
<br>
Yes it is, /dev/sdb1 is disappeared... on both computers...<br>
<br>
Below you find the drbd.conf.<br>
<br>
My question are:<br>
- which is the correct mode to erase one drbd resource ?<br>
- is it possible what described above?<br>
- to be able to do such "disaster" (I'm thinking about a production
environment), what could be the error/mistake?<br>
- with the following configuration file, both the drbd are starting in
secondary mode, maybe this is wanted by drbd concept, but I can't understand it
very well.<br>
I mean, when everything works fine, I have one primary and one secondary.<br>
If I do a clean shutdown and I shut down first of all the secondary, next I
shut down the primary, why starting up first the primary and last the secondary
both of them are secondary? Is it the only solution <b><i>become-primary-on
server-1</i></b> statement? If yes... I have another issue.. this didn't
worked... and powercycling the two pcs in the correct order, again returned a
secondary/secondary situation.<br>
- Is it correct to use the server name in the following statement <b><i>become-primary-on
server-1</i></b> ?<br>
- Which are the downsides of usignthis setting in the drbd.conf: <b><i>become-primary-on
server-1</i></b> ?<br>
<br>
Thank you for any tip and help, follows the conf file<br>
Robert<br>
<br>
<br>
drbd.conf<br>
<br>
# You can find an example in /usr/share/doc/drbd.../drbd.conf.example<br>
<br>
#include "drbd.d/global_common.conf";<br>
#include "drbd.d/*.res";<br>
<br>
global {<br>
usage-count yes;<br>
}<br>
<br>
common {<br>
syncer { <br>
rate 1G;<br>
verify-alg md5;<br>
csums-alg md5;<br>
} <br>
}<br>
<br>
resource drbd0 {<br>
protocol C;<br>
<br>
startup {<br>
#become-primary-on xenserver-2;<br>
}<br>
<br>
net {<br>
cram-hmac-alg md5;<br>
shared-secret "ColdWater";<br>
sndbuf-size 0;<br>
rcvbuf-size 0;<br>
data-integrity-alg md5;<br>
}<br>
<br>
disk {<br>
max-bio-bvecs 1;<br>
on-io-error detach;<br>
}<br>
<br>
on server-1 {<br>
device /dev/drbd0;<br>
disk /dev/sdb1;<br>
address <a href="http://10.1.1.2:7789">10.1.1.2:7789</a>;<br>
meta-disk internal;<br>
}<br>
<br>
on server-2 {<br>
device /dev/drbd0;<br>
disk /dev/sdb1;<br>
address <a href="http://10.1.1.3:7789">10.1.1.3:7789</a>;<br>
meta-disk internal;<br>
}<br>
<br>
handlers {<br>
split-brain "/usr/lib/drbd/notify-split-brain.sh
root";<br>
}<br>
<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
</div>
</body>
</html>