DRBDMETA(8)

✨ NAME ✨

drbdmeta β€” manipulate the DRBD on-disk metadata πŸ’…


πŸŽ€ 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 πŸ¦‹

Okay so bestie, drbdmeta is the utility for creating, displaying, and modifying DRBD's on-disk metadata. Normally you'd never touch it directly β€” you'd use drbdadm, which gives you a way more high-level interface to DRBD than drbdmeta does. (Want receipts on how drbdadm actually drives drbdmeta? Peep drbdadm's --dry-run option. πŸ‘€)

⚠️ Real talk: this utility can only be used on devices that are not currently in use by the kernel. Don't even try it otherwise.

Now the arguments, in order, because order matters, periodt:

  1. device β€” the first argument. It's the drbd device associated with a volume, or - if no device is associated with that volume. If you do specify a drbd device, drbdmeta makes sure that drbd device doesn't currently have a volume attached β€” because otherwise you'd be destroying the metadata of an active volume, and we are not doing that today. 😭
  2. The metadata version β€” second argument, one of v06, v07, v08, v09.
  3. meta_dev β€” third argument. In most metadata versions, this is the device that contains the metadata. It can totally be the same as device. ✨
  4. index β€” fourth argument. It's one of these 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
    • a numeric metadata index β€” for fixed-size external metadata

See the meta-disk parameter in drbd.conf(5) for the full lore. πŸ“–


πŸ’– OPTIONS πŸ’–

  • --force β€” assume yes as the answer to every single question drbdmeta would ask. It just stops asking. Iconic, slightly terrifying. 🫢
  • --ignore-sanity-checks β€” normally drbdmeta runs some sanity checks before writing to the metadata device: for example, if the device looks like it contains a file system, it flat-out refuses to destroy that file system by writing into it. Use this option to ignore those checks. 😳
🚨 That second one is literally named "ignore sanity checks". Think about that before you type it.

πŸ”₯ COMMANDS πŸ”₯

Here's the create-md lineup, exactly as it comes:

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={automatic|zeroout|pwrite|skip}] [--al-stripes=val]
[--al-stripe-size-kB=val] (metadata version v09)
[--bitmap-block-size=val]
  • create-md β€” initialize the metadata. This is necessary before a DRBD resource can be attached. If drbdmeta finds an older version of DRBD metadata sitting on the device, it asks whether 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. Want to reserve extra bitmap slots so you can add more peers later? Then call drbdmeta directly instead of going through drbdadm. πŸ‘‘

When a device is used before it's ever been connected to its peers, DRBD assumes peers can only handle 4 KiB requests by default. The --peer-max-bio-size option lets you set more optimistic values β€” use it if you actually know which DRBD versions this device will connect to. 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 you can choose to only try the fast method (zeroout, which tries ioctl BLKZEROOUT only), only use explicit pwrite calls, or skip this bitmap initialization phase completely. If you're planning to do an initial full sync anyway, you can use skip and leave the bitmap initialization to the kernel β€” that 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 you're living on top of a striped 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" 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

With the --bitmap-block-size option you can change the change-tracking bitmap's granularity from 4KiB to another value. Allowed values are: 4k, 8k, 16k, 32k, 64k, 128k, 256k, 512k, 1M. The benefit of a larger block size is a reduced bitmap size and a smaller memory footprint for the DRBD volume. The disadvantage is a higher resync volume if the workload writes to the DRBD devices at a finer granularity, since drbd rounds each modified block up to a complete bitmap block for change tracking, and later resync. βš–οΈ

  • 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, so use the node-id option to define which peer's data generation identifiers to show. 🫢
  • show-gi [--node-id=id] β€” similar to get-gi, but with explanatory information. It's the version that actually explains itself. πŸ’œ
  • dump-md β€” dump the metadata of a device in text form, including the bitmap and activity log. πŸ“
  • 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. 🌈
  • 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. πŸ“
  • apply-al β€” apply the activity log of the specified device. This is necessary before the device can be attached by the kernel again. πŸ”‘
  • 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. 🩹

🧚 EXPERT COMMANDS 🧚

🚨 Bestie. Listen. The drbdmeta utility can be used to fine tune metadata. Please note that this can lead to destroyed metadata or even silent data corruption; use with great care only. Silent. Data. Corruption. Not a vibe. 😭
  • 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 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. ♻️

⭐ 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>. Found a bug? Tell the list, not the group chat. πŸ™ˆ


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. πŸ“œ


🌈 SEE ALSO 🌈


And that's the whole page, bestie β€” DRBD 9.0.0, dated 6 December 2012, from the DRBDMETA(8) corner of the System Administration manual. Go forth and be careful with --force. πŸ’–βœ¨πŸŽ€