Mailing List Archive

datadisk scripts
Hi,

First of all: Thanks for this piece of really cool (tm) software.
But, the datadisk script(s) still seem to be broken. I was able to fix the
obvious faults (changed Option/Resource to Resource/Option for drbdc, see
patch), but there are still problems.
First, I'm sorry, I don't (yet) understand the drbd_common script, so I
can't fix anything which belongs there. This is (in my opinion) the $SAFE
variable. datadisk and drbdc complained about it, so I added it there. This is
not the solution, but now the scripts work (at least fo me). Another thing is
the drbd script is never called, so drbdsetup will never be initalized with the
correct values from /etc/sysconfig/drbd/drbd[0-255].
A point from my whish-list: I don't want to have any drbd related entry in my
fstab, so I want to add something like MOUNTPOINT to the configfile. It sound
quite easy, but as I don't understand drbd_common ...

Another thing, which should be mentioned somewhere in the docs: It is not
possible to start drbd when the other node is completly down. (Everything is
o.k., but when you try to mount you get an error: Specify filesystem... from
mount). This could be done if you use the -d (Size of disk) flag for drbdsetup.
Then there's no problem, only when the other node come up and has a diffrent
idea of the "right" disk size.

Bye, Sven

P.S.: I used the CVS Version of drbd (12/08/2000, 00:15), the patches are
against this version.
Re: datadisk scripts [ In reply to ]
Sven,

As far as I can see, these changes arn't needed at all.
I think you've patched all this against an older version of CVS DRBD.
Can you check against this:

axe:~/drbd/scripts$ cat CVS/Entries
/Makefile/1.11/Mon Nov 27 17:27:45 2000//
/README/1.5/Wed Nov 1 10:29:30 2000//
/TODO/1.5/Tue Dec 5 09:43:54 2000//
/datadisk/1.39/Mon Dec 4 12:08:58 2000//
/drbd/1.23/Fri Dec 1 09:31:41 2000//
/drbd.example/1.12/Tue Nov 14 19:42:07 2000//
/drbd_common/1.5/Mon Dec 4 11:05:33 2000//
/drbdc/1.14/Mon Nov 20 15:51:00 2000//
D

Omar.

At 05:16 AM 8/12/2000 +0100, Sven Sunder wrote:
>Hi,
>
>First of all: Thanks for this piece of really cool (tm) software.
>But, the datadisk script(s) still seem to be broken. I was able to fix the
>obvious faults (changed Option/Resource to Resource/Option for drbdc, see
>patch), but there are still problems.
>First, I'm sorry, I don't (yet) understand the drbd_common script, so I
>can't fix anything which belongs there. This is (in my opinion) the $SAFE
>variable. datadisk and drbdc complained about it, so I added it there. This is
>not the solution, but now the scripts work (at least fo me). Another thing is
>the drbd script is never called, so drbdsetup will never be initalized
>with the
>correct values from /etc/sysconfig/drbd/drbd[0-255].
>A point from my whish-list: I don't want to have any drbd related entry in my
>fstab, so I want to add something like MOUNTPOINT to the configfile. It sound
>quite easy, but as I don't understand drbd_common ...
>
>Another thing, which should be mentioned somewhere in the docs: It is not
>possible to start drbd when the other node is completly down. (Everything is
>o.k., but when you try to mount you get an error: Specify filesystem... from
>mount). This could be done if you use the -d (Size of disk) flag for
>drbdsetup.
>Then there's no problem, only when the other node come up and has a diffrent
>idea of the "right" disk size.
>
>Bye, Sven
>
>P.S.: I used the CVS Version of drbd (12/08/2000, 00:15), the patches are
>against this version.
Re: datadisk scripts [ In reply to ]
Hi Omar,

Im sorry, I think my CVS version is newer:

cat ha/drbd-cvs/drbd/scripts/CVS/Entries
/README/1.5/Wed Nov 1 10:29:30 2000//
/drbd.example/1.12/Tue Nov 14 19:42:07 2000//
/drbdc/1.14/Mon Nov 20 15:51:00 2000//
/Makefile/1.11/Thu Dec 7 23:15:14 2000//
/TODO/1.5/Thu Dec 7 23:15:14 2000//
/datadisk/1.39/Thu Dec 7 23:15:15 2000//
/drbd/1.23/Thu Dec 7 23:15:15 2000//
/drbd_common/1.5/Thu Dec 7 23:15:17 2000//
D

And, of course, without these changes I made the scripts did nothing useful
(for me).

Bye, Sven

On Fri, 08 Dec 2000, you wrote:
> Sven,
>
> As far as I can see, these changes arn't needed at all.
> I think you've patched all this against an older version of CVS DRBD.
> Can you check against this:
>
> axe:~/drbd/scripts$ cat CVS/Entries
> /Makefile/1.11/Mon Nov 27 17:27:45 2000//
> /README/1.5/Wed Nov 1 10:29:30 2000//
> /TODO/1.5/Tue Dec 5 09:43:54 2000//
> /datadisk/1.39/Mon Dec 4 12:08:58 2000//
> /drbd/1.23/Fri Dec 1 09:31:41 2000//
> /drbd.example/1.12/Tue Nov 14 19:42:07 2000//
> /drbd_common/1.5/Mon Dec 4 11:05:33 2000//
> /drbdc/1.14/Mon Nov 20 15:51:00 2000//
> D
> Omar.
Re: datadisk scripts [ In reply to ]
> First of all: Thanks for this piece of really cool (tm) software.
> But, the datadisk script(s) still seem to be broken. I was able to fix the
> obvious faults (changed Option/Resource to Resource/Option for drbdc, see
> patch), but there are still problems.

It start to become obvious to the list that I am an awfull software
programmer ;*)

> First, I'm sorry, I don't (yet) understand the drbd_common script, so I
> can't fix anything which belongs there. This is (in my opinion) the $SAFE
> variable. datadisk and drbdc complained about it, so I added it there.
This is
> not the solution, but now the scripts work (at least fo me). Another thing
is
> the drbd script is never called, so drbdsetup will never be initalized
with the
> correct values from /etc/sysconfig/drbd/drbd[0-255].

I will change the code to stop this BIG confusion caused by the renaming of
the configuration file parameters.
I will try to do that soon ..

> A point from my whish-list: I don't want to have any drbd related entry in
my
> fstab, so I want to add something like MOUNTPOINT to the configfile. It
sound
> quite easy, but as I don't understand drbd_common ...

The mount point was removed from the configuration to not have duplicate
information and keep mount information where they must be in /etc/fstab.

> Another thing, which should be mentioned somewhere in the docs: It is not
> possible to start drbd when the other node is completly down. (Everything
is
> o.k., but when you try to mount you get an error: Specify filesystem...
from
> mount). This could be done if you use the -d (Size of disk) flag for
drbdsetup.
> Then there's no problem, only when the other node come up and has a
diffrent
> idea of the "right" disk size.

If you look your log you will find that drbd report the size it is using and
you can copy this in your configuration file.

> P.S.: I used the CVS Version of drbd (12/08/2000, 00:15), the patches are
> against this version.

It is not a problem, I don't apply patch I read them and apply them by hand
... ;*)
Old school ;*)

Thomas
Re: datadisk scripts [ In reply to ]
Sven,

The version numbers are the same, but the dates are different, which means
your changes are local. I think.
Go to some other directory and do clean cvs checkout, and you should see
the changes made.
[.For example, my clean CVS version (1.39) of datadisk/1.14 of drbdc has
case "$OPTION" in) instead of case "$1" in) , also, all that RESOURCE and
OPTION stuff was fixed, as well as SAFE. Plus pretty much everything else :-)]

[.Erm - ok, datadisk is now at 1.40 ... I just checked. They've merged your
changes to some things. But ... uhm.
{drbdc : line 69}
case "$1" in)
doesn't make sense - because now the calling of drbdc by datadisk has changed.
instead of
$INSTALL/drbdc command $RESOURCE
we now have
$INSTALL/drbdc $RESOURCE command

Since drbdc tests for the command ... it should be testing $2, not $1.
Since $1 is the RESOURCE.
Argh.
Now I see what your patch did. Yay. Good Work ;-)
]

Regards,
Omar



At 11:24 AM 8/12/2000 +0100, Sven Sunder wrote:
>Hi Omar,
>
>Im sorry, I think my CVS version is newer:
>
>cat ha/drbd-cvs/drbd/scripts/CVS/Entries
>/README/1.5/Wed Nov 1 10:29:30 2000//
>/drbd.example/1.12/Tue Nov 14 19:42:07 2000//
>/drbdc/1.14/Mon Nov 20 15:51:00 2000//
>/Makefile/1.11/Thu Dec 7 23:15:14 2000//
>/TODO/1.5/Thu Dec 7 23:15:14 2000//
>/datadisk/1.39/Thu Dec 7 23:15:15 2000//
>/drbd/1.23/Thu Dec 7 23:15:15 2000//
>/drbd_common/1.5/Thu Dec 7 23:15:17 2000//
>D
>
>And, of course, without these changes I made the scripts did nothing useful
>(for me).
>
>Bye, Sven
>
>On Fri, 08 Dec 2000, you wrote:
> > Sven,
> >
> > As far as I can see, these changes arn't needed at all.
> > I think you've patched all this against an older version of CVS DRBD.
> > Can you check against this:
> >
> > axe:~/drbd/scripts$ cat CVS/Entries
> > /Makefile/1.11/Mon Nov 27 17:27:45 2000//
> > /README/1.5/Wed Nov 1 10:29:30 2000//
> > /TODO/1.5/Tue Dec 5 09:43:54 2000//
> > /datadisk/1.39/Mon Dec 4 12:08:58 2000//
> > /drbd/1.23/Fri Dec 1 09:31:41 2000//
> > /drbd.example/1.12/Tue Nov 14 19:42:07 2000//
> > /drbd_common/1.5/Mon Dec 4 11:05:33 2000//
> > /drbdc/1.14/Mon Nov 20 15:51:00 2000//
> > D
> > Omar.
Re: datadisk scripts [ In reply to ]
> Hi Omar,
>
> Im sorry, I think my CVS version is newer:
>
> cat ha/drbd-cvs/drbd/scripts/CVS/Entries
> /README/1.5/Wed Nov 1 10:29:30 2000//
> /drbd.example/1.12/Tue Nov 14 19:42:07 2000//
> /drbdc/1.14/Mon Nov 20 15:51:00 2000//
> /Makefile/1.11/Thu Dec 7 23:15:14 2000//
> /TODO/1.5/Thu Dec 7 23:15:14 2000//
> /datadisk/1.39/Thu Dec 7 23:15:15 2000//
> /drbd/1.23/Thu Dec 7 23:15:15 2000//
> /drbd_common/1.5/Thu Dec 7 23:15:17 2000//
> D
>
> And, of course, without these changes I made the scripts did nothing
useful
> (for me).
>
> Bye, Sven

The problem triggered by thye patch was real (even if not harmfull)
I applied it. thank you.

Thomas
Re: datadisk scripts [ In reply to ]
Hi,

I took another look at the scripts and found out how they worked (together) ;-)

I think the drbd script is meant to be called before everything else, but I
think it could be a good idea to call it from datadisk start. It wouldn't do
any harm (would it ?) but then you are on the safe side.



> > First, I'm sorry, I don't (yet) understand the drbd_common script, so I
> > can't fix anything which belongs there. This is (in my opinion) the $SAFE
> > variable. datadisk and drbdc complained about it, so I added it there.
>
> I will change the code to stop this BIG confusion caused by the renaming of
> the configuration file parameters.
> I will try to do that soon ..

No need, I think, I just hadn't read drbd_common closely enough to see the
problem. You call have_env SAFE $SAFE, but at this point you can't have SAFE,
because the config file isn't parsed before. Or am I missing something ?

> The mount point was removed from the configuration to not have duplicate
> information and keep mount information where they must be in /etc/fstab.

Right, so far, but fstab is parsed at bootup, so I don't want the drbd device
in there. (drbd on top of SW-RAID) But I figured out how to add my own options
;-)

> Thomas

These patches are against the CVS Version from today, just some minor fixes:
datadisk: Added call to drbd start
drbd: Changed parameters to $RESOURCE $COMMAND
drbd_common: Removed have_env SAFE $SAFE
drbdc: Changed case "$1" to case "$OPTION" (You forgot to apply this, Thomas ?)
Changed the usage to reflect the changes

Bye, Sven
Re: datadisk scripts [ In reply to ]
On Fri, Dec 08, 2000 at 06:15:54PM +0100, Sven Sunder wrote:
>
> > The mount point was removed from the configuration to not have duplicate
> > information and keep mount information where they must be in /etc/fstab.
>
> Right, so far, but fstab is parsed at bootup, so I don't want the drbd device
> in there. (drbd on top of SW-RAID) But I figured out how to add my own options
> ;-)

Having the mount point in fstab is not a problem. Just add noauto to the
mount options and the "mount -a" that runs at start up will skip over the
entry. For example:

/dev/nbd0 /drbdvol0 ext2 defaults,noauto 1 1

is all you need. The upside of having it in fstab is that all the tools
that know about fstab still work.

-dg


David Gould dg@example.com
SuSE, Inc., 580 2cd St. #210, Oakland, CA 94607 510.628.3380
"As I've gained more experience with Perl it strikes me that it
resembles Lisp in many ways, albeit Lisp as channeled by an awk
script on acid." -- Tim Moore <moore@example.com>,
on comp.lang.lisp
Re: datadisk scripts [ In reply to ]
David Gould wrote:
>
> On Fri, Dec 08, 2000 at 06:15:54PM +0100, Sven Sunder wrote:
> >
> > > The mount point was removed from the configuration to not have duplicate
> > > information and keep mount information where they must be in /etc/fstab.
> >
> > Right, so far, but fstab is parsed at bootup, so I don't want the drbd device
> > in there. (drbd on top of SW-RAID) But I figured out how to add my own options
> > ;-)
>
> Having the mount point in fstab is not a problem. Just add noauto to the
> mount options and the "mount -a" that runs at start up will skip over the
> entry. For example:
>
> /dev/nbd0 /drbdvol0 ext2 defaults,noauto 1 1
>
> is all you need. The upside of having it in fstab is that all the tools
> that know about fstab still work.

You should use
/dev/nbd0 /drbdvol0 ext2 defaults,noauto 1 0
------------------------------------------------------------^^^!

or this device would be fscked on boot, which is a bad thing if the
other node is primary or this device is just not existing yet...

Juri


--
juri.haberland@example.com
system engineer innominate AG
clustering & security the linux architects
tel: +49-30-308806-45 fax: -77 http://www.innominate.com
AW: datadisk scripts [ In reply to ]
Hi Thomas,

Just a question regarding drbd script:
can you please explain the logic for when to wait for synchronisation to
finish after configuring a device?

The way it is now, drbd never waits for resync to finish when configured
with heartbeat; I'm not sure this is a good idea - shouldn't drbd ALWAYS
wait for resync to finish if the other side can be reached? before the
resync finishes the drbd device is not in a usable state and so other
programs shouldn't be geiven a chane to mess things up.

Bye, Martin

"you have moved your mouse, please reboot to make this change take effect"
--------------------------------------------------
Martin Bene vox: +43-316-813824
simon media fax: +43-316-813824-6
Nikolaiplatz 4 e-mail: mb@example.com
8020 Graz, Austria
--------------------------------------------------
finger mb@example.com for PGP public key
Re: datadisk scripts [ In reply to ]
En réponse à Juri Haberland <juri.haberland@example.com>:
> You should use
> /dev/nbd0 /drbdvol0 ext2 defaults,noauto 1 0
> ------------------------------------------------------------^^^!

I use 0 0 , what is the difference ?
BTW, I will add this info to the README ..
Re: datadisk scripts [ In reply to ]
"Thomas MANGIN" wrote:
>
> En réponse à Juri Haberland <juri.haberland@example.com>:
> > You should use
> > /dev/nbd0 /drbdvol0 ext2 defaults,noauto 1 0
> > ------------------------------------------------------------^^^!
>
> I use 0 0 , what is the difference ?
> BTW, I will add this info to the README ..

[.Oops, I hit the wrong button and didn't send it to the list, so here
again...]

The first digit is used by archiving programs (like dump) to determine
the filesystems to include in the backup. E.g. /proc is a good candidate
being not backuped...

Juri

--
juri.haberland@example.com
system engineer innominate AG
clustering & security the linux architects
tel: +49-30-308806-45 fax: -77 http://www.innominate.com