[prev in list] [next in list] [prev in thread] [next in thread] 

List:       drbd-user
Subject:    Re: [DRBD-user] Syncing new disk w/ existing node
From:       "Luis Garrido" <luisgarrido () users ! sourceforge ! net>
Date:       2008-09-21 20:27:14
Message-ID: ffda12330809211327r64be141di497d947165689260 () mail ! gmail ! com
[Download RAW message or body]

On Sun, Sep 21, 2008 at 10:23 PM, Luis Garrido
<luisgarrido@users.sourceforge.net> wrote:
>> Also, is there a nice way to get relationship between resource name and DRBD
>> device number? It'd be nice if that was listed in /proc/drbd.
>>
>
> drbdadm dump $RESOURCE | grep -o -m 1 '/dev/drbd[0-9]*'
>

And the following one-liner will give you the maximum device number in
use, handy for automating the addition of new resources:

drbdadm dump | awk
'BEGIN{max=-1}/\/dev\/drbd/{n=substr($2,10,length($2)-10);if (n>max)
max=n;}END{print max}'
_______________________________________________
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic