DRBDMETA(8)

πŸ’Ύ DRBDMETA(8) β€” the one where we mess with DRBD's on-disk metadata πŸ’…

okay bestie, before we even start: this is the DRBDMETA(8) page from the System Administration section of the manual, and it's literally about Manipulate the DRBD on-disk metadata. Buckle up. πŸŽ€

✨ NAME ✨

drbdmeta β€” Manipulate the DRBD on-disk metadata. That's the whole vibe. πŸ¦‹

✨ SYNOPSIS ✨

drbdmeta [--force] [--ignore-sanity-checks] {device} {v06 minor |
         v07 meta_dev index | v08 meta_dev index | v09 meta_dev index}
         {command} [cmd args...]

🌸 DESCRIPTION 🌸

So the drbdmeta utility is what you use for creating, displaying, and modifying DRBD's on-disk metadata. Like, that's its whole personality. πŸ’…

Most of the time you're not even gonna talk to it directly β€” users usually interact with the drbdadm utility, which gives you a much more high-level interface to DRBD than drbdmeta does. (Peep drbdadm's --dry-run option if you wanna see exactly how drbdadm uses drbdmeta β€” iykyk πŸ‘€.)

⚠️ big one: this utility can only be used on devices which are not currently in use by the kernel. no cap.

Okay so the args, in order, because order matters bestie:

  • The first argument (device) specifies the drbd device associated with a volume, or - if no device is associated with that volume. If you do specify the drbd device, the drbdmeta utility makes sure that the drbd device doesn't currently have a volume attached β€” that's literally so that metadata of an active volume doesn't get destroyed. protect the metadata at all costs 😭
  • The second argument specifies the metadata version to use: v06, v07, v08, v09.
  • In most metadata versions, the third argument (meta_dev) specifies the device which contains the metadata; this argument can be the same as device.
  • The fourth argument (index) can be one of the keywords:
    • internal β€” for internal metadata
    • flex-internal β€” in v07 for variable-sized metadata; v07 otherwise defaults to fixed-size internal metadata
    • flex-external β€” for variable-sized external metadata
    • or a numeric matadata index β€” for fixed-size external metadata

And if you're confused, go read the meta-disk parameter in drbd.conf(5). 🫢


⭐ OPTIONS ⭐

  • --force β€” Assume yes as the answer to all questions drbdmeta would ask. She's feeling agreeable today. πŸ’–
  • --ignore-sanity-checks β€” Normally, drbdmeta performs some sanity checks before writing to the metadata device: for example, if the device appears to contain a file system, it refuses to destroy the file system by writing into it. Use this option to ignore these checks. this is the "yolo" flag, pls be careful πŸ™ˆ

πŸ”₯ COMMANDS πŸ”₯

create-md

create-md [--peer-max-bio-size=val] (metadata versions v06, v07, and v08),
create-md {number-of-bitmap-slots} [--peer-max-bio-size=val]
          [--initialize-bitmap-mode={automatic|zeroout|pwrite|skip}]
          [--al-stripes=val] [--al-stripe-size-kB=val] (metadata version v09)

Initialize the metadata. This is necessary before a DRBD resource can be attached β€” like, no metadata, no attachment, periodt. If drbdmeta finds an older version of DRBD metadata on the device, it asks if the format should be converted. 🧚

When drbdadm calls drbdmeta's create-md command for a device, it sets the number-of-bitmap-slots argument to the number of peers in the resource. To reserve additional bitmap slots (which allows you to add more peers in the future), call drbdmeta directly instead. main character energy: bypass the middleman πŸ’…

When a device is used before being connected to its peers the first time, DRBD assumes that peers can only handle 4 KiB requests by default. The --peer-max-bio-size option allows you to set more optimistic values; use this if the versions of DRBD that this device will connect to are known. And here's the timeline you need to know:

  • DRBD supports a maximum bio size of 32 KiB since version 8.3.8
  • of 128 KiB since version 8.3.9
  • and of 1 MiB since version 8.4.0

By default, we explicitly initialize the bitmap area to all zero. With --initialize-bitmap-mode you can chose to only try the fast method (zeroout, try ioctl BLKZEROOUT only), only use explicit pwrite calls, or skip this bitmap initialization phase completely. If you intend to do an initial full sync anyways, you can use skip to leave the bitmap initialization to the kernel. This can make a noticable difference when initializing huge volumes. Default is automatic, which is zeroout with an implicit fallback to pwrite. ✨

If you want to use more than 6433 activity log extents, or live on top of a spriped RAID, you may specify the number of stripes (--al-stripes, default 1), and the stripe size (--al-stripe-size-kB, default 32). To just use a larger linear on-disk ring-buffer, leave the number of stripes at 1, and increase the size only:

drbdmeta 0 v08 /dev/vg23/lv42 internal create-md --al-stripe-size 1M

To avoid a single "spindle" from becoming a bottleneck, increase the number of stripes, to achieve an interleaved layout of the on-disk activity-log transactions. What you give as "stripe-size" should be what is a.k.a. "chunk size" or "granularity" or "strip unit": the minimum skip to the next "spindle". πŸŒ€

drbdmeta 0 v08 /dev/vg23/lv42 internal create-md --al-stripes 7
--al-stripe-size 64

get-gi

get-gi [--node-id=id]

Show the data generation identifiers for a device on a particular connection. DRBD version 9.0.0 and beyond support multiple peers; use the node-id option to define which peer's data generation identifiers to show. πŸ‘‘

show-gi

show-gi [--node-id=id]

Similar to get-gi, but with explanatory information. Same tea, more context. πŸ“

dump-md

Dump the metadata of a device in text form, including the bitmap and activity log. It's giving "receipts". 🧾

outdate

Mark the data on a lower-level device as outdated. See drbdsetup(8) for details.

dstate

Show the current disk state of a lower-level device. vibe check, but for disks πŸ’€

check-resize

Examine the device size of a lower-level device and its last known device size (saved in /var/lib/drbd/drbd-minor-minor.lkbd by drbdsetup check-resize). For internal metadata, if the size of the lower-level device has changed and the metadata can be found at the previous position, move the metadata to the new position at the end of the block device. relocation era 🚚

apply-al

Apply the activity log of the specified device. This is necessary before the device can be attached by the kernel again. no shortcuts bestie 🌈

repair-md

repair-md [--tentative]

Repair known problems in metadata. Only problems that can be automatically fixed in a safe manner will be repaired. When --tentative is set, the metadata will only be checked, it will not be changed. look but don't touch πŸ‘€


🚨 EXPERT COMMANDS 🚨

Real talk: the drbdmeta utility can be used to fine tune metdata. Please note that this can lead to destroyed metadata or even silent data corruption; use with great care only. like, great care. this is not a drill πŸ’€πŸ’€πŸ’€

set-gi

set-gi gi [--node-id=id]

Set the generation identifiers. The gi argument is a generation counter for the v06 and v07 formats, and a set of UUIDs for v08 and beyond. Accepts the same syntax as in the get-gi output. DRBD version 9.0.0 and beyond support multiple peers; use the --node-id option to define which peer's data generation identifiers to set. πŸ’œ

restore-md

restore-md dump_file

Replace the metadata on the device with the contents of dump_file. The dump file format is defined by the output of the dump-md command. undo button, but make it metadata πŸŽ€


πŸ¦‹ VERSION πŸ¦‹

This document was revised for version 9.0.0 of the DRBD distribution.

πŸ‘‘ AUTHOR πŸ‘‘

Written by Philipp Reisner <philipp.reisner@linbit.com> and Lars Ellenberg <lars.ellenberg@linbit.com>. legends, honestly 🫢

πŸ› REPORTING BUGS πŸ›

Report bugs to <drbd-user@lists.linbit.com>. don't suffer in silence, tell the list πŸ’–

Copyright 2001-2008,2012 LINBIT Information Technologies, Philipp Reisner, Lars Ellenberg. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. read it and weep (affectionately) 😭

🌈 SEE ALSO 🌈

drbdadm(8) drbd.conf(5)


okay that's the whole page bestie, go forth and slay your metadata βœ¨πŸ’…

much love from the DRBD 9.0.0 era, dated 6 December 2012 β€” this page said what it said and then dipped πŸŽ€

πŸ“¦ where this page comes from