Enabling your resource for the first time

After you have completed initial resource configuration as outlined in the previous sections, you can bring up your resource.

[Note]Note

Each of the following steps must be completed on both nodes.

  1. Create device metadata. This step must be completed only on initial device creation. It initializes DRBD's metadata:

    drbdadm create-md resource
    v08 Magic number not found
    Writing meta data...
    initialising activity log
    NOT initialized bitmap
    New drbd meta data block sucessfully created.
    success

        

  2. Attach. This step associates the DRBD resource with its backing device:

    drbdadm attach resource

  3. Connect. This step connects the DRBD resource with its counterpart on the peer node:

    drbdadm connect resource

    [Tip]Tip

    You may collapse the steps drbdadm attach and drbdadm connect into one, by using the shorthand command drbdadm up.

  4. Observe /proc/drbdDRBD's virtual status file in the /proc filesystem, /proc/drbd, should now contain information similar to the following:

    cat /proc/drbd
    version: 8.2.4 (api:88/proto:86-88)
    GIT-hash: fc00c6e00a1b6039bfcebe37afa3e7e28dbd92fa build by buildsystem@linbit, 2008-01-11 12:44:36
     0: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent C r---
        ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
            resync: used:0/31 hits:0 misses:0 starving:0 dirty:0 changed:0
            act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0

    The Inconsistent/Inconsistent disk state is expected at this point.

By now, DRBD has successfully allocated both disk and network resources and is ready for operation. What it does not know yet is which of your nodes should be used as the source of the initial device synchronization.